From f0c0b160e4dea60722f93b0be77c12f43e7b8bd7 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Tue, 9 Mar 2021 11:17:22 +0300 Subject: [PATCH 01/40] Add MDA-Lite plans reporting page --- docs/env.md | 6 ++ src/App/App.tsx | 10 +++ src/components/forms/PlanForm/helpers.ts | 1 + src/components/page/Header/index.tsx | 20 ++++- src/configs/env.ts | 8 ++ src/configs/lang.ts | 2 + src/configs/strings/en.json | 8 ++ src/constants.tsx | 1 + .../NewPlan/General/index.tsx | 1 + src/containers/pages/MDALite/plans/index.tsx | 86 +++++++++++++++++++ src/store/ducks/plans.ts | 1 + 11 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 src/containers/pages/MDALite/plans/index.tsx diff --git a/docs/env.md b/docs/env.md index fc28c41e4b..2846c55a76 100644 --- a/docs/env.md +++ b/docs/env.md @@ -113,3 +113,9 @@ Below is a list of currently supported environment variables: - Optional parameter of plan intervention types whose tasks should be generated on opensrp - Options: FI, IRS, IRS_Lite, MDA, MDA-Point, Dynamic-FI, Dynamic-IRS and Dynamic-MDA + + - **REACT_APP_ENABLE_MDA_LITE** + + - **not Required**; _(string)_ + - to activate set the env to `true`, any other value will be interpreted as false + - enables the monitor MDA Lite reporting page diff --git a/src/App/App.tsx b/src/App/App.tsx index f65f8c9d3f..0857c6fdc7 100644 --- a/src/App/App.tsx +++ b/src/App/App.tsx @@ -82,6 +82,7 @@ import { REACT_LOGIN_URL, REPORT_IRS_LITE_PLAN_URL, REPORT_IRS_PLAN_URL, + REPORT_MDA_LITE_PLAN_URL, REPORT_MDA_PLAN_URL, REPORT_MDA_POINT_PLAN_URL, REPORT_SMC_PLAN_URL, @@ -123,6 +124,7 @@ import ConnectedAutoSelectView from '../containers/pages/JurisdictionAssignment/ import { ConnectedEntryView } from '../containers/pages/JurisdictionAssignment/EntryView'; import ConnectedJurisdictionAssignmentView from '../containers/pages/JurisdictionAssignment/ManualSelectJurisdiction'; import JurisdictionMetadata from '../containers/pages/JurisdictionMetadata'; +import ConnectedMDALitePlansList from '../containers/pages/MDALite/plans'; import ConnectedChildReports from '../containers/pages/MDAPoint/ChildReports'; import ConnectedClientListView from '../containers/pages/MDAPoint/ClientListView'; import ConnectedMdaPointJurisdictionReport from '../containers/pages/MDAPoint/jurisdictionsReport'; @@ -281,6 +283,14 @@ const App = () => { path={`${REPORT_SMC_PLAN_URL}/:planId/:jurisdictionId/${MAP}`} component={ConnectedSMCReportingMap} /> + {/* MDA Lite Reporting plan table view */} + {/* IRS Reporting plan table view */} { ENABLE_IRS_PERFORMANCE_REPORT || ENABLE_IRS_MOPUP_REPORTING || ENABLE_IRS_LITE || - ENABLE_SMC; + ENABLE_SMC || + ENABLE_MDA_LITE; return (
@@ -288,6 +292,20 @@ export class HeaderComponent extends React.Component {
)} + + {ENABLE_MDA_LITE && ( +
+ + + {MDA_LITE_REPORTING_TITLE} + + +
+ )} {ENABLE_DYNAMIC_MDA && (
diff --git a/src/configs/env.ts b/src/configs/env.ts index eeaf65a1b0..bbf8f61994 100644 --- a/src/configs/env.ts +++ b/src/configs/env.ts @@ -71,6 +71,10 @@ export type ENABLE_DYNAMIC_MDA = typeof ENABLE_DYNAMIC_MDA; export const ENABLE_SMC = process.env.REACT_APP_ENABLE_SMC === 'true'; export type ENABLE_SMC = typeof ENABLE_SMC; +/** Do you want to enable the SMC Point plan features? */ +export const ENABLE_MDA_LITE = process.env.REACT_APP_ENABLE_MDA_LITE === 'true'; +export type ENABLE_MDA_LITE = typeof ENABLE_MDA_LITE; + /** Do you want to enable the MDA Point plan features? */ export const CLIENT_LABEL = process.env.REACT_APP_CLIENT_LABEL || 'client'; export type CLIENT_LABEL = typeof CLIENT_LABEL; @@ -212,6 +216,10 @@ export const SUPERSET_MDA_POINT_REPORTING_PLANS_SLICE = process.env.REACT_APP_SUPERSET_MDA_POINT_REPORTING_PLANS_SLICE || '0'; export type SUPERSET_MDA_POINT_REPORTING_PLANS_SLICE = typeof SUPERSET_MDA_POINT_REPORTING_PLANS_SLICE; +export const SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE = + process.env.REACT_APP_SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE || '0'; +export type SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE = typeof SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE; + export const SUPERSET_MDA_POINT_REPORTING_JURISDICTIONS_DATA_SLICES = process.env.REACT_APP_SUPERSET_MDA_POINT_REPORTING_JURISDICTIONS_DATA_SLICES || '0'; export type SUPERSET_MDA_POINT_REPORTING_JURISDICTIONS_DATA_SLICES = typeof SUPERSET_MDA_POINT_REPORTING_JURISDICTIONS_DATA_SLICES; diff --git a/src/configs/lang.ts b/src/configs/lang.ts index 0ca8a5b686..d8e8d8abbf 100644 --- a/src/configs/lang.ts +++ b/src/configs/lang.ts @@ -162,6 +162,7 @@ export const IRS_PLANS = translate('IRS_PLANS', 'IRS Plans'); export const IRS_LITE_PLANS = translate('IRS_LITE_PLANS', 'IRS Lite Plans'); export const MDA_PLANS = translate('MDA_PLANS', 'MDA Plans'); export const MDA_POINT_PLANS = translate('MDA_POINT_PLANS', 'MDA Point Plans'); +export const MDA_LITE_PLANS = translate('MDA_LITE_PLANS', 'MDA Lite Plans'); export const SMC_PLANS = translate('SMC_PLANS', 'SMC Plans'); export const COUNTRY = translate('COUNTRY', 'Country'); export const JURISDICTION_HIERARCHY_TEMPLATE = translate( @@ -575,6 +576,7 @@ export const MDA_POINT_REPORTING_TITLE = translate( 'MDA_POINT_REPORTING_TITLE', 'MDA Point Reporting' ); +export const MDA_LITE_REPORTING_TITLE = translate('MDA_LITE_REPORTING_TITLE', 'MDA Lite Reporting'); export const SMC_REPORTING_TITLE = translate('SMC_REPORTING_TITLE', 'SMC Reporting'); export const FILTER = translate('FILTER', 'Filter'); diff --git a/src/configs/strings/en.json b/src/configs/strings/en.json index 5300ab872d..8bbfd23c65 100644 --- a/src/configs/strings/en.json +++ b/src/configs/strings/en.json @@ -1244,6 +1244,10 @@ "message": "MDA Point Plans", "description": "Title of page that lists MDA point plans" }, + "MDA_LITE_PLANS": { + "message": "MDA Lite Plans", + "description": "Title of page that lists MDA Lite plans" + }, "JURISDICTION_HIERARCHY_TEMPLATE": { "message": "JurisdictionHierachyTemplate", "description": "Name given to a file downloaded as a template for risk upload" @@ -1358,6 +1362,10 @@ "message": "MDA Point Reporting", "description": "Title of page that lists MDA point plans for reporting" }, + "MDA_LITE_REPORTING_TITLE": { + "message": "MDA Lite Reporting", + "description": "Title of page that lists MDA Lite plans for reporting" + }, "FILTER": { "message": "Filter", "description": "Filter" }, "USER": { "message": "user", "description": "user" }, "MDA_POINT_LOCATION_REPORT_TITLE": { diff --git a/src/constants.tsx b/src/constants.tsx index 3f300fb003..2ca55e94bc 100644 --- a/src/constants.tsx +++ b/src/constants.tsx @@ -86,6 +86,7 @@ export const PERFORMANCE_REPORT_IRS_PLAN_URL = `/intervention/irs/performance/re export const REPORT_IRS_LITE_PLAN_URL = `/intervention/irs-lite/report`; export const PERFORMANCE_REPORT_IRS_LITE_PLAN_URL = `/intervention/irs-lite/performance/report`; export const REPORT_MDA_POINT_PLAN_URL = `/intervention/mda-point/report`; +export const REPORT_MDA_LITE_PLAN_URL = `/intervention/mda-lite/report`; export const REPORT_MDA_PLAN_URL = `/intervention/mda/report`; export const MDA_POINT_LOCATION_REPORT_URL = '/intervention/mda-point/location-report'; export const MDA_POINT_CHILD_REPORT_URL = '/intervention/mda-point/child-report'; diff --git a/src/containers/pages/InterventionPlan/NewPlan/General/index.tsx b/src/containers/pages/InterventionPlan/NewPlan/General/index.tsx index 23dd5abce5..5ad68baca4 100644 --- a/src/containers/pages/InterventionPlan/NewPlan/General/index.tsx +++ b/src/containers/pages/InterventionPlan/NewPlan/General/index.tsx @@ -84,6 +84,7 @@ const planFormPropsLookUp = { ...managePlansLocationFieldProps, }, [InterventionType.IRSLite]: {}, + [InterventionType.MDALite]: {}, }; /** Simple component that loads the new plan form and allows you to create a new plan */ diff --git a/src/containers/pages/MDALite/plans/index.tsx b/src/containers/pages/MDALite/plans/index.tsx new file mode 100644 index 0000000000..05d9cb6cc0 --- /dev/null +++ b/src/containers/pages/MDALite/plans/index.tsx @@ -0,0 +1,86 @@ +import reducerRegistry from '@onaio/redux-reducer-registry'; +import React from 'react'; +import { connect } from 'react-redux'; +import { RouteComponentProps } from 'react-router'; +import { Store } from 'redux'; +import { + HIDDEN_PLAN_STATUSES, + SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE, +} from '../../../../configs/env'; +import { MDA_LITE_PLANS } from '../../../../configs/lang'; +import { QUERY_PARAM_TITLE, REPORT_MDA_LITE_PLAN_URL } from '../../../../constants'; +import { getPlanStatusToDisplay, getQueryParams, RouteParams } from '../../../../helpers/utils'; +import supersetFetch from '../../../../services/superset'; +import GenericPlansReducer, { + genericFetchPlans, + GenericPlan, + makeGenericPlansArraySelector, + reducerName as genericReducerName, +} from '../../../../store/ducks/generic/plans'; +import { InterventionType } from '../../../../store/ducks/plans'; +import { GenericPlanListProps, GenericPlansList } from '../../GenericPlansList'; + +/** register the MDA plan definitions reducer */ +reducerRegistry.register(genericReducerName, GenericPlansReducer); + +/** a list of plan statuses to be displayed */ +const allowedPlanStatusList = getPlanStatusToDisplay(HIDDEN_PLAN_STATUSES); + +/** selector for MDA lite plans */ +const makeMDALitePlansArraySelector = makeGenericPlansArraySelector(); + +/** Simple component that loads a preview list of MDA plans */ +const MDALitePlansList = (props: GenericPlanListProps & RouteComponentProps) => { + return ( +
+ +
+ ); +}; + +/** Declare default props for MDALitePlansList */ +const defaultProps: GenericPlanListProps = { + fetchPlans: genericFetchPlans, + pageTitle: MDA_LITE_PLANS, + pageUrl: REPORT_MDA_LITE_PLAN_URL, + plans: [], + service: supersetFetch, + supersetReportingSlice: SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE, +}; + +MDALitePlansList.defaultProps = defaultProps; + +export { MDALitePlansList }; + +/** Connect the component to the store */ + +/** interface to describe props from mapStateToProps */ +interface DispatchedStateProps extends RouteComponentProps { + plans: GenericPlan[]; +} + +/** map state to props */ +const mapStateToProps = ( + state: Partial, + ownProps: RouteComponentProps +): DispatchedStateProps => { + const searchedTitle = getQueryParams(ownProps.location)[QUERY_PARAM_TITLE] as string; + const MDALitePlansArray = makeMDALitePlansArraySelector(state, { + interventionTypes: [InterventionType.MDALite], + plan_title: searchedTitle, + statusList: allowedPlanStatusList, + }); + + return { + ...ownProps, + plans: MDALitePlansArray, + }; +}; + +/** map dispatch to props */ +const mapDispatchToProps = { fetchPlans: genericFetchPlans }; + +/** Connected ActiveFI component */ +const ConnectedMDALitePlansList = connect(mapStateToProps, mapDispatchToProps)(MDALitePlansList); + +export default ConnectedMDALitePlansList; diff --git a/src/store/ducks/plans.ts b/src/store/ducks/plans.ts index 9e3eed5f6f..bd3143b214 100644 --- a/src/store/ducks/plans.ts +++ b/src/store/ducks/plans.ts @@ -19,6 +19,7 @@ export enum InterventionType { IRS = 'IRS', IRSLite = 'IRS-Lite', MDA = 'MDA', + MDALite = 'MDA-Lite', MDAPoint = 'MDA-Point', } /** interface for plan Objects */ From edb4a4ca0d8b35d0b4e09071a6c54981b05da48f Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Tue, 9 Mar 2021 11:25:05 +0300 Subject: [PATCH 02/40] Document and add envs to sample file --- .env.sample | 2 ++ docs/env.md | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.env.sample b/.env.sample index 0a23fc8e22..796bb790bc 100644 --- a/.env.sample +++ b/.env.sample @@ -14,6 +14,7 @@ REACT_APP_ENABLE_ASSIGN=true REACT_APP_ENABLE_ABOUT=true REACT_APP_ENABLE_TEAMS=true REACT_APP_ENABLE_MDA_POINT=true +REACT_APP_ENABLE_MDA_LITE=true REACT_APP_ENABLE_PRACTITIONERS=true REACT_APP_ENABLE_JURISDICTION_METADATA_UPLOAD=true REACT_APP_ENABLE_PLANNING=true @@ -52,6 +53,7 @@ REACT_APP_SUPERSET_DYNAMIC_MDA_REPORTING_JURISDICTIONS_FOCUS_AREA_LEVEL=3 REACT_APP_SUPERSET_STRUCTURES_SLICE=0 REACT_APP_SUPERSET_TASKS_SLICE=0 REACT_APP_SUPERSET_PLAN_STRUCTURE_PIVOT_SLICE=0 +REACT_APP_SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE=0 REACT_APP_GISIDA_TIMEOUT=3000 REACT_APP_GISIDA_MAPBOX_TOKEN=hunter2 REACT_APP_GISIDA_ONADATA_API_TOKEN=hunter2 diff --git a/docs/env.md b/docs/env.md index 2846c55a76..2317fd61ec 100644 --- a/docs/env.md +++ b/docs/env.md @@ -102,20 +102,25 @@ Below is a list of currently supported environment variables: - Options: FI, IRS, IRS_Lite, MDA, MDA-Point, Dynamic-FI, Dynamic-IRS and Dynamic-MDA - Variable is **not required** and if not provided interventions on `REACT_APP_DISPLAYED_PLAN_TYPES` are loaded. - - **REACT_APP_CHECK_SESSION_EXPIRY_STATUS** +- **REACT_APP_CHECK_SESSION_EXPIRY_STATUS** - **not Required**; _(string)_ - to activate set the env to `true`, any other value will be interpreted as false. - default value is false. - enables check for session expiry - - **REACT_APP_OPENSRP_GENERATED_TASKS_INTERVENTIONS** +- **REACT_APP_OPENSRP_GENERATED_TASKS_INTERVENTIONS** - Optional parameter of plan intervention types whose tasks should be generated on opensrp - Options: FI, IRS, IRS_Lite, MDA, MDA-Point, Dynamic-FI, Dynamic-IRS and Dynamic-MDA - - **REACT_APP_ENABLE_MDA_LITE** +- **REACT_APP_ENABLE_MDA_LITE** - **not Required**; _(string)_ - to activate set the env to `true`, any other value will be interpreted as false - enables the monitor MDA Lite reporting page + +- **REACT_APP_SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE** + + - MDA-Lite plans Superset slice id + - **Required** From 07b3be60d79a52263e960eb2fd257d5faaf2acb0 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Tue, 9 Mar 2021 13:35:00 +0300 Subject: [PATCH 03/40] Add MDA-Lite jurisdictions reporting view --- src/App/App.tsx | 15 +++ src/configs/env.ts | 26 +++- src/configs/settings.ts | 24 ++++ .../GenericJurisdictionReport/helpers.ts | 107 ++++++++++++++++ .../MDALite/jurisdictionsReport/index.tsx | 117 ++++++++++++++++++ 5 files changed, 285 insertions(+), 4 deletions(-) create mode 100644 src/containers/pages/MDALite/jurisdictionsReport/index.tsx diff --git a/src/App/App.tsx b/src/App/App.tsx index 0857c6fdc7..a733b67f3f 100644 --- a/src/App/App.tsx +++ b/src/App/App.tsx @@ -124,6 +124,7 @@ import ConnectedAutoSelectView from '../containers/pages/JurisdictionAssignment/ import { ConnectedEntryView } from '../containers/pages/JurisdictionAssignment/EntryView'; import ConnectedJurisdictionAssignmentView from '../containers/pages/JurisdictionAssignment/ManualSelectJurisdiction'; import JurisdictionMetadata from '../containers/pages/JurisdictionMetadata'; +import ConnectedMdaLiteJurisdictionReport from '../containers/pages/MDALite/jurisdictionsReport'; import ConnectedMDALitePlansList from '../containers/pages/MDALite/plans'; import ConnectedChildReports from '../containers/pages/MDAPoint/ChildReports'; import ConnectedClientListView from '../containers/pages/MDAPoint/ClientListView'; @@ -291,6 +292,20 @@ const App = () => { path={REPORT_MDA_LITE_PLAN_URL} component={ConnectedMDALitePlansList} /> + + {/* IRS Reporting plan table view */} +) => { + return ( +
+ +
+ ); +}; + +// change indicator rows component indicatorRows default prop +IRSIndicatorLegend.defaultProps.indicatorRows = 'MDALite'; +// Default props +const defaultProps: GenericJurisdictionProps = { + LegendIndicatorComp: IRSIndicatorLegend, + baseURL: REPORT_MDA_LITE_PLAN_URL, + cellComponent: MDAPointTableCell, + fetchJurisdictions: fetchGenericJurisdictions, + fetchPlans: genericFetchPlans, + focusAreaColumn: SUPERSET_MDA_LITE_REPORTING_FOCUS_AREAS_COLUMNS, + focusAreaLevel: SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_FOCUS_AREA_LEVEL, + hasChildren: hasChildrenFunc, + jurisdictionColumn: SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_COLUMNS, + jurisdictions: null, + pageTitle: MDA_LITE_REPORTING_TITLE, + plan: null, + reportingPlanSlice: SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE, + service: supersetFetch, + slices: SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES.split(','), +}; + +MdaLiteJurisdictionReport.defaultProps = defaultProps; + +export { MdaLiteJurisdictionReport }; + +/** Connect the component to the store */ + +/** interface to describe props from mapStateToProps */ +interface DispatchedStateProps extends RouteComponentProps { + jurisdictions: GenericJurisdiction[] | null; + plan: GenericPlan | null; +} + +/** map state to props */ +const mapStateToProps = ( + state: Partial, + ownProps: RouteComponentProps +): DispatchedStateProps => { + const planId = ownProps.match.params.planId || null; + const plan = planId ? getPlanByIdSelector(state, planId) : null; + + let jurisdictions: GenericJurisdiction[] = []; + defaultProps.slices.forEach( + (slice: string) => + (jurisdictions = jurisdictions.concat(getGenericJurisdictionsArray(state, slice, planId))) + ); + return { + ...ownProps, + jurisdictions, + plan, + }; +}; + +/** map dispatch to props */ +const mapDispatchToProps = { + fetchJurisdictions: fetchGenericJurisdictions, + fetchPlans: genericFetchPlans, +}; + +/** Connected ActiveFI component */ +const ConnectedMdaLiteJurisdictionReport = connect( + mapStateToProps, + mapDispatchToProps +)(MdaLiteJurisdictionReport); + +export default ConnectedMdaLiteJurisdictionReport; From 5a422917998d42f7e34cbac7b183b3954684d766 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Tue, 9 Mar 2021 16:26:14 +0300 Subject: [PATCH 04/40] Document and add MDA-Lite jurisdiction reporting envs to sample file --- .env.sample | 5 +++++ docs/env.md | 20 +++++++++++++++++++ src/configs/settings.ts | 2 +- .../MDALite/jurisdictionsReport/index.tsx | 2 +- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.env.sample b/.env.sample index 796bb790bc..7e3e585ecd 100644 --- a/.env.sample +++ b/.env.sample @@ -54,6 +54,11 @@ REACT_APP_SUPERSET_STRUCTURES_SLICE=0 REACT_APP_SUPERSET_TASKS_SLICE=0 REACT_APP_SUPERSET_PLAN_STRUCTURE_PIVOT_SLICE=0 REACT_APP_SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE=0 +REACT_APP_SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES=0 +REACT_APP_SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_COLUMNS=mdaLiteJurisdictionsColumns +REACT_APP_SUPERSET_MDA_LITE_REPORTING_FOCUS_AREAS_COLUMNS=mdaLiteJurisdictionsColumns +REACT_APP_SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_FOCUS_AREA_LEVEL=99 + REACT_APP_GISIDA_TIMEOUT=3000 REACT_APP_GISIDA_MAPBOX_TOKEN=hunter2 REACT_APP_GISIDA_ONADATA_API_TOKEN=hunter2 diff --git a/docs/env.md b/docs/env.md index 2317fd61ec..6aed70e150 100644 --- a/docs/env.md +++ b/docs/env.md @@ -124,3 +124,23 @@ Below is a list of currently supported environment variables: - MDA-Lite plans Superset slice id - **Required** + +- **REACT_APP_SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES** + + - MDA-Lite jurisdictions report Superset slice id + - **Required** + +- **REACT_APP_SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_COLUMNS** + + - MDA-Lite jurisdictions report table columns + - **Required** + +- **REACT_APP_SUPERSET_MDA_LITE_REPORTING_FOCUS_AREAS_COLUMNS** + + - MDA-Lite Focus area report table columns + - **Required** + +- **REACT_APP_SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_FOCUS_AREA_LEVEL** + + - MDA-Lite level were focus areas start + - **Required** diff --git a/src/configs/settings.ts b/src/configs/settings.ts index ba473b0ee4..f395d0ab62 100644 --- a/src/configs/settings.ts +++ b/src/configs/settings.ts @@ -1885,7 +1885,7 @@ export interface IndicatorThresholdsLookUp { * otherwise the default indicator thresholds will be used. */ export const indicatorThresholdsLookUpIRS: IndicatorThresholdsLookUp = { - MDALite: indicatorThresholdsMDALite, + MDALiteIndicators: indicatorThresholdsMDALite, namibia2019: indicatorThresholdsIRSNamibia, }; diff --git a/src/containers/pages/MDALite/jurisdictionsReport/index.tsx b/src/containers/pages/MDALite/jurisdictionsReport/index.tsx index 97dff55d68..04a219b87c 100644 --- a/src/containers/pages/MDALite/jurisdictionsReport/index.tsx +++ b/src/containers/pages/MDALite/jurisdictionsReport/index.tsx @@ -50,7 +50,7 @@ const MdaLiteJurisdictionReport = ( }; // change indicator rows component indicatorRows default prop -IRSIndicatorLegend.defaultProps.indicatorRows = 'MDALite'; +IRSIndicatorLegend.defaultProps.indicatorRows = 'MDALiteIndicators'; // Default props const defaultProps: GenericJurisdictionProps = { LegendIndicatorComp: IRSIndicatorLegend, From 63fb63dd37742aa307c43ecfc05dff5e3c11a128 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Tue, 9 Mar 2021 17:29:41 +0300 Subject: [PATCH 05/40] Group MDA-Lite columns --- .../GenericJurisdictionReport/helpers.ts | 44 +++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/src/containers/pages/GenericJurisdictionReport/helpers.ts b/src/containers/pages/GenericJurisdictionReport/helpers.ts index 2a0045d5b5..2af6bfe93e 100644 --- a/src/containers/pages/GenericJurisdictionReport/helpers.ts +++ b/src/containers/pages/GenericJurisdictionReport/helpers.ts @@ -404,12 +404,7 @@ export const smcJurisdictionsColumns = [ ]; /** columns for mda Lite jurisdictions */ -export const mdaLiteJurisdictionsColumns = [ - { - Header: 'Name', - accessor: 'jurisdiction_name', - minWidth: 180, - }, +export const genderReportColumns = [ { Header: 'Male', columns: [ @@ -462,52 +457,65 @@ export const mdaLiteJurisdictionsColumns = [ Header: 'Total Treated', accessor: '', }, +]; +export const drugDistributionColumns = [ { - Header: 'Census Pop Target (Official)', + Header: 'Supervisor Distributed', accessor: '', }, { - Header: 'Treatment Coverage (Census)', + Header: 'Received by CDD', accessor: '', }, { - Header: 'Other Pop Target (Unofficial)', + Header: 'Administered', accessor: '', }, { - Header: 'Other Pop Coverage (Unofficial)', + Header: 'Damaged', accessor: '', }, - // drug distribution { - Header: 'Supervisor Distributed', + Header: 'Remaining with CDD', accessor: '', }, { - Header: 'Received by CDD', + Header: 'Returned to Supervisor', accessor: '', }, { - Header: 'Administered', + Header: 'Adverse Reaction', accessor: '', }, +]; +export const censusPopColumns = [ { - Header: 'Damaged', + Header: 'Census Pop Target (Official)', accessor: '', }, { - Header: 'Remaining with CDD', + Header: 'Treatment Coverage (Census)', accessor: '', }, { - Header: 'Returned to Supervisor', + Header: 'Other Pop Target (Unofficial)', accessor: '', }, { - Header: 'Adverse Reaction', + Header: 'Other Pop Coverage (Unofficial)', accessor: '', }, ]; +export const mdaLiteJurisdictionsColumns = [ + { + Header: 'Name', + accessor: 'jurisdiction_name', + minWidth: 180, + }, + ...genderReportColumns, + ...censusPopColumns, + ...drugDistributionColumns, +]; /** IRS Table Columns * These are all the table columns for IRS that we know about. From e7ac9084b4a21319ee44f7f9c057f7b9ebe0032d Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Thu, 11 Mar 2021 14:34:34 +0300 Subject: [PATCH 06/40] Add MDA-Lite jurisdiction reporting column accessors --- .../GenericJurisdictionReport/helpers.ts | 52 ++++++++++++------- src/helpers/indicators.tsx | 32 ++++++++++++ 2 files changed, 64 insertions(+), 20 deletions(-) diff --git a/src/containers/pages/GenericJurisdictionReport/helpers.ts b/src/containers/pages/GenericJurisdictionReport/helpers.ts index 2af6bfe93e..2bb9829942 100644 --- a/src/containers/pages/GenericJurisdictionReport/helpers.ts +++ b/src/containers/pages/GenericJurisdictionReport/helpers.ts @@ -2,9 +2,11 @@ import { DrillDownColumn, DrillDownTableProps } from '@onaio/drill-down-table'; import { Dictionary } from '@onaio/utils'; import { get } from 'lodash'; import { Cell } from 'react-table'; +import { indicatorThresholdsMDALite } from '../../../configs/settings'; import { getIRSLiteThresholdAdherenceIndicator, getIRSThresholdAdherenceIndicator, + MDALiteGenderComparison, renderPercentage, } from '../../../helpers/indicators'; import { GenericJurisdiction } from '../../../store/ducks/generic/jurisdictions'; @@ -410,18 +412,21 @@ export const genderReportColumns = [ columns: [ { Header: '1-4', - accessor: '', + accessor: 'treated_male_1_4', id: 'maleOneToFour', + width: '100', }, { Header: '5-14', - accessor: '', + accessor: 'treated_male_5_14', id: 'maleOneToFourteen', + width: '100', }, { Header: '15+', - accessor: '', + accessor: 'treated_male_above_15', id: 'maleGreaterThanFifteen', + width: '100', }, ], }, @@ -430,80 +435,87 @@ export const genderReportColumns = [ columns: [ { Header: '1-4', - accessor: '', + accessor: 'treated_female_1_4', id: 'femaleOneToFour', + width: '100', }, { Header: '5-14', - accessor: '', + accessor: 'treated_female_5_14', id: 'femaleOneToFourteen', + width: '100', }, { Header: '15+', - accessor: '', + accessor: 'treated_female_above_15', id: 'femaleGreaterThanFifteen', + width: '100', }, ], }, { + Cell: (cell: Cell) => MDALiteGenderComparison(cell, 'total_females', 'red'), Header: 'Total Male', - accessor: '', + accessor: 'total_males', }, { + Cell: (cell: Cell) => MDALiteGenderComparison(cell, 'total_males', 'red'), Header: 'Total female', - accessor: '', + accessor: 'total_females', }, { Header: 'Total Treated', - accessor: '', + accessor: 'total_all_genders', }, ]; export const drugDistributionColumns = [ { Header: 'Supervisor Distributed', - accessor: '', + accessor: 'supervisor_distributed', }, { Header: 'Received by CDD', - accessor: '', + accessor: 'received_number', }, { Header: 'Administered', - accessor: '', + accessor: 'adminstered', }, { Header: 'Damaged', - accessor: '', + accessor: 'damaged', }, { Header: 'Remaining with CDD', - accessor: '', + accessor: 'remaining_with_cdd', }, { Header: 'Returned to Supervisor', - accessor: '', + accessor: 'returned_to_supervisor', }, { Header: 'Adverse Reaction', - accessor: '', + accessor: 'adverse', }, ]; export const censusPopColumns = [ { Header: 'Census Pop Target (Official)', - accessor: '', + accessor: 'census_pop_target', }, { + Cell: (cell: Cell) => getIRSThresholdAdherenceIndicator(cell, indicatorThresholdsMDALite), Header: 'Treatment Coverage (Census)', - accessor: '', + accessor: 'treatment_coverage', }, { Header: 'Other Pop Target (Unofficial)', - accessor: '', + accessor: 'other_pop_target', }, { + Cell: (cell: Cell) => getIRSThresholdAdherenceIndicator(cell, indicatorThresholdsMDALite), Header: 'Other Pop Coverage (Unofficial)', - accessor: '', + accessor: 'other_pop_coverage', }, ]; export const mdaLiteJurisdictionsColumns = [ diff --git a/src/helpers/indicators.tsx b/src/helpers/indicators.tsx index a04ead3b93..49bbbfcfbb 100644 --- a/src/helpers/indicators.tsx +++ b/src/helpers/indicators.tsx @@ -223,3 +223,35 @@ export function DefaultTableCell(props: DropDownCellProps) { {cellValue} ); } + +/** + * check if value can be converted to number + * @param {string | number} value - value to check if can be used as number + */ +const canBeNumber = (value: string | number) => !Number.isNaN(Number(value)); + +/** + * MDA-Lite compare gender values and change cell color + * @param {Cell} cell - the ReactTable.Cell being rendered in an indicator drilldown table + * @param otherAccessor - accessor name to compare with current value with + * @param color - color to turn cell to + */ +export const MDALiteGenderComparison = (cell: Cell, otherAccessor: string, color: string) => { + const { + row: { id }, + value, + } = cell; + let valueToCompare = (cell as any).data[id][otherAccessor]; + const cellValue = canBeNumber(value) ? Number(value) : 0; + valueToCompare = canBeNumber(valueToCompare) ? Number(valueToCompare) : 0; + const diffPer = cellValue > 0 ? (valueToCompare - cellValue) / valueToCompare : 1; + const changeColor = valueToCompare === 0 && cellValue === 0 ? false : diffPer > 0.8; + return ( +
+ {value} +
+ ); +}; From 512771ce22898e629272a5febdbde13285bc72ca Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Thu, 11 Mar 2021 16:48:56 +0300 Subject: [PATCH 07/40] Add Component for formating the drill down links --- .env.sample | 2 + docs/env.md | 6 +++ src/components/MDALiteCellTable/index.tsx | 43 +++++++++++++++++++ src/configs/env.ts | 4 ++ .../MDALite/jurisdictionsReport/index.tsx | 4 +- src/helpers/indicators.tsx | 6 +-- 6 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 src/components/MDALiteCellTable/index.tsx diff --git a/.env.sample b/.env.sample index f213df043f..84d6ccf8c0 100644 --- a/.env.sample +++ b/.env.sample @@ -184,3 +184,5 @@ REACT_APP_CHECK_SESSION_EXPIRY_STATUS=true REACT_APP_ASSIGNED_TEAMS_REQUEST_PAGE_SIZE=1000 REACT_APP_OPENSRP_GENERATED_TASKS_INTERVENTIONS=Dynamic-FI,FI + +REACT_APP_SHOW_MAP_AT_JURISDICTION_LEVEL=99 diff --git a/docs/env.md b/docs/env.md index 375c9a5f18..911bb6519f 100644 --- a/docs/env.md +++ b/docs/env.md @@ -144,3 +144,9 @@ Below is a list of currently supported environment variables: - MDA-Lite level were focus areas start - **Required** + +- **REACT_APP_SHOW_MAP_AT_JURISDICTION_LEVEL** + + - Jurisdiction level on which to show map + - Default vaule: 99 + - **Not Required** diff --git a/src/components/MDALiteCellTable/index.tsx b/src/components/MDALiteCellTable/index.tsx new file mode 100644 index 0000000000..11575b14cc --- /dev/null +++ b/src/components/MDALiteCellTable/index.tsx @@ -0,0 +1,43 @@ +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { DropDownCellProps } from '@onaio/drill-down-table'; +import { Dictionary } from '@onaio/utils'; +import React from 'react'; +import { Link } from 'react-router-dom'; +import { SHOW_MAP_AT_JURISDICTION_LEVEL } from '../../configs/env'; +import { MAP } from '../../constants'; + +/** Interface for linked cell props */ +export interface LinkedCellProps extends DropDownCellProps { + urlPath?: string; +} + +/** Component that will be rendered in drop-down table cells showing a link + * that moves you to the next hierarchical level. + */ +const MDALiteTableCell: React.ElementType = (props: LinkedCellProps) => { + const { cell, cellValue, hasChildren, urlPath } = props; + const original: Dictionary = cell.row.original; + const { jurisdiction_id, plan_id, jurisdiction_depth } = original; + const url = `${urlPath}/${plan_id}/${jurisdiction_id}`; + const jurLink = {cellValue}; + if (SHOW_MAP_AT_JURISDICTION_LEVEL === +jurisdiction_depth) { + return ( +
+ {jurLink} + + + + + +
+ ); + } + const val = hasChildren ? ( + jurLink + ) : ( + {cellValue} + ); + return
{val}
; +}; + +export default MDALiteTableCell; diff --git a/src/configs/env.ts b/src/configs/env.ts index e515a15c5a..fd6961065a 100644 --- a/src/configs/env.ts +++ b/src/configs/env.ts @@ -613,3 +613,7 @@ export type SUPERSET_MDA_LITE_REPORTING_FOCUS_AREAS_COLUMNS = typeof SUPERSET_MD export const SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_FOCUS_AREA_LEVEL = process.env.REACT_APP_SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_FOCUS_AREA_LEVEL || '99'; export type SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_FOCUS_AREA_LEVEL = typeof SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_FOCUS_AREA_LEVEL; + +export const SHOW_MAP_AT_JURISDICTION_LEVEL = + Number(process.env.REACT_APP_SHOW_MAP_AT_JURISDICTION_LEVEL) || 99; +export type SHOW_MAP_AT_JURISDICTION_LEVEL = typeof SHOW_MAP_AT_JURISDICTION_LEVEL; diff --git a/src/containers/pages/MDALite/jurisdictionsReport/index.tsx b/src/containers/pages/MDALite/jurisdictionsReport/index.tsx index 04a219b87c..93116aed5e 100644 --- a/src/containers/pages/MDALite/jurisdictionsReport/index.tsx +++ b/src/containers/pages/MDALite/jurisdictionsReport/index.tsx @@ -5,7 +5,7 @@ import { connect } from 'react-redux'; import { RouteComponentProps } from 'react-router'; import { Store } from 'redux'; import IRSIndicatorLegend from '../../../../components/formatting/IRSIndicatorLegend'; -import MDAPointTableCell from '../../../../components/MDAPointCellTable'; +import MDALiteTableCell from '../../../../components/MDALiteCellTable'; import { SUPERSET_MDA_LITE_REPORTING_FOCUS_AREAS_COLUMNS, SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_COLUMNS, @@ -55,7 +55,7 @@ IRSIndicatorLegend.defaultProps.indicatorRows = 'MDALiteIndicators'; const defaultProps: GenericJurisdictionProps = { LegendIndicatorComp: IRSIndicatorLegend, baseURL: REPORT_MDA_LITE_PLAN_URL, - cellComponent: MDAPointTableCell, + cellComponent: MDALiteTableCell, fetchJurisdictions: fetchGenericJurisdictions, fetchPlans: genericFetchPlans, focusAreaColumn: SUPERSET_MDA_LITE_REPORTING_FOCUS_AREAS_COLUMNS, diff --git a/src/helpers/indicators.tsx b/src/helpers/indicators.tsx index 49bbbfcfbb..43eec4fe04 100644 --- a/src/helpers/indicators.tsx +++ b/src/helpers/indicators.tsx @@ -238,12 +238,12 @@ const canBeNumber = (value: string | number) => !Number.isNaN(Number(value)); */ export const MDALiteGenderComparison = (cell: Cell, otherAccessor: string, color: string) => { const { - row: { id }, + row: { original }, value, } = cell; - let valueToCompare = (cell as any).data[id][otherAccessor]; + const otherAccessorVal = (original as Dictionary)[otherAccessor]; const cellValue = canBeNumber(value) ? Number(value) : 0; - valueToCompare = canBeNumber(valueToCompare) ? Number(valueToCompare) : 0; + const valueToCompare = canBeNumber(otherAccessorVal) ? Number(otherAccessorVal) : 0; const diffPer = cellValue > 0 ? (valueToCompare - cellValue) / valueToCompare : 1; const changeColor = valueToCompare === 0 && cellValue === 0 ? false : diffPer > 0.8; return ( From 0be6c2f8adcab4fe76b1db365eaecbe1c2f33dd0 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Thu, 11 Mar 2021 18:53:23 +0300 Subject: [PATCH 08/40] MDA-Lite add ward level columns --- .env.sample | 2 +- docs/env.md | 2 +- src/configs/env.ts | 7 +++---- .../pages/GenericJurisdictionReport/helpers.ts | 11 +++++++++++ .../pages/MDALite/jurisdictionsReport/index.tsx | 4 ++-- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.env.sample b/.env.sample index 84d6ccf8c0..d4c33fcad9 100644 --- a/.env.sample +++ b/.env.sample @@ -56,7 +56,7 @@ REACT_APP_SUPERSET_PLAN_STRUCTURE_PIVOT_SLICE=0 REACT_APP_SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE=0 REACT_APP_SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES=0 REACT_APP_SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_COLUMNS=mdaLiteJurisdictionsColumns -REACT_APP_SUPERSET_MDA_LITE_REPORTING_FOCUS_AREAS_COLUMNS=mdaLiteJurisdictionsColumns +REACT_APP_SUPERSET_MDA_LITE_REPORTING_WARD_COLUMNS=mdaLitewardColumns REACT_APP_SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_FOCUS_AREA_LEVEL=99 REACT_APP_GISIDA_TIMEOUT=3000 diff --git a/docs/env.md b/docs/env.md index 911bb6519f..8577c2e5a4 100644 --- a/docs/env.md +++ b/docs/env.md @@ -135,7 +135,7 @@ Below is a list of currently supported environment variables: - MDA-Lite jurisdictions report table columns - **Required** -- **REACT_APP_SUPERSET_MDA_LITE_REPORTING_FOCUS_AREAS_COLUMNS** +- **REACT_APP_SUPERSET_MDA_LITE_REPORTING_WARD_COLUMNS** - MDA-Lite Focus area report table columns - **Required** diff --git a/src/configs/env.ts b/src/configs/env.ts index fd6961065a..1744ab2db2 100644 --- a/src/configs/env.ts +++ b/src/configs/env.ts @@ -605,10 +605,9 @@ export const SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_COLUMNS = 'mdaLiteJurisdictionsColumns'; export type SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_COLUMNS = typeof SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_COLUMNS; -export const SUPERSET_MDA_LITE_REPORTING_FOCUS_AREAS_COLUMNS = - process.env.REACT_APP_SUPERSET_MDA_LITE_REPORTING_FOCUS_AREAS_COLUMNS || - 'mdaLiteJurisdictionsColumns'; -export type SUPERSET_MDA_LITE_REPORTING_FOCUS_AREAS_COLUMNS = typeof SUPERSET_MDA_LITE_REPORTING_FOCUS_AREAS_COLUMNS; +export const SUPERSET_MDA_LITE_REPORTING_WARD_COLUMNS = + process.env.REACT_APP_SUPERSET_MDA_LITE_REPORTING_WARD_COLUMNS || 'mdaLitewardColumns'; +export type SUPERSET_MDA_LITE_REPORTING_WARD_COLUMNS = typeof SUPERSET_MDA_LITE_REPORTING_WARD_COLUMNS; export const SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_FOCUS_AREA_LEVEL = process.env.REACT_APP_SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_FOCUS_AREA_LEVEL || '99'; diff --git a/src/containers/pages/GenericJurisdictionReport/helpers.ts b/src/containers/pages/GenericJurisdictionReport/helpers.ts index 2bb9829942..f983393360 100644 --- a/src/containers/pages/GenericJurisdictionReport/helpers.ts +++ b/src/containers/pages/GenericJurisdictionReport/helpers.ts @@ -529,6 +529,16 @@ export const mdaLiteJurisdictionsColumns = [ ...drugDistributionColumns, ]; +export const mdaLitewardColumns = [ + { + Header: 'Name', + accessor: 'jurisdiction_name', + minWidth: 180, + }, + ...genderReportColumns, + ...censusPopColumns, +]; + /** IRS Table Columns * These are all the table columns for IRS that we know about. */ @@ -537,6 +547,7 @@ export const plansTableColumns: { [key: string]: Array Date: Thu, 11 Mar 2021 19:14:03 +0300 Subject: [PATCH 09/40] Change color of returned to supervisor if less than remaining with CDD --- .../GenericJurisdictionReport/helpers.ts | 7 ++++-- src/helpers/indicators.tsx | 25 +++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/containers/pages/GenericJurisdictionReport/helpers.ts b/src/containers/pages/GenericJurisdictionReport/helpers.ts index f983393360..8fabb0cfd4 100644 --- a/src/containers/pages/GenericJurisdictionReport/helpers.ts +++ b/src/containers/pages/GenericJurisdictionReport/helpers.ts @@ -2,12 +2,14 @@ import { DrillDownColumn, DrillDownTableProps } from '@onaio/drill-down-table'; import { Dictionary } from '@onaio/utils'; import { get } from 'lodash'; import { Cell } from 'react-table'; +import { IRS_RED_THRESHOLD } from '../../../configs/lang'; import { indicatorThresholdsMDALite } from '../../../configs/settings'; import { getIRSLiteThresholdAdherenceIndicator, getIRSThresholdAdherenceIndicator, MDALiteGenderComparison, renderPercentage, + returnedToSupervicerCol, } from '../../../helpers/indicators'; import { GenericJurisdiction } from '../../../store/ducks/generic/jurisdictions'; @@ -454,12 +456,12 @@ export const genderReportColumns = [ ], }, { - Cell: (cell: Cell) => MDALiteGenderComparison(cell, 'total_females', 'red'), + Cell: (cell: Cell) => MDALiteGenderComparison(cell, 'total_females', IRS_RED_THRESHOLD), Header: 'Total Male', accessor: 'total_males', }, { - Cell: (cell: Cell) => MDALiteGenderComparison(cell, 'total_males', 'red'), + Cell: (cell: Cell) => MDALiteGenderComparison(cell, 'total_males', IRS_RED_THRESHOLD), Header: 'Total female', accessor: 'total_females', }, @@ -490,6 +492,7 @@ export const drugDistributionColumns = [ accessor: 'remaining_with_cdd', }, { + Cell: (cell: Cell) => returnedToSupervicerCol(cell, 'remaining_with_cdd', IRS_RED_THRESHOLD), Header: 'Returned to Supervisor', accessor: 'returned_to_supervisor', }, diff --git a/src/helpers/indicators.tsx b/src/helpers/indicators.tsx index 43eec4fe04..8b9f97ad91 100644 --- a/src/helpers/indicators.tsx +++ b/src/helpers/indicators.tsx @@ -255,3 +255,28 @@ export const MDALiteGenderComparison = (cell: Cell, otherAccessor: string, color
); }; + +/** + * MDA-Lite compare returned to supervisor values and change cell color + * @param {Cell} cell - the ReactTable.Cell being rendered in an indicator drilldown table + * @param otherAccessor - accessor name to compare with current value with + * @param color - color to turn cell to + */ +export const returnedToSupervicerCol = (cell: Cell, otherAccessor: string, color: string) => { + const { + row: { original }, + value, + } = cell; + const otherAccessorVal = (original as Dictionary)[otherAccessor]; + const cellValue = canBeNumber(value) ? Number(value) : 0; + const valueToCompare = canBeNumber(otherAccessorVal) ? Number(otherAccessorVal) : 0; + const changeColor = cellValue < valueToCompare; + return ( +
+ {value} +
+ ); +}; From 0735233329f159cec1a77f4f419de40a31941cad Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Fri, 12 Mar 2021 12:36:19 +0300 Subject: [PATCH 10/40] Add MDA-Lite CDD and Supervisor report columns --- .../pages/MDALite/cddReports/helpers.tsx | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/containers/pages/MDALite/cddReports/helpers.tsx diff --git a/src/containers/pages/MDALite/cddReports/helpers.tsx b/src/containers/pages/MDALite/cddReports/helpers.tsx new file mode 100644 index 0000000000..2b11af3a85 --- /dev/null +++ b/src/containers/pages/MDALite/cddReports/helpers.tsx @@ -0,0 +1,35 @@ +import { Cell } from 'react-table'; +import { indicatorThresholdsMDALite } from '../../../../configs/settings'; +import { getIRSThresholdAdherenceIndicator } from '../../../../helpers/indicators'; +import { + drugDistributionColumns, + genderReportColumns, +} from '../../GenericJurisdictionReport/helpers'; + +/** supervisor columns */ +export const supervisorColumns = [ + { + Header: 'Name', + accessor: 'supervisor_name', + }, + ...drugDistributionColumns, +]; + +/** CDD columns */ +export const cddReportColumns = [ + { + Header: 'Name', + accessor: 'cdd_name', + }, + ...genderReportColumns, + { + Header: 'Name', + accessor: 'days_worked', + }, + { + Cell: (cell: Cell) => getIRSThresholdAdherenceIndicator(cell, indicatorThresholdsMDALite), + Header: 'Name', + accessor: 'avarage_per_day', + }, + ...drugDistributionColumns, +]; From 336d82e910a91362d2c1e55584aa6a7213d4e723 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Fri, 12 Mar 2021 14:32:39 +0300 Subject: [PATCH 11/40] MDA-Lite add CDD reporting page --- .env.sample | 2 + docs/env.md | 10 ++ src/configs/env.ts | 8 + src/constants.tsx | 1 + .../pages/MDALite/cddReports/cdds.tsx | 150 ++++++++++++++++++ src/helpers/utils.tsx | 1 + 6 files changed, 172 insertions(+) create mode 100644 src/containers/pages/MDALite/cddReports/cdds.tsx diff --git a/.env.sample b/.env.sample index d4c33fcad9..df2c061038 100644 --- a/.env.sample +++ b/.env.sample @@ -186,3 +186,5 @@ REACT_APP_ASSIGNED_TEAMS_REQUEST_PAGE_SIZE=1000 REACT_APP_OPENSRP_GENERATED_TASKS_INTERVENTIONS=Dynamic-FI,FI REACT_APP_SHOW_MAP_AT_JURISDICTION_LEVEL=99 +REACT_APP_SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE=0 +REACT_APP_SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE=0 diff --git a/docs/env.md b/docs/env.md index 8577c2e5a4..eaa44e61f5 100644 --- a/docs/env.md +++ b/docs/env.md @@ -150,3 +150,13 @@ Below is a list of currently supported environment variables: - Jurisdiction level on which to show map - Default vaule: 99 - **Not Required** + +- **REACT_APP_SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE** + + - MDA-Lite CDD Superset slice id + - **Required** + +- **REACT_APP_SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE** + + - MDA-Lite supervisors Superset slice id + - **Required** diff --git a/src/configs/env.ts b/src/configs/env.ts index 1744ab2db2..5e6237e835 100644 --- a/src/configs/env.ts +++ b/src/configs/env.ts @@ -616,3 +616,11 @@ export type SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_FOCUS_AREA_LEVEL = typeof export const SHOW_MAP_AT_JURISDICTION_LEVEL = Number(process.env.REACT_APP_SHOW_MAP_AT_JURISDICTION_LEVEL) || 99; export type SHOW_MAP_AT_JURISDICTION_LEVEL = typeof SHOW_MAP_AT_JURISDICTION_LEVEL; + +export const SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE = + process.env.REACT_APP_SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE || '0'; +export type SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE = typeof SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE; + +export const SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE = + process.env.REACT_APP_SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE || '0'; +export type SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE = typeof SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE; diff --git a/src/constants.tsx b/src/constants.tsx index d93890482f..7a52f6e106 100644 --- a/src/constants.tsx +++ b/src/constants.tsx @@ -87,6 +87,7 @@ export const REPORT_IRS_LITE_PLAN_URL = `/intervention/irs-lite/report`; export const PERFORMANCE_REPORT_IRS_LITE_PLAN_URL = `/intervention/irs-lite/performance/report`; export const REPORT_MDA_POINT_PLAN_URL = `/intervention/mda-point/report`; export const REPORT_MDA_LITE_PLAN_URL = `/intervention/mda-lite/report`; +export const REPORT_MDA_LITE_CDD_REPORT_URL = `/intervention/mda-lite/cdd/report`; export const REPORT_MDA_PLAN_URL = `/intervention/mda/report`; export const MDA_POINT_LOCATION_REPORT_URL = '/intervention/mda-point/location-report'; export const MDA_POINT_CHILD_REPORT_URL = '/intervention/mda-point/child-report'; diff --git a/src/containers/pages/MDALite/cddReports/cdds.tsx b/src/containers/pages/MDALite/cddReports/cdds.tsx new file mode 100644 index 0000000000..e83e44a0d3 --- /dev/null +++ b/src/containers/pages/MDALite/cddReports/cdds.tsx @@ -0,0 +1,150 @@ +import { DrillDownTable } from '@onaio/drill-down-table/dist/types'; +import React, { useEffect, useState } from 'react'; +import Helmet from 'react-helmet'; +import { RouteComponentProps } from 'react-router-dom'; +import { Col, Row } from 'reactstrap'; +import IRSIndicatorLegend from '../../../../components/formatting/IRSIndicatorLegend'; +import HeaderBreadcrumb from '../../../../components/page/HeaderBreadcrumb/HeaderBreadcrumb'; +import Loading from '../../../../components/page/Loading'; +import { + defaultOptions, + renderInFilterFactory, +} from '../../../../components/Table/DrillDownFilters/utils'; +import { NoDataComponent } from '../../../../components/Table/NoDataComponent'; +import { + SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE, + SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES, + SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE, +} from '../../../../configs/env'; +import { HOME, MDA_LITE_REPORTING_TITLE } from '../../../../configs/lang'; +import { + HOME_URL, + QUERY_PARAM_TITLE, + REPORT_MDA_LITE_CDD_REPORT_URL, + REPORT_MDA_LITE_PLAN_URL, +} from '../../../../constants'; +import { displayError } from '../../../../helpers/errors'; +import { RouteParams } from '../../../../helpers/utils'; +import supersetFetch from '../../../../services/superset'; +import { GenericJurisdiction } from '../../../../store/ducks/generic/jurisdictions'; +import { cddReportColumns } from './helpers'; + +interface MDALiteCddReportsProps { + cddData: any[]; + service: typeof supersetFetch; + supervisorData: any[]; + wardData: GenericJurisdiction[]; +} + +const MDALiteCddReportsProps = ( + props: MDALiteCddReportsProps & RouteComponentProps +) => { + const { cddData, supervisorData, wardData, service } = props; + + const [loading, setLoading] = useState(false); + + const { params } = props.match; + const { planId, jurisdictionId, supervisorId } = params; + const supervisorName = supervisorData[0].name || cddData[0].supervisor_name; + + async function loadData() { + setLoading(cddData.length < 1); + try { + if (planId && jurisdictionId && !supervisorData.length) { + await service(SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE); + } + if (planId && jurisdictionId && wardData.length) { + const slices = SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES.split(','); + await service(slices[0]); + } + if (planId && jurisdictionId && supervisorId) { + await service(SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE); + } + } catch (e) { + displayError(e); + } finally { + setLoading(false); + } + } + + useEffect(() => { + loadData().catch(err => displayError(err)); + }, [planId, jurisdictionId, supervisorId]); + + const currentPage = { + label: supervisorName, + url: `${REPORT_MDA_LITE_CDD_REPORT_URL}/${planId}/${jurisdictionId}/${supervisorId}`, + }; + const breadcrumbProps = { + currentPage, + pages: [ + { + label: HOME, + url: HOME_URL, + }, + { + label: wardData[0].jurisdiction_name, + url: `${REPORT_MDA_LITE_PLAN_URL}/${planId}/${wardData[0].jurisdiction_parent_id}`, + }, + ], + }; + const currentTitle = supervisorName + ? `${MDA_LITE_REPORTING_TITLE}: ${supervisorName}` + : MDA_LITE_REPORTING_TITLE; + + // table props + const tableProps = { + columns: cddReportColumns, + data: cddData || [], + identifierField: 'id', + paginate: false, + renderInBottomFilterBar: renderInFilterFactory({ + showColumnHider: false, + showFilters: false, + showPagination: true, + showRowHeightPicker: false, + showSearch: false, + }), + renderInTopFilterBar: renderInFilterFactory({ + ...defaultOptions, + componentProps: props, + queryParam: QUERY_PARAM_TITLE, + }), + renderNullDataComponent: () => , + resize: true, + useDrillDown: false, + }; + + if (loading) { + return ; + } + return ( +
+ + currentTitle + + + + +

{currentTitle}

+
+ +
+ + +
+
+ ); +}; + +/** default props */ +const defaultProps: MDALiteCddReportsProps = { + cddData: [], + service: supersetFetch, + supervisorData: [], + wardData: [], +}; + +MDALiteCddReportsProps.defaultProps = defaultProps; + +export { MDALiteCddReportsProps as MDALiteCddReports }; diff --git a/src/helpers/utils.tsx b/src/helpers/utils.tsx index 182b3f3d6a..ad36d91eb8 100644 --- a/src/helpers/utils.tsx +++ b/src/helpers/utils.tsx @@ -100,6 +100,7 @@ export interface RouteParams { jurisdictionId?: string; planId?: string; sop?: string; + supervisorId?: string; type?: string; } From f7524b6310908956c8a7edc21128efaac5520878 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Fri, 12 Mar 2021 15:05:23 +0300 Subject: [PATCH 12/40] MDA-Lite CDD reports get drillDownTable props from a function and add supervisor reporting page --- .../pages/GenericJurisdictionReport/index.tsx | 2 + .../testData/jurs.json | 478 ++++++++++++++++++ .../pages/MDALite/cddReports/cdds.tsx | 40 +- .../pages/MDALite/cddReports/helpers.tsx | 36 ++ .../pages/MDALite/cddReports/supervisors.tsx | 115 +++++ 5 files changed, 637 insertions(+), 34 deletions(-) create mode 100644 src/containers/pages/GenericJurisdictionReport/testData/jurs.json create mode 100644 src/containers/pages/MDALite/cddReports/supervisors.tsx diff --git a/src/containers/pages/GenericJurisdictionReport/index.tsx b/src/containers/pages/GenericJurisdictionReport/index.tsx index dfdf33ecb0..b9e610b318 100644 --- a/src/containers/pages/GenericJurisdictionReport/index.tsx +++ b/src/containers/pages/GenericJurisdictionReport/index.tsx @@ -27,6 +27,7 @@ import { fetchSMCPlans, SMCPLANType } from '../../../store/ducks/generic/SMCPlan import { getJurisdictionBreadcrumbs } from '../IRS/Map/helpers'; import { GetColumnsToUse, getColumnsToUse, TableProps } from './helpers'; import './style.css'; +import jursData from './testData/jurs.json'; /** register the reducers */ reducerRegistry.register(GenericJurisdictionsReducerName, GenericJurisdictionsReducer); @@ -106,6 +107,7 @@ const GenericJurisdictionReport = ( /** async function to load the data */ async function loadData() { + fetchJurisdictions('0', jursData as any); try { setLoading(!plan || !jurisdictions || jurisdictions.length < 1); // set loading when there is no data let fetchPlansParams: SupersetFormData | null = null; diff --git a/src/containers/pages/GenericJurisdictionReport/testData/jurs.json b/src/containers/pages/GenericJurisdictionReport/testData/jurs.json new file mode 100644 index 0000000000..d9fac70bf7 --- /dev/null +++ b/src/containers/pages/GenericJurisdictionReport/testData/jurs.json @@ -0,0 +1,478 @@ +[ + { + "id": "165b0ae7-92fa-5b70-a7bb-283797f565c2", + "plan_id": "5e396185-6094-4817-9dd4-24bcbbc698b0", + "jurisdiction_id": "02ddb27d-6b48-4940-8367-bb72e607ed9f", + "jurisdiction_parent_id": "", + "jurisdiction_name": "luanda", + "jurisdiction_depth": 2, + "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", + "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", + "treated_male_1_4": "6,472,047", + "treated_male_5_14": 0, + "treated_male_above_15": 0, + "treated_female_1_4": 0, + "treated_female_5_14": 0, + "treated_female_above_15": 0, + "total_males": 20, + "total_females": 3, + "total_all_genders": 20, + "supervisor_distributed": 0, + "received_number": 0, + "adminstered": 0, + "damaged": 0, + "adverse": 0, + "remaining_with_cdd": 10, + "returned_to_supervisor": 3, + "census_pop_target": 200, + "treatment_coverage": 0.8, + "other_pop_target": 500, + "other_pop_coverage": 0.65 + }, + { + "id": "89bb4010-38ee-5eac-b92a-4deafa62765a", + "plan_id": "5e396185-6094-4817-9dd4-24bcbbc698b0", + "jurisdiction_id": "17de7da3-217f-4e5d-b016-4be97dd49e77", + "jurisdiction_parent_id": "", + "jurisdiction_name": "emuhaya", + "jurisdiction_depth": 2, + "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", + "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", + "treated_male_1_4": 0, + "treated_male_5_14": 0, + "treated_male_above_15": 0, + "treated_female_1_4": 0, + "treated_female_5_14": 0, + "treated_female_above_15": 0, + "total_males": 19, + "total_females": 100, + "total_all_genders": 0, + "supervisor_distributed": 0, + "received_number": 0, + "adminstered": 0, + "damaged": 0, + "adverse": 0, + "remaining_with_cdd": 0, + "returned_to_supervisor": 0, + "census_pop_target": 300, + "treatment_coverage": 0.9, + "other_pop_target": 400, + "other_pop_coverage": 0.6 + }, + { + "id": "541e7ed0-2dc6-586e-b563-4c988c5ac585", + "plan_id": "5e396185-6094-4817-9dd4-24bcbbc698b0", + "jurisdiction_id": "3c63f48e-bb86-42e5-b3ff-bc539fbf5295", + "jurisdiction_parent_id": "", + "jurisdiction_name": "vihiga", + "jurisdiction_depth": 3, + "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", + "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", + "treated_male_1_4": 0, + "treated_male_5_14": 0, + "treated_male_above_15": 0, + "treated_female_1_4": 0, + "treated_female_5_14": 0, + "treated_female_above_15": 0, + "total_males": 0, + "total_females": 0, + "total_all_genders": 0, + "supervisor_distributed": 0, + "received_number": 0, + "adminstered": 0, + "damaged": 0, + "adverse": 0, + "remaining_with_cdd": 0, + "returned_to_supervisor": 0 + }, + { + "id": "c477af78-93ce-51f8-bf1e-0bae3a80fcae", + "plan_id": "5e396185-6094-4817-9dd4-24bcbbc698b0", + "jurisdiction_id": "5824882f-2950-471a-958b-54d6ec529c7b", + "jurisdiction_parent_id": "3c63f48e-bb86-42e5-b3ff-bc539fbf5295", + "jurisdiction_name": "hamisi", + "jurisdiction_depth": 2, + "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", + "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", + "treated_male_1_4": 0, + "treated_male_5_14": 0, + "treated_male_above_15": 0, + "treated_female_1_4": 0, + "treated_female_5_14": 0, + "treated_female_above_15": 0, + "total_males": 0, + "total_females": 0, + "total_all_genders": 0, + "supervisor_distributed": 0, + "received_number": 0, + "adminstered": 0, + "damaged": 0, + "adverse": 0, + "remaining_with_cdd": 0, + "returned_to_supervisor": 0 + }, + { + "id": "1eb154a3-0dc7-5761-8bdc-e00960a7c298", + "plan_id": "5e396185-6094-4817-9dd4-24bcbbc698b0", + "jurisdiction_id": "6b18977a-f61d-4909-b651-bb590604290c", + "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", + "jurisdiction_name": "sabatia", + "jurisdiction_depth": 2, + "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", + "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", + "treated_male_1_4": 0, + "treated_male_5_14": 0, + "treated_male_above_15": 0, + "treated_female_1_4": 0, + "treated_female_5_14": 0, + "treated_female_above_15": 0, + "total_males": 0, + "total_females": 0, + "total_all_genders": 0, + "supervisor_distributed": 0, + "received_number": 0, + "adminstered": 0, + "damaged": 0, + "adverse": 0, + "remaining_with_cdd": 0, + "returned_to_supervisor": 0 + }, + { + "id": "e7395936-1605-56cb-a1b7-9c897fb70f11", + "plan_id": "5e396185-6094-4817-9dd4-24bcbbc698b0", + "jurisdiction_id": "ce13e7f4-6926-4be0-9117-519bd1cc4bb2", + "jurisdiction_parent_id": "032a9542-dab7-4a76-9e2e-bc7eb99a259c", + "jurisdiction_name": "so_Sompani_Health_Post_MACEPA_IRS_Lite_2020", + "jurisdiction_depth": 3, + "jurisdiction_path": "[\"03557b7e-0ddf-41f7-93c8-155669757a16\", \"48a04a67-ac6f-4d5e-bbc6-09b77ba1253d\", \"032a9542-dab7-4a76-9e2e-bc7eb99a259c\"]", + "jurisdiction_name_path": "[\"Zambia MACEPA IRS Lite 2020\", \"Southern MACEPA IRS Lite 2020\", \"Gwembe MACEPA IRS Lite 2020\"]", + "treated_male_1_4": 0, + "treated_male_5_14": 0, + "treated_male_above_15": 0, + "treated_female_1_4": 0, + "treated_female_5_14": 0, + "treated_female_above_15": 0, + "total_males": 0, + "total_females": 0, + "total_all_genders": 0, + "supervisor_distributed": 0, + "received_number": 0, + "adminstered": 0, + "damaged": 0, + "adverse": 0, + "remaining_with_cdd": 0, + "returned_to_supervisor": 0 + }, + { + "id": "f73da15a-5f88-5cf1-9cc3-7a2dcb75c14e", + "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada", + "jurisdiction_id": "02ddb27d-6b48-4940-8367-bb72e607ed9f", + "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", + "jurisdiction_name": "luanda", + "jurisdiction_depth": 2, + "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", + "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", + "treated_male_1_4": 36, + "treated_male_5_14": 25, + "treated_male_above_15": 0, + "treated_female_1_4": 23, + "treated_female_5_14": 23, + "treated_female_above_15": 23, + "total_males": 61, + "total_females": 69, + "total_all_genders": 130, + "supervisor_distributed": 63, + "received_number": 0, + "adminstered": 200, + "damaged": 0, + "adverse": 1, + "remaining_with_cdd": -200, + "returned_to_supervisor": 25 + }, + { + "id": "a2724ed4-b6d2-5e42-adb1-10a150c715f5", + "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada", + "jurisdiction_id": "17de7da3-217f-4e5d-b016-4be97dd49e77", + "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", + "jurisdiction_name": "emuhaya", + "jurisdiction_depth": 2, + "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", + "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", + "treated_male_1_4": 327, + "treated_male_5_14": 1093, + "treated_male_above_15": 0, + "treated_female_1_4": 272, + "treated_female_5_14": 1009, + "treated_female_above_15": 882, + "total_males": 1420, + "total_females": 2163, + "total_all_genders": 3583, + "supervisor_distributed": 13045, + "received_number": 615, + "adminstered": 3340, + "damaged": 314, + "adverse": 326, + "remaining_with_cdd": -3039, + "returned_to_supervisor": 71 + }, + { + "id": "45904fbb-256a-5872-a732-0189dcbc88a3", + "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada", + "jurisdiction_id": "3c63f48e-bb86-42e5-b3ff-bc539fbf5295", + "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", + "jurisdiction_name": "vihiga", + "jurisdiction_depth": 2, + "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", + "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", + "treated_male_1_4": 25, + "treated_male_5_14": 57, + "treated_male_above_15": 0, + "treated_female_1_4": 20, + "treated_female_5_14": 35, + "treated_female_above_15": 85, + "total_males": 82, + "total_females": 140, + "total_all_genders": 222, + "supervisor_distributed": 166, + "received_number": 288, + "adminstered": 1200, + "damaged": 3, + "adverse": 7, + "remaining_with_cdd": -915, + "returned_to_supervisor": 20 + }, + { + "id": "d2629ee9-0ca8-539e-9970-c97afeacbff5", + "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada", + "jurisdiction_id": "5824882f-2950-471a-958b-54d6ec529c7b", + "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", + "jurisdiction_name": "hamisi", + "jurisdiction_depth": 2, + "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", + "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", + "treated_male_1_4": 0, + "treated_male_5_14": 0, + "treated_male_above_15": 0, + "treated_female_1_4": 0, + "treated_female_5_14": 0, + "treated_female_above_15": 0, + "total_males": 0, + "total_females": 0, + "total_all_genders": 0, + "supervisor_distributed": 0, + "received_number": 0, + "adminstered": 0, + "damaged": 0, + "adverse": 0, + "remaining_with_cdd": 0, + "returned_to_supervisor": 0 + }, + { + "id": "3b506b3f-6dc1-5d0e-ac59-d95e3356bb46", + "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada", + "jurisdiction_id": "6b18977a-f61d-4909-b651-bb590604290c", + "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", + "jurisdiction_name": "sabatia", + "jurisdiction_depth": 2, + "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", + "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", + "treated_male_1_4": 0, + "treated_male_5_14": 0, + "treated_male_above_15": 0, + "treated_female_1_4": 0, + "treated_female_5_14": 0, + "treated_female_above_15": 0, + "total_males": 0, + "total_females": 0, + "total_all_genders": 0, + "supervisor_distributed": 0, + "received_number": 0, + "adminstered": 0, + "damaged": 0, + "adverse": 0, + "remaining_with_cdd": 0, + "returned_to_supervisor": 0 + }, + { + "id": "04d6a792-d2d1-565d-a9f8-87858863b917", + "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada", + "jurisdiction_id": "ce13e7f4-6926-4be0-9117-519bd1cc4bb2", + "jurisdiction_parent_id": "032a9542-dab7-4a76-9e2e-bc7eb99a259c", + "jurisdiction_name": "so_Sompani_Health_Post_MACEPA_IRS_Lite_2020", + "jurisdiction_depth": 3, + "jurisdiction_path": "[\"03557b7e-0ddf-41f7-93c8-155669757a16\", \"48a04a67-ac6f-4d5e-bbc6-09b77ba1253d\", \"032a9542-dab7-4a76-9e2e-bc7eb99a259c\"]", + "jurisdiction_name_path": "[\"Zambia MACEPA IRS Lite 2020\", \"Southern MACEPA IRS Lite 2020\", \"Gwembe MACEPA IRS Lite 2020\"]", + "treated_male_1_4": 0, + "treated_male_5_14": 0, + "treated_male_above_15": 0, + "treated_female_1_4": 0, + "treated_female_5_14": 0, + "treated_female_above_15": 0, + "total_males": 0, + "total_females": 0, + "total_all_genders": 0, + "supervisor_distributed": 0, + "received_number": 0, + "adminstered": 0, + "damaged": 0, + "adverse": 0, + "remaining_with_cdd": 0, + "returned_to_supervisor": 0 + }, + { + "id": "a6d7dc7d-af0b-5c3b-972d-6afff845234a", + "plan_id": "bbaf9674-e381-45f1-94d1-23bd373bc88e", + "jurisdiction_id": "02ddb27d-6b48-4940-8367-bb72e607ed9f", + "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", + "jurisdiction_name": "luanda", + "jurisdiction_depth": 2, + "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", + "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", + "treated_male_1_4": 0, + "treated_male_5_14": 0, + "treated_male_above_15": 0, + "treated_female_1_4": 0, + "treated_female_5_14": 0, + "treated_female_above_15": 0, + "total_males": 0, + "total_females": 0, + "total_all_genders": 0, + "supervisor_distributed": 0, + "received_number": 0, + "adminstered": 0, + "damaged": 0, + "adverse": 0, + "remaining_with_cdd": 0, + "returned_to_supervisor": 0 + }, + { + "id": "afdea68c-2f82-5f8f-a749-74f9fe36479f", + "plan_id": "bbaf9674-e381-45f1-94d1-23bd373bc88e", + "jurisdiction_id": "17de7da3-217f-4e5d-b016-4be97dd49e77", + "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", + "jurisdiction_name": "emuhaya", + "jurisdiction_depth": 2, + "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", + "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", + "treated_male_1_4": 0, + "treated_male_5_14": 0, + "treated_male_above_15": 0, + "treated_female_1_4": 0, + "treated_female_5_14": 0, + "treated_female_above_15": 0, + "total_males": 0, + "total_females": 0, + "total_all_genders": 0, + "supervisor_distributed": 0, + "received_number": 0, + "adminstered": 0, + "damaged": 0, + "adverse": 0, + "remaining_with_cdd": 0, + "returned_to_supervisor": 0 + }, + { + "id": "75c668a1-5a1c-5714-b5a1-47e4e7a141cc", + "plan_id": "bbaf9674-e381-45f1-94d1-23bd373bc88e", + "jurisdiction_id": "3c63f48e-bb86-42e5-b3ff-bc539fbf5295", + "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", + "jurisdiction_name": "vihiga", + "jurisdiction_depth": 2, + "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", + "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", + "treated_male_1_4": 0, + "treated_male_5_14": 0, + "treated_male_above_15": 0, + "treated_female_1_4": 0, + "treated_female_5_14": 0, + "treated_female_above_15": 0, + "total_males": 0, + "total_females": 0, + "total_all_genders": 0, + "supervisor_distributed": 0, + "received_number": 0, + "adminstered": 0, + "damaged": 0, + "adverse": 0, + "remaining_with_cdd": 0, + "returned_to_supervisor": 0 + }, + { + "id": "816a2ff4-fdba-53e9-943b-97fb8cf0b795", + "plan_id": "bbaf9674-e381-45f1-94d1-23bd373bc88e", + "jurisdiction_id": "5824882f-2950-471a-958b-54d6ec529c7b", + "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", + "jurisdiction_name": "hamisi", + "jurisdiction_depth": 2, + "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", + "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", + "treated_male_1_4": 0, + "treated_male_5_14": 0, + "treated_male_above_15": 0, + "treated_female_1_4": 0, + "treated_female_5_14": 0, + "treated_female_above_15": 0, + "total_males": 0, + "total_females": 0, + "total_all_genders": 0, + "supervisor_distributed": 0, + "received_number": 0, + "adminstered": 0, + "damaged": 0, + "adverse": 0, + "remaining_with_cdd": 0, + "returned_to_supervisor": 0 + }, + { + "id": "bdf55c65-ae73-55c3-b60f-0032ecb59b87", + "plan_id": "bbaf9674-e381-45f1-94d1-23bd373bc88e", + "jurisdiction_id": "6b18977a-f61d-4909-b651-bb590604290c", + "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", + "jurisdiction_name": "sabatia", + "jurisdiction_depth": 2, + "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", + "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", + "treated_male_1_4": 0, + "treated_male_5_14": 0, + "treated_male_above_15": 0, + "treated_female_1_4": 0, + "treated_female_5_14": 0, + "treated_female_above_15": 0, + "total_males": 0, + "total_females": 0, + "total_all_genders": 0, + "supervisor_distributed": 0, + "received_number": 0, + "adminstered": 0, + "damaged": 0, + "adverse": 0, + "remaining_with_cdd": 0, + "returned_to_supervisor": 0 + }, + { + "id": "b7136629-f24e-5fc6-aec4-f1a57aa76084", + "plan_id": "bbaf9674-e381-45f1-94d1-23bd373bc88e", + "jurisdiction_id": "ce13e7f4-6926-4be0-9117-519bd1cc4bb2", + "jurisdiction_parent_id": "032a9542-dab7-4a76-9e2e-bc7eb99a259c", + "jurisdiction_name": "so_Sompani_Health_Post_MACEPA_IRS_Lite_2020", + "jurisdiction_depth": 3, + "jurisdiction_path": "[\"03557b7e-0ddf-41f7-93c8-155669757a16\", \"48a04a67-ac6f-4d5e-bbc6-09b77ba1253d\", \"032a9542-dab7-4a76-9e2e-bc7eb99a259c\"]", + "jurisdiction_name_path": "[\"Zambia MACEPA IRS Lite 2020\", \"Southern MACEPA IRS Lite 2020\", \"Gwembe MACEPA IRS Lite 2020\"]", + "treated_male_1_4": 0, + "treated_male_5_14": 0, + "treated_male_above_15": 0, + "treated_female_1_4": 0, + "treated_female_5_14": 0, + "treated_female_above_15": 0, + "total_males": 0, + "total_females": 0, + "total_all_genders": 0, + "supervisor_distributed": 0, + "received_number": 0, + "adminstered": 0, + "damaged": 0, + "adverse": 0, + "remaining_with_cdd": 0, + "returned_to_supervisor": 0 + } +] diff --git a/src/containers/pages/MDALite/cddReports/cdds.tsx b/src/containers/pages/MDALite/cddReports/cdds.tsx index e83e44a0d3..1e0738b0ae 100644 --- a/src/containers/pages/MDALite/cddReports/cdds.tsx +++ b/src/containers/pages/MDALite/cddReports/cdds.tsx @@ -6,11 +6,6 @@ import { Col, Row } from 'reactstrap'; import IRSIndicatorLegend from '../../../../components/formatting/IRSIndicatorLegend'; import HeaderBreadcrumb from '../../../../components/page/HeaderBreadcrumb/HeaderBreadcrumb'; import Loading from '../../../../components/page/Loading'; -import { - defaultOptions, - renderInFilterFactory, -} from '../../../../components/Table/DrillDownFilters/utils'; -import { NoDataComponent } from '../../../../components/Table/NoDataComponent'; import { SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE, SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES, @@ -19,7 +14,6 @@ import { import { HOME, MDA_LITE_REPORTING_TITLE } from '../../../../configs/lang'; import { HOME_URL, - QUERY_PARAM_TITLE, REPORT_MDA_LITE_CDD_REPORT_URL, REPORT_MDA_LITE_PLAN_URL, } from '../../../../constants'; @@ -27,7 +21,7 @@ import { displayError } from '../../../../helpers/errors'; import { RouteParams } from '../../../../helpers/utils'; import supersetFetch from '../../../../services/superset'; import { GenericJurisdiction } from '../../../../store/ducks/generic/jurisdictions'; -import { cddReportColumns } from './helpers'; +import { cddReportColumns, getCddTableProps } from './helpers'; interface MDALiteCddReportsProps { cddData: any[]; @@ -36,9 +30,7 @@ interface MDALiteCddReportsProps { wardData: GenericJurisdiction[]; } -const MDALiteCddReportsProps = ( - props: MDALiteCddReportsProps & RouteComponentProps -) => { +const MDALiteCddReports = (props: MDALiteCddReportsProps & RouteComponentProps) => { const { cddData, supervisorData, wardData, service } = props; const [loading, setLoading] = useState(false); @@ -93,27 +85,7 @@ const MDALiteCddReportsProps = ( : MDA_LITE_REPORTING_TITLE; // table props - const tableProps = { - columns: cddReportColumns, - data: cddData || [], - identifierField: 'id', - paginate: false, - renderInBottomFilterBar: renderInFilterFactory({ - showColumnHider: false, - showFilters: false, - showPagination: true, - showRowHeightPicker: false, - showSearch: false, - }), - renderInTopFilterBar: renderInFilterFactory({ - ...defaultOptions, - componentProps: props, - queryParam: QUERY_PARAM_TITLE, - }), - renderNullDataComponent: () => , - resize: true, - useDrillDown: false, - }; + const tableProps = getCddTableProps(cddReportColumns, cddData); if (loading) { return ; @@ -121,7 +93,7 @@ const MDALiteCddReportsProps = ( return (
- currentTitle + {currentTitle} @@ -145,6 +117,6 @@ const defaultProps: MDALiteCddReportsProps = { wardData: [], }; -MDALiteCddReportsProps.defaultProps = defaultProps; +MDALiteCddReports.defaultProps = defaultProps; -export { MDALiteCddReportsProps as MDALiteCddReports }; +export { MDALiteCddReports }; diff --git a/src/containers/pages/MDALite/cddReports/helpers.tsx b/src/containers/pages/MDALite/cddReports/helpers.tsx index 2b11af3a85..5a6cffd154 100644 --- a/src/containers/pages/MDALite/cddReports/helpers.tsx +++ b/src/containers/pages/MDALite/cddReports/helpers.tsx @@ -1,5 +1,12 @@ +import React from 'react'; import { Cell } from 'react-table'; +import { + defaultOptions, + renderInFilterFactory, +} from '../../../../components/Table/DrillDownFilters/utils'; +import { NoDataComponent } from '../../../../components/Table/NoDataComponent'; import { indicatorThresholdsMDALite } from '../../../../configs/settings'; +import { QUERY_PARAM_TITLE } from '../../../../constants'; import { getIRSThresholdAdherenceIndicator } from '../../../../helpers/indicators'; import { drugDistributionColumns, @@ -33,3 +40,32 @@ export const cddReportColumns = [ }, ...drugDistributionColumns, ]; + +type ColumnsType = typeof supervisorColumns | typeof cddReportColumns; +/** + * gets MDA_lite cdd and supervisor drill down table props + * @param {ColumnsType} columns - table columns + * @param {any} data - table data + */ +export const getCddTableProps = (columns: ColumnsType, data: any) => { + return { + columns, + data: data || [], + identifierField: 'id', + paginate: false, + renderInBottomFilterBar: renderInFilterFactory({ + showColumnHider: false, + showFilters: false, + showPagination: true, + showRowHeightPicker: false, + showSearch: false, + }), + renderInTopFilterBar: renderInFilterFactory({ + ...defaultOptions, + queryParam: QUERY_PARAM_TITLE, + }), + renderNullDataComponent: () => , + resize: true, + useDrillDown: false, + }; +}; diff --git a/src/containers/pages/MDALite/cddReports/supervisors.tsx b/src/containers/pages/MDALite/cddReports/supervisors.tsx new file mode 100644 index 0000000000..684f3adfc1 --- /dev/null +++ b/src/containers/pages/MDALite/cddReports/supervisors.tsx @@ -0,0 +1,115 @@ +import { DrillDownTable } from '@onaio/drill-down-table/dist/types'; +import React, { useEffect, useState } from 'react'; +import Helmet from 'react-helmet'; +import { RouteComponentProps } from 'react-router-dom'; +import { Col, Row } from 'reactstrap'; +import IRSIndicatorLegend from '../../../../components/formatting/IRSIndicatorLegend'; +import HeaderBreadcrumb from '../../../../components/page/HeaderBreadcrumb/HeaderBreadcrumb'; +import Loading from '../../../../components/page/Loading'; +import { + SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES, + SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE, +} from '../../../../configs/env'; +import { HOME, MDA_LITE_REPORTING_TITLE } from '../../../../configs/lang'; +import { HOME_URL, REPORT_MDA_LITE_PLAN_URL } from '../../../../constants'; +import { displayError } from '../../../../helpers/errors'; +import { RouteParams } from '../../../../helpers/utils'; +import supersetFetch from '../../../../services/superset'; +import { GenericJurisdiction } from '../../../../store/ducks/generic/jurisdictions'; +import { getCddTableProps, supervisorColumns } from './helpers'; + +interface MDALiteSupervisorReportsProps { + service: typeof supersetFetch; + supervisorData: any[]; + wardData: GenericJurisdiction[]; +} + +const MDALiteSupervisorReports = ( + props: MDALiteSupervisorReportsProps & RouteComponentProps +) => { + const { supervisorData, wardData, service } = props; + + const [loading, setLoading] = useState(false); + + const { params } = props.match; + const { planId, jurisdictionId, supervisorId } = params; + const wardName = wardData[0].jurisdiction_name; + + async function loadData() { + setLoading(supervisorData.length < 1); + try { + if (planId && jurisdictionId) { + await service(SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE); + } + if (planId && jurisdictionId && wardData.length) { + const slices = SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES.split(','); + await service(slices[0]); + } + } catch (e) { + displayError(e); + } finally { + setLoading(false); + } + } + + useEffect(() => { + loadData().catch(err => displayError(err)); + }, [planId, jurisdictionId, supervisorId]); + + const currentPage = { + label: wardName, + url: `${REPORT_MDA_LITE_PLAN_URL}/${planId}/${wardData[0].jurisdiction_parent_id}`, + }; + const breadcrumbProps = { + currentPage, + pages: [ + { + label: HOME, + url: HOME_URL, + }, + // change to subcounty name + { + label: wardData[0].jurisdiction_name, + url: `${REPORT_MDA_LITE_PLAN_URL}/${planId}/${wardData[0].jurisdiction_parent_id}`, + }, + ], + }; + const currentTitle = wardName + ? `${MDA_LITE_REPORTING_TITLE}: ${wardName}` + : MDA_LITE_REPORTING_TITLE; + + // table props + const tableProps = getCddTableProps(supervisorColumns, supervisorData); + + if (loading) { + return ; + } + return ( +
+ + {currentTitle} + + + + +

{currentTitle}

+
+ +
+ + +
+
+ ); +}; + +/** default props */ +const defaultProps: MDALiteSupervisorReportsProps = { + service: supersetFetch, + supervisorData: [], + wardData: [], +}; + +MDALiteSupervisorReports.defaultProps = defaultProps; + +export { MDALiteSupervisorReports }; From 5d373c36c1c8441af696942605abd0a1893a4359 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Fri, 12 Mar 2021 15:08:17 +0300 Subject: [PATCH 13/40] Clean up --- .../pages/GenericJurisdictionReport/index.tsx | 2 - .../testData/jurs.json | 478 ------------------ 2 files changed, 480 deletions(-) delete mode 100644 src/containers/pages/GenericJurisdictionReport/testData/jurs.json diff --git a/src/containers/pages/GenericJurisdictionReport/index.tsx b/src/containers/pages/GenericJurisdictionReport/index.tsx index b9e610b318..dfdf33ecb0 100644 --- a/src/containers/pages/GenericJurisdictionReport/index.tsx +++ b/src/containers/pages/GenericJurisdictionReport/index.tsx @@ -27,7 +27,6 @@ import { fetchSMCPlans, SMCPLANType } from '../../../store/ducks/generic/SMCPlan import { getJurisdictionBreadcrumbs } from '../IRS/Map/helpers'; import { GetColumnsToUse, getColumnsToUse, TableProps } from './helpers'; import './style.css'; -import jursData from './testData/jurs.json'; /** register the reducers */ reducerRegistry.register(GenericJurisdictionsReducerName, GenericJurisdictionsReducer); @@ -107,7 +106,6 @@ const GenericJurisdictionReport = ( /** async function to load the data */ async function loadData() { - fetchJurisdictions('0', jursData as any); try { setLoading(!plan || !jurisdictions || jurisdictions.length < 1); // set loading when there is no data let fetchPlansParams: SupersetFormData | null = null; diff --git a/src/containers/pages/GenericJurisdictionReport/testData/jurs.json b/src/containers/pages/GenericJurisdictionReport/testData/jurs.json deleted file mode 100644 index d9fac70bf7..0000000000 --- a/src/containers/pages/GenericJurisdictionReport/testData/jurs.json +++ /dev/null @@ -1,478 +0,0 @@ -[ - { - "id": "165b0ae7-92fa-5b70-a7bb-283797f565c2", - "plan_id": "5e396185-6094-4817-9dd4-24bcbbc698b0", - "jurisdiction_id": "02ddb27d-6b48-4940-8367-bb72e607ed9f", - "jurisdiction_parent_id": "", - "jurisdiction_name": "luanda", - "jurisdiction_depth": 2, - "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", - "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", - "treated_male_1_4": "6,472,047", - "treated_male_5_14": 0, - "treated_male_above_15": 0, - "treated_female_1_4": 0, - "treated_female_5_14": 0, - "treated_female_above_15": 0, - "total_males": 20, - "total_females": 3, - "total_all_genders": 20, - "supervisor_distributed": 0, - "received_number": 0, - "adminstered": 0, - "damaged": 0, - "adverse": 0, - "remaining_with_cdd": 10, - "returned_to_supervisor": 3, - "census_pop_target": 200, - "treatment_coverage": 0.8, - "other_pop_target": 500, - "other_pop_coverage": 0.65 - }, - { - "id": "89bb4010-38ee-5eac-b92a-4deafa62765a", - "plan_id": "5e396185-6094-4817-9dd4-24bcbbc698b0", - "jurisdiction_id": "17de7da3-217f-4e5d-b016-4be97dd49e77", - "jurisdiction_parent_id": "", - "jurisdiction_name": "emuhaya", - "jurisdiction_depth": 2, - "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", - "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", - "treated_male_1_4": 0, - "treated_male_5_14": 0, - "treated_male_above_15": 0, - "treated_female_1_4": 0, - "treated_female_5_14": 0, - "treated_female_above_15": 0, - "total_males": 19, - "total_females": 100, - "total_all_genders": 0, - "supervisor_distributed": 0, - "received_number": 0, - "adminstered": 0, - "damaged": 0, - "adverse": 0, - "remaining_with_cdd": 0, - "returned_to_supervisor": 0, - "census_pop_target": 300, - "treatment_coverage": 0.9, - "other_pop_target": 400, - "other_pop_coverage": 0.6 - }, - { - "id": "541e7ed0-2dc6-586e-b563-4c988c5ac585", - "plan_id": "5e396185-6094-4817-9dd4-24bcbbc698b0", - "jurisdiction_id": "3c63f48e-bb86-42e5-b3ff-bc539fbf5295", - "jurisdiction_parent_id": "", - "jurisdiction_name": "vihiga", - "jurisdiction_depth": 3, - "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", - "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", - "treated_male_1_4": 0, - "treated_male_5_14": 0, - "treated_male_above_15": 0, - "treated_female_1_4": 0, - "treated_female_5_14": 0, - "treated_female_above_15": 0, - "total_males": 0, - "total_females": 0, - "total_all_genders": 0, - "supervisor_distributed": 0, - "received_number": 0, - "adminstered": 0, - "damaged": 0, - "adverse": 0, - "remaining_with_cdd": 0, - "returned_to_supervisor": 0 - }, - { - "id": "c477af78-93ce-51f8-bf1e-0bae3a80fcae", - "plan_id": "5e396185-6094-4817-9dd4-24bcbbc698b0", - "jurisdiction_id": "5824882f-2950-471a-958b-54d6ec529c7b", - "jurisdiction_parent_id": "3c63f48e-bb86-42e5-b3ff-bc539fbf5295", - "jurisdiction_name": "hamisi", - "jurisdiction_depth": 2, - "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", - "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", - "treated_male_1_4": 0, - "treated_male_5_14": 0, - "treated_male_above_15": 0, - "treated_female_1_4": 0, - "treated_female_5_14": 0, - "treated_female_above_15": 0, - "total_males": 0, - "total_females": 0, - "total_all_genders": 0, - "supervisor_distributed": 0, - "received_number": 0, - "adminstered": 0, - "damaged": 0, - "adverse": 0, - "remaining_with_cdd": 0, - "returned_to_supervisor": 0 - }, - { - "id": "1eb154a3-0dc7-5761-8bdc-e00960a7c298", - "plan_id": "5e396185-6094-4817-9dd4-24bcbbc698b0", - "jurisdiction_id": "6b18977a-f61d-4909-b651-bb590604290c", - "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", - "jurisdiction_name": "sabatia", - "jurisdiction_depth": 2, - "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", - "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", - "treated_male_1_4": 0, - "treated_male_5_14": 0, - "treated_male_above_15": 0, - "treated_female_1_4": 0, - "treated_female_5_14": 0, - "treated_female_above_15": 0, - "total_males": 0, - "total_females": 0, - "total_all_genders": 0, - "supervisor_distributed": 0, - "received_number": 0, - "adminstered": 0, - "damaged": 0, - "adverse": 0, - "remaining_with_cdd": 0, - "returned_to_supervisor": 0 - }, - { - "id": "e7395936-1605-56cb-a1b7-9c897fb70f11", - "plan_id": "5e396185-6094-4817-9dd4-24bcbbc698b0", - "jurisdiction_id": "ce13e7f4-6926-4be0-9117-519bd1cc4bb2", - "jurisdiction_parent_id": "032a9542-dab7-4a76-9e2e-bc7eb99a259c", - "jurisdiction_name": "so_Sompani_Health_Post_MACEPA_IRS_Lite_2020", - "jurisdiction_depth": 3, - "jurisdiction_path": "[\"03557b7e-0ddf-41f7-93c8-155669757a16\", \"48a04a67-ac6f-4d5e-bbc6-09b77ba1253d\", \"032a9542-dab7-4a76-9e2e-bc7eb99a259c\"]", - "jurisdiction_name_path": "[\"Zambia MACEPA IRS Lite 2020\", \"Southern MACEPA IRS Lite 2020\", \"Gwembe MACEPA IRS Lite 2020\"]", - "treated_male_1_4": 0, - "treated_male_5_14": 0, - "treated_male_above_15": 0, - "treated_female_1_4": 0, - "treated_female_5_14": 0, - "treated_female_above_15": 0, - "total_males": 0, - "total_females": 0, - "total_all_genders": 0, - "supervisor_distributed": 0, - "received_number": 0, - "adminstered": 0, - "damaged": 0, - "adverse": 0, - "remaining_with_cdd": 0, - "returned_to_supervisor": 0 - }, - { - "id": "f73da15a-5f88-5cf1-9cc3-7a2dcb75c14e", - "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada", - "jurisdiction_id": "02ddb27d-6b48-4940-8367-bb72e607ed9f", - "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", - "jurisdiction_name": "luanda", - "jurisdiction_depth": 2, - "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", - "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", - "treated_male_1_4": 36, - "treated_male_5_14": 25, - "treated_male_above_15": 0, - "treated_female_1_4": 23, - "treated_female_5_14": 23, - "treated_female_above_15": 23, - "total_males": 61, - "total_females": 69, - "total_all_genders": 130, - "supervisor_distributed": 63, - "received_number": 0, - "adminstered": 200, - "damaged": 0, - "adverse": 1, - "remaining_with_cdd": -200, - "returned_to_supervisor": 25 - }, - { - "id": "a2724ed4-b6d2-5e42-adb1-10a150c715f5", - "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada", - "jurisdiction_id": "17de7da3-217f-4e5d-b016-4be97dd49e77", - "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", - "jurisdiction_name": "emuhaya", - "jurisdiction_depth": 2, - "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", - "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", - "treated_male_1_4": 327, - "treated_male_5_14": 1093, - "treated_male_above_15": 0, - "treated_female_1_4": 272, - "treated_female_5_14": 1009, - "treated_female_above_15": 882, - "total_males": 1420, - "total_females": 2163, - "total_all_genders": 3583, - "supervisor_distributed": 13045, - "received_number": 615, - "adminstered": 3340, - "damaged": 314, - "adverse": 326, - "remaining_with_cdd": -3039, - "returned_to_supervisor": 71 - }, - { - "id": "45904fbb-256a-5872-a732-0189dcbc88a3", - "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada", - "jurisdiction_id": "3c63f48e-bb86-42e5-b3ff-bc539fbf5295", - "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", - "jurisdiction_name": "vihiga", - "jurisdiction_depth": 2, - "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", - "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", - "treated_male_1_4": 25, - "treated_male_5_14": 57, - "treated_male_above_15": 0, - "treated_female_1_4": 20, - "treated_female_5_14": 35, - "treated_female_above_15": 85, - "total_males": 82, - "total_females": 140, - "total_all_genders": 222, - "supervisor_distributed": 166, - "received_number": 288, - "adminstered": 1200, - "damaged": 3, - "adverse": 7, - "remaining_with_cdd": -915, - "returned_to_supervisor": 20 - }, - { - "id": "d2629ee9-0ca8-539e-9970-c97afeacbff5", - "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada", - "jurisdiction_id": "5824882f-2950-471a-958b-54d6ec529c7b", - "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", - "jurisdiction_name": "hamisi", - "jurisdiction_depth": 2, - "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", - "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", - "treated_male_1_4": 0, - "treated_male_5_14": 0, - "treated_male_above_15": 0, - "treated_female_1_4": 0, - "treated_female_5_14": 0, - "treated_female_above_15": 0, - "total_males": 0, - "total_females": 0, - "total_all_genders": 0, - "supervisor_distributed": 0, - "received_number": 0, - "adminstered": 0, - "damaged": 0, - "adverse": 0, - "remaining_with_cdd": 0, - "returned_to_supervisor": 0 - }, - { - "id": "3b506b3f-6dc1-5d0e-ac59-d95e3356bb46", - "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada", - "jurisdiction_id": "6b18977a-f61d-4909-b651-bb590604290c", - "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", - "jurisdiction_name": "sabatia", - "jurisdiction_depth": 2, - "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", - "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", - "treated_male_1_4": 0, - "treated_male_5_14": 0, - "treated_male_above_15": 0, - "treated_female_1_4": 0, - "treated_female_5_14": 0, - "treated_female_above_15": 0, - "total_males": 0, - "total_females": 0, - "total_all_genders": 0, - "supervisor_distributed": 0, - "received_number": 0, - "adminstered": 0, - "damaged": 0, - "adverse": 0, - "remaining_with_cdd": 0, - "returned_to_supervisor": 0 - }, - { - "id": "04d6a792-d2d1-565d-a9f8-87858863b917", - "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada", - "jurisdiction_id": "ce13e7f4-6926-4be0-9117-519bd1cc4bb2", - "jurisdiction_parent_id": "032a9542-dab7-4a76-9e2e-bc7eb99a259c", - "jurisdiction_name": "so_Sompani_Health_Post_MACEPA_IRS_Lite_2020", - "jurisdiction_depth": 3, - "jurisdiction_path": "[\"03557b7e-0ddf-41f7-93c8-155669757a16\", \"48a04a67-ac6f-4d5e-bbc6-09b77ba1253d\", \"032a9542-dab7-4a76-9e2e-bc7eb99a259c\"]", - "jurisdiction_name_path": "[\"Zambia MACEPA IRS Lite 2020\", \"Southern MACEPA IRS Lite 2020\", \"Gwembe MACEPA IRS Lite 2020\"]", - "treated_male_1_4": 0, - "treated_male_5_14": 0, - "treated_male_above_15": 0, - "treated_female_1_4": 0, - "treated_female_5_14": 0, - "treated_female_above_15": 0, - "total_males": 0, - "total_females": 0, - "total_all_genders": 0, - "supervisor_distributed": 0, - "received_number": 0, - "adminstered": 0, - "damaged": 0, - "adverse": 0, - "remaining_with_cdd": 0, - "returned_to_supervisor": 0 - }, - { - "id": "a6d7dc7d-af0b-5c3b-972d-6afff845234a", - "plan_id": "bbaf9674-e381-45f1-94d1-23bd373bc88e", - "jurisdiction_id": "02ddb27d-6b48-4940-8367-bb72e607ed9f", - "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", - "jurisdiction_name": "luanda", - "jurisdiction_depth": 2, - "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", - "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", - "treated_male_1_4": 0, - "treated_male_5_14": 0, - "treated_male_above_15": 0, - "treated_female_1_4": 0, - "treated_female_5_14": 0, - "treated_female_above_15": 0, - "total_males": 0, - "total_females": 0, - "total_all_genders": 0, - "supervisor_distributed": 0, - "received_number": 0, - "adminstered": 0, - "damaged": 0, - "adverse": 0, - "remaining_with_cdd": 0, - "returned_to_supervisor": 0 - }, - { - "id": "afdea68c-2f82-5f8f-a749-74f9fe36479f", - "plan_id": "bbaf9674-e381-45f1-94d1-23bd373bc88e", - "jurisdiction_id": "17de7da3-217f-4e5d-b016-4be97dd49e77", - "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", - "jurisdiction_name": "emuhaya", - "jurisdiction_depth": 2, - "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", - "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", - "treated_male_1_4": 0, - "treated_male_5_14": 0, - "treated_male_above_15": 0, - "treated_female_1_4": 0, - "treated_female_5_14": 0, - "treated_female_above_15": 0, - "total_males": 0, - "total_females": 0, - "total_all_genders": 0, - "supervisor_distributed": 0, - "received_number": 0, - "adminstered": 0, - "damaged": 0, - "adverse": 0, - "remaining_with_cdd": 0, - "returned_to_supervisor": 0 - }, - { - "id": "75c668a1-5a1c-5714-b5a1-47e4e7a141cc", - "plan_id": "bbaf9674-e381-45f1-94d1-23bd373bc88e", - "jurisdiction_id": "3c63f48e-bb86-42e5-b3ff-bc539fbf5295", - "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", - "jurisdiction_name": "vihiga", - "jurisdiction_depth": 2, - "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", - "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", - "treated_male_1_4": 0, - "treated_male_5_14": 0, - "treated_male_above_15": 0, - "treated_female_1_4": 0, - "treated_female_5_14": 0, - "treated_female_above_15": 0, - "total_males": 0, - "total_females": 0, - "total_all_genders": 0, - "supervisor_distributed": 0, - "received_number": 0, - "adminstered": 0, - "damaged": 0, - "adverse": 0, - "remaining_with_cdd": 0, - "returned_to_supervisor": 0 - }, - { - "id": "816a2ff4-fdba-53e9-943b-97fb8cf0b795", - "plan_id": "bbaf9674-e381-45f1-94d1-23bd373bc88e", - "jurisdiction_id": "5824882f-2950-471a-958b-54d6ec529c7b", - "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", - "jurisdiction_name": "hamisi", - "jurisdiction_depth": 2, - "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", - "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", - "treated_male_1_4": 0, - "treated_male_5_14": 0, - "treated_male_above_15": 0, - "treated_female_1_4": 0, - "treated_female_5_14": 0, - "treated_female_above_15": 0, - "total_males": 0, - "total_females": 0, - "total_all_genders": 0, - "supervisor_distributed": 0, - "received_number": 0, - "adminstered": 0, - "damaged": 0, - "adverse": 0, - "remaining_with_cdd": 0, - "returned_to_supervisor": 0 - }, - { - "id": "bdf55c65-ae73-55c3-b60f-0032ecb59b87", - "plan_id": "bbaf9674-e381-45f1-94d1-23bd373bc88e", - "jurisdiction_id": "6b18977a-f61d-4909-b651-bb590604290c", - "jurisdiction_parent_id": "f2482d8c-e6ed-433b-860f-96c9cd09b4a3", - "jurisdiction_name": "sabatia", - "jurisdiction_depth": 2, - "jurisdiction_path": "[\"25e8a10b-737c-44e7-bfff-3b6344b1126f\", \"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\"]", - "jurisdiction_name_path": "[\"Kenya\", \"Vihiga\"]", - "treated_male_1_4": 0, - "treated_male_5_14": 0, - "treated_male_above_15": 0, - "treated_female_1_4": 0, - "treated_female_5_14": 0, - "treated_female_above_15": 0, - "total_males": 0, - "total_females": 0, - "total_all_genders": 0, - "supervisor_distributed": 0, - "received_number": 0, - "adminstered": 0, - "damaged": 0, - "adverse": 0, - "remaining_with_cdd": 0, - "returned_to_supervisor": 0 - }, - { - "id": "b7136629-f24e-5fc6-aec4-f1a57aa76084", - "plan_id": "bbaf9674-e381-45f1-94d1-23bd373bc88e", - "jurisdiction_id": "ce13e7f4-6926-4be0-9117-519bd1cc4bb2", - "jurisdiction_parent_id": "032a9542-dab7-4a76-9e2e-bc7eb99a259c", - "jurisdiction_name": "so_Sompani_Health_Post_MACEPA_IRS_Lite_2020", - "jurisdiction_depth": 3, - "jurisdiction_path": "[\"03557b7e-0ddf-41f7-93c8-155669757a16\", \"48a04a67-ac6f-4d5e-bbc6-09b77ba1253d\", \"032a9542-dab7-4a76-9e2e-bc7eb99a259c\"]", - "jurisdiction_name_path": "[\"Zambia MACEPA IRS Lite 2020\", \"Southern MACEPA IRS Lite 2020\", \"Gwembe MACEPA IRS Lite 2020\"]", - "treated_male_1_4": 0, - "treated_male_5_14": 0, - "treated_male_above_15": 0, - "treated_female_1_4": 0, - "treated_female_5_14": 0, - "treated_female_above_15": 0, - "total_males": 0, - "total_females": 0, - "total_all_genders": 0, - "supervisor_distributed": 0, - "received_number": 0, - "adminstered": 0, - "damaged": 0, - "adverse": 0, - "remaining_with_cdd": 0, - "returned_to_supervisor": 0 - } -] From d4846d36a3a9f6f1b959be84602bcae05e742255 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Fri, 12 Mar 2021 15:57:34 +0300 Subject: [PATCH 14/40] Add MDA-Lite CDDs reducer and actions --- src/store/ducks/superset/MDALite/cdd.ts | 137 ++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 src/store/ducks/superset/MDALite/cdd.ts diff --git a/src/store/ducks/superset/MDALite/cdd.ts b/src/store/ducks/superset/MDALite/cdd.ts new file mode 100644 index 0000000000..b888b3ab7e --- /dev/null +++ b/src/store/ducks/superset/MDALite/cdd.ts @@ -0,0 +1,137 @@ +import { + fetchActionCreatorFactory, + getItemByIdFactory, + getItemsByIdFactory, + reducerFactory, + removeActionCreatorFactory, +} from '@opensrp/reducer-factory'; +import intersect from 'fast_array_intersect'; +import { values } from 'lodash'; +import { Store } from 'redux'; +import { createSelector } from 'reselect'; + +/** the reducer name */ +export const reducerName = 'MDALiteCdds'; + +/** MDA-Lite gender report interface */ +export interface MDALiteGenderInterface { + treated_female_above_15: number; + treated_female_1_4: number; + treated_female_5_14: number; + treated_male_above_15: number; + treated_male_1_4: number; + treated_male_5_14: number; + total_all_genders: number; + total_females: number; + total_males: number; +} + +/** MDA-Lite Drugs report interface */ +export interface MDALiteDrugsReportInterface { + adminstered: number; + adverse: number; + damaged: number; + received_number: number; + remaining_with_cdd: number; + returned_to_supervisor: number; + supervisor_distributed: number; +} + +/** MDALiteCdds interface */ +export interface MDALiteCDDInterface extends MDALiteGenderInterface, MDALiteDrugsReportInterface { + cdd_name: string; + id: string; + supervisor_id: string; + supervisor_name: string; + received_number: number; +} + +/** MDA-Lite CDD Reducer */ +const reducer = reducerFactory(reducerName); +export default reducer; + +// actions +/** actionCreator returns action to to add Item records to store */ +export const fetchMDALiteCDDs = fetchActionCreatorFactory(reducerName, 'id'); +/** actionCreator returns action to to remove Item records to store */ +export const removeMDALiteCDDs = removeActionCreatorFactory(reducerName); + +// selectors +/** get one CDD using their id */ +export const getMDALiteCDDById = getItemByIdFactory(reducerName); + +/** get all CDDS by ids */ +export const getMDALiteCDDsArray = getItemsByIdFactory(reducerName); + +/** RESELECT USAGE STARTS HERE */ + +/** This interface represents the structure of MDA Lite CDD filter options/params */ +export interface MDALiteCDDFilters { + cdd_name?: string /** CDD name */; + supervisor_id?: string[] /** supervisor id */; +} + +/** MDALiteCDDsArrayBaseSelector select an array of all CDDs + * @param state - the redux store + */ +export const MDALiteCDDsArrayBaseSelector = (state: Partial): MDALiteCDDInterface[] => + values(getMDALiteCDDsArray(state) || {}); + +/** + * Gets CDD name from Filters + * @param state - the redux store + * @param props - the cdd filters object + */ +export const getName = (_: Partial, props: MDALiteCDDFilters) => props.cdd_name; + +/** + * Gets supervisor id from filters + * @param state - the redux store + * @param props - the cdd filters object + */ +export const getSupervisorId = (_: Partial, props: MDALiteCDDFilters) => props.supervisor_id; + +/** + * Gets an array of CDDs filtered by name + * @param {Partial} state - the redux store + * @param {MDALiteCDDFilters} props - the CDDs filters object + */ +export const getMDALiteCDDsArrayByTitle = () => + createSelector([MDALiteCDDsArrayBaseSelector, getName], (cdds, cddName) => + cddName ? cdds.filter(cdd => cdd.cdd_name.toLowerCase().includes(cddName.toLowerCase())) : cdds + ); + +/** + * Gets an array of CDDs objects filtered by supervisor id + * @param {Partial} state - the redux store + * @param {MDALiteCDDFilters} props - the CDDs filters object + */ +export const getMDALiteCDDsArrayByStatus = () => + createSelector([MDALiteCDDsArrayBaseSelector, getSupervisorId], (cdds, supervisorId) => + supervisorId + ? cdds.filter(cdd => (supervisorId.length ? supervisorId.includes(cdd.supervisor_id) : true)) + : cdds + ); + +/** + * Returns a selector that gets an array of CDDs objects filtered by one or all + * of the following: + * - cdd_name + * - supervisor_id + * + * These filter params are all optional and are supplied via the prop parameter. + * + * This selector is meant to be a memoized replacement for getMDALiteCDDsArray. + * + * To use this selector, do something like: + * const MDALiteCDDsArraySelector = makeMDALiteCDDsArraySelector(); + * + * @param {Partial} state - the redux store + * @param {CDDsFilters} props - the CDD filters object + */ +export const makeMDALiteCDDsArraySelector = () => { + return createSelector( + [getMDALiteCDDsArrayByTitle(), getMDALiteCDDsArrayByStatus()], + (cdd1, cdd2) => intersect([cdd1, cdd2], JSON.stringify) + ); +}; From a42729d4a193676285c44345d7e34a5204f070e5 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Fri, 12 Mar 2021 16:17:08 +0300 Subject: [PATCH 15/40] Add MDA-Lite supervisors reducer and actions --- src/store/ducks/superset/MDALite/cdd.ts | 9 +- .../ducks/superset/MDALite/supervisors.ts | 117 ++++++++++++++++++ 2 files changed, 121 insertions(+), 5 deletions(-) create mode 100644 src/store/ducks/superset/MDALite/supervisors.ts diff --git a/src/store/ducks/superset/MDALite/cdd.ts b/src/store/ducks/superset/MDALite/cdd.ts index b888b3ab7e..39496eea5d 100644 --- a/src/store/ducks/superset/MDALite/cdd.ts +++ b/src/store/ducks/superset/MDALite/cdd.ts @@ -39,11 +39,12 @@ export interface MDALiteDrugsReportInterface { /** MDALiteCdds interface */ export interface MDALiteCDDInterface extends MDALiteGenderInterface, MDALiteDrugsReportInterface { + average_per_day: number; cdd_name: string; + days_worked: number; id: string; supervisor_id: string; supervisor_name: string; - received_number: number; } /** MDA-Lite CDD Reducer */ @@ -68,7 +69,7 @@ export const getMDALiteCDDsArray = getItemsByIdFactory(redu /** This interface represents the structure of MDA Lite CDD filter options/params */ export interface MDALiteCDDFilters { cdd_name?: string /** CDD name */; - supervisor_id?: string[] /** supervisor id */; + supervisor_id?: string /** supervisor id */; } /** MDALiteCDDsArrayBaseSelector select an array of all CDDs @@ -108,9 +109,7 @@ export const getMDALiteCDDsArrayByTitle = () => */ export const getMDALiteCDDsArrayByStatus = () => createSelector([MDALiteCDDsArrayBaseSelector, getSupervisorId], (cdds, supervisorId) => - supervisorId - ? cdds.filter(cdd => (supervisorId.length ? supervisorId.includes(cdd.supervisor_id) : true)) - : cdds + supervisorId ? cdds.filter(cdd => supervisorId === cdd.supervisor_id) : cdds ); /** diff --git a/src/store/ducks/superset/MDALite/supervisors.ts b/src/store/ducks/superset/MDALite/supervisors.ts new file mode 100644 index 0000000000..9aec434985 --- /dev/null +++ b/src/store/ducks/superset/MDALite/supervisors.ts @@ -0,0 +1,117 @@ +import { + fetchActionCreatorFactory, + getItemByIdFactory, + getItemsByIdFactory, + reducerFactory, + removeActionCreatorFactory, +} from '@opensrp/reducer-factory'; +import intersect from 'fast_array_intersect'; +import { values } from 'lodash'; +import { Store } from 'redux'; +import { createSelector } from 'reselect'; +import { MDALiteDrugsReportInterface } from './cdd'; + +/** the reducer name */ +export const reducerName = 'MDALiteSupervisors'; + +/** MDALiteSupervisors interface */ +export interface MDALiteSupervisor extends MDALiteDrugsReportInterface { + id: string; + name: string; + ward_id: string; +} + +/** MDA-Lite supervisor Reducer */ +const reducer = reducerFactory(reducerName); +export default reducer; + +// actions +/** actionCreator returns action to to add Item records to store */ +export const fetchMDALiteSupervisors = fetchActionCreatorFactory( + reducerName, + 'id' +); +/** actionCreator returns action to to remove Item records to store */ +export const removeMDALiteSupervisors = removeActionCreatorFactory(reducerName); + +// selectors +/** get one supervisor using their id */ +export const getMDALiteSupervisorById = getItemByIdFactory(reducerName); + +/** get all Supervisors by ids */ +export const getMDALiteSupervisorsArray = getItemsByIdFactory(reducerName); + +/** RESELECT USAGE STARTS HERE */ + +/** This interface represents the structure of MDA Lite Supervisors filter options/params */ +export interface MDALiteSupervisorFilters { + name?: string /** Supervisor name */; + ward_id?: string /** ward id */; +} + +/** MDALiteSupervisorsArrayBaseSelector select an array of all Supervisors + * @param state - the redux store + */ +export const MDALiteSupervisorsArrayBaseSelector = (state: Partial): MDALiteSupervisor[] => + values(getMDALiteSupervisorsArray(state) || {}); + +/** + * Gets supervisor name from Filters + * @param state - the redux store + * @param props - the supervisor filters object + */ +export const getName = (_: Partial, props: MDALiteSupervisorFilters) => props.name; + +/** + * Gets ward id from filters + * @param state - the redux store + * @param props - the supervisor filters object + */ +export const getWardId = (_: Partial, props: MDALiteSupervisorFilters) => props.ward_id; + +/** + * Gets an array of Supervisors filtered by name + * @param {Partial} state - the redux store + * @param {MDALiteSupervisorFilters} props - the Supervisors filters object + */ +export const getMDALiteSupervisorsArrayByTitle = () => + createSelector([MDALiteSupervisorsArrayBaseSelector, getName], (Supervisors, supervisorName) => + supervisorName + ? Supervisors.filter(supervisor => + supervisor.name.toLowerCase().includes(supervisorName.toLowerCase()) + ) + : Supervisors + ); + +/** + * Gets an array of Supervisors objects filtered by ward id + * @param {Partial} state - the redux store + * @param {MDALiteSupervisorFilters} props - the Supervisors filters object + */ +export const getMDALiteSupervisorsArrayByStatus = () => + createSelector([MDALiteSupervisorsArrayBaseSelector, getWardId], (Supervisors, wardId) => + wardId ? Supervisors.filter(supervisor => wardId === supervisor.ward_id) : Supervisors + ); + +/** + * Returns a selector that gets an array of Supervisors objects filtered by one or all + * of the following: + * - name + * - ward_id + * + * These filter params are all optional and are supplied via the prop parameter. + * + * This selector is meant to be a memoized replacement for getMDALiteSupervisorsArray. + * + * To use this selector, do something like: + * const MDALiteSupervisorsArraySelector = makeMDALiteSupervisorsArraySelector(); + * + * @param {Partial} state - the redux store + * @param {SupervisorsFilters} props - the supervisor filters object + */ +export const makeMDALiteSupervisorsArraySelector = () => { + return createSelector( + [getMDALiteSupervisorsArrayByTitle(), getMDALiteSupervisorsArrayByStatus()], + (supervisor1, supervisor2) => intersect([supervisor1, supervisor2], JSON.stringify) + ); +}; From 7160355a73f0f5f134347063a7397f001872002c Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Fri, 12 Mar 2021 17:39:27 +0300 Subject: [PATCH 16/40] Connect MDA-Lite CDD report component with store --- .../pages/MDALite/cddReports/cdds.tsx | 124 ++++++++++++++++-- src/store/ducks/superset/MDALite/cdd.ts | 44 +++++-- .../ducks/superset/MDALite/supervisors.ts | 6 +- 3 files changed, 151 insertions(+), 23 deletions(-) diff --git a/src/containers/pages/MDALite/cddReports/cdds.tsx b/src/containers/pages/MDALite/cddReports/cdds.tsx index 1e0738b0ae..5b631f0980 100644 --- a/src/containers/pages/MDALite/cddReports/cdds.tsx +++ b/src/containers/pages/MDALite/cddReports/cdds.tsx @@ -1,12 +1,16 @@ import { DrillDownTable } from '@onaio/drill-down-table/dist/types'; +import superset from '@onaio/superset-connector'; import React, { useEffect, useState } from 'react'; import Helmet from 'react-helmet'; +import { connect } from 'react-redux'; import { RouteComponentProps } from 'react-router-dom'; import { Col, Row } from 'reactstrap'; +import { Store } from 'redux'; import IRSIndicatorLegend from '../../../../components/formatting/IRSIndicatorLegend'; import HeaderBreadcrumb from '../../../../components/page/HeaderBreadcrumb/HeaderBreadcrumb'; import Loading from '../../../../components/page/Loading'; import { + SUPERSET_MAX_RECORDS, SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE, SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES, SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE, @@ -20,18 +24,52 @@ import { import { displayError } from '../../../../helpers/errors'; import { RouteParams } from '../../../../helpers/utils'; import supersetFetch from '../../../../services/superset'; -import { GenericJurisdiction } from '../../../../store/ducks/generic/jurisdictions'; +import { + fetchGenericJurisdictions, + GenericJurisdiction, + getGenericJurisdictionById, +} from '../../../../store/ducks/generic/jurisdictions'; +import { + fetchMDALiteCDDs, + makeMDALiteCDDsArraySelector, + MDALiteCDDData, + MDALiteCDDFilters, +} from '../../../../store/ducks/superset/MDALite/cdd'; +import { + fetchMDALiteSupervisors, + makeMDALiteSupervisorsArraySelector, + MDALiteSupervisor, + MDALiteSupervisorFilters, +} from '../../../../store/ducks/superset/MDALite/supervisors'; import { cddReportColumns, getCddTableProps } from './helpers'; +/** declear selectors */ +const CDDsArraySelector = makeMDALiteCDDsArraySelector(); +const supervisorsArraySelector = makeMDALiteSupervisorsArraySelector(); +/** MDA Lite CDD report props */ interface MDALiteCddReportsProps { - cddData: any[]; + cddData: MDALiteCDDData[]; + fetchCDDs: typeof fetchMDALiteCDDs; + fetchJurisdictions: typeof fetchGenericJurisdictions; + fetchSupervisors: typeof fetchMDALiteSupervisors; service: typeof supersetFetch; - supervisorData: any[]; + slices: string[]; + supervisorData: MDALiteSupervisor[]; wardData: GenericJurisdiction[]; } +/** Component for displaying MDA Lite CDD Reports */ const MDALiteCddReports = (props: MDALiteCddReportsProps & RouteComponentProps) => { - const { cddData, supervisorData, wardData, service } = props; + const { + cddData, + supervisorData, + wardData, + service, + slices, + fetchCDDs, + fetchJurisdictions, + fetchSupervisors, + } = props; const [loading, setLoading] = useState(false); @@ -42,15 +80,30 @@ const MDALiteCddReports = (props: MDALiteCddReportsProps & RouteComponentProps fetchSupervisors(res)); } if (planId && jurisdictionId && wardData.length) { - const slices = SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES.split(','); - await service(slices[0]); + const fetchWardParams = superset.getFormData(SUPERSET_MAX_RECORDS, [ + { comparator: jurisdictionId, operator: '==', subject: 'jurisdiction_id' }, + { comparator: planId, operator: '==', subject: 'plan_id' }, + ]); + await service(slices[0], fetchWardParams).then(res => fetchJurisdictions(slices[0], res)); } - if (planId && jurisdictionId && supervisorId) { - await service(SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE); + if (jurisdictionId && supervisorId) { + const fetchCDDParams = superset.getFormData(SUPERSET_MAX_RECORDS, [ + { comparator: jurisdictionId, operator: '==', subject: 'ward_id' }, + { comparator: supervisorId, operator: '==', subject: 'supervisor_id' }, + ]); + await service(SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE, fetchCDDParams).then(res => + fetchCDDs(res) + ); } } catch (e) { displayError(e); @@ -112,7 +165,11 @@ const MDALiteCddReports = (props: MDALiteCddReportsProps & RouteComponentProps; + +/** map state to props */ +const mapStateToProps = ( + state: Partial, + ownProps: RouteComponentProps +): DispatchedStateProps => { + const { params } = ownProps.match; + const { planId, jurisdictionId, supervisorId } = params; + const cddFilters: MDALiteCDDFilters = { + supervisor_id: supervisorId, + ward_id: jurisdictionId, + }; + const supervisorFilters: MDALiteSupervisorFilters = { + ward_id: jurisdictionId, + }; + const cddData = CDDsArraySelector(state, cddFilters); + const supervisorData = supervisorsArraySelector(state, supervisorFilters); + const wardData: GenericJurisdiction[] = []; + if (jurisdictionId) { + defaultProps.slices.forEach((slice: string) => { + const jur = getGenericJurisdictionById(state, slice, jurisdictionId); + if (jur && jur.plan_id === planId) { + wardData.push(jur); + } + }); + } + return { + cddData, + supervisorData, + wardData, + }; +}; + +/** Connected MDALiteCddReports component */ +const ConnectedMDALiteCddReports = connect(mapStateToProps, mapDispatchToProps)(MDALiteCddReports); + +export default ConnectedMDALiteCddReports; diff --git a/src/store/ducks/superset/MDALite/cdd.ts b/src/store/ducks/superset/MDALite/cdd.ts index 39496eea5d..293768005b 100644 --- a/src/store/ducks/superset/MDALite/cdd.ts +++ b/src/store/ducks/superset/MDALite/cdd.ts @@ -38,31 +38,32 @@ export interface MDALiteDrugsReportInterface { } /** MDALiteCdds interface */ -export interface MDALiteCDDInterface extends MDALiteGenderInterface, MDALiteDrugsReportInterface { +export interface MDALiteCDDData extends MDALiteGenderInterface, MDALiteDrugsReportInterface { average_per_day: number; cdd_name: string; days_worked: number; id: string; supervisor_id: string; supervisor_name: string; + ward_id: string; } /** MDA-Lite CDD Reducer */ -const reducer = reducerFactory(reducerName); +const reducer = reducerFactory(reducerName); export default reducer; // actions /** actionCreator returns action to to add Item records to store */ -export const fetchMDALiteCDDs = fetchActionCreatorFactory(reducerName, 'id'); +export const fetchMDALiteCDDs = fetchActionCreatorFactory(reducerName, 'id'); /** actionCreator returns action to to remove Item records to store */ export const removeMDALiteCDDs = removeActionCreatorFactory(reducerName); // selectors /** get one CDD using their id */ -export const getMDALiteCDDById = getItemByIdFactory(reducerName); +export const getMDALiteCDDById = getItemByIdFactory(reducerName); /** get all CDDS by ids */ -export const getMDALiteCDDsArray = getItemsByIdFactory(reducerName); +export const getMDALiteCDDsArray = getItemsByIdFactory(reducerName); /** RESELECT USAGE STARTS HERE */ @@ -70,12 +71,13 @@ export const getMDALiteCDDsArray = getItemsByIdFactory(redu export interface MDALiteCDDFilters { cdd_name?: string /** CDD name */; supervisor_id?: string /** supervisor id */; + ward_id?: string /** ward id */; } /** MDALiteCDDsArrayBaseSelector select an array of all CDDs * @param state - the redux store */ -export const MDALiteCDDsArrayBaseSelector = (state: Partial): MDALiteCDDInterface[] => +export const MDALiteCDDsArrayBaseSelector = (state: Partial): MDALiteCDDData[] => values(getMDALiteCDDsArray(state) || {}); /** @@ -92,12 +94,19 @@ export const getName = (_: Partial, props: MDALiteCDDFilters) => props.cd */ export const getSupervisorId = (_: Partial, props: MDALiteCDDFilters) => props.supervisor_id; +/** + * Gets ward id from filters + * @param state - the redux store + * @param props - the cdd filters object + */ +export const getWardId = (_: Partial, props: MDALiteCDDFilters) => props.ward_id; + /** * Gets an array of CDDs filtered by name * @param {Partial} state - the redux store * @param {MDALiteCDDFilters} props - the CDDs filters object */ -export const getMDALiteCDDsArrayByTitle = () => +export const getMDALiteCDDsArrayByName = () => createSelector([MDALiteCDDsArrayBaseSelector, getName], (cdds, cddName) => cddName ? cdds.filter(cdd => cdd.cdd_name.toLowerCase().includes(cddName.toLowerCase())) : cdds ); @@ -107,16 +116,27 @@ export const getMDALiteCDDsArrayByTitle = () => * @param {Partial} state - the redux store * @param {MDALiteCDDFilters} props - the CDDs filters object */ -export const getMDALiteCDDsArrayByStatus = () => +export const getMDALiteCDDsArrayBySupervisorId = () => createSelector([MDALiteCDDsArrayBaseSelector, getSupervisorId], (cdds, supervisorId) => supervisorId ? cdds.filter(cdd => supervisorId === cdd.supervisor_id) : cdds ); +/** + * Gets an array of CDDs objects filtered by ward id + * @param {Partial} state - the redux store + * @param {MDALiteCDDFilters} props - the CDDs filters object + */ +export const getMDALiteCDDsArrayByWardId = () => + createSelector([MDALiteCDDsArrayBaseSelector, getWardId], (cdds, wardId) => + wardId ? cdds.filter(cdd => wardId === cdd.ward_id) : cdds + ); + /** * Returns a selector that gets an array of CDDs objects filtered by one or all * of the following: * - cdd_name * - supervisor_id + * - ward_id * * These filter params are all optional and are supplied via the prop parameter. * @@ -130,7 +150,11 @@ export const getMDALiteCDDsArrayByStatus = () => */ export const makeMDALiteCDDsArraySelector = () => { return createSelector( - [getMDALiteCDDsArrayByTitle(), getMDALiteCDDsArrayByStatus()], - (cdd1, cdd2) => intersect([cdd1, cdd2], JSON.stringify) + [ + getMDALiteCDDsArrayByName(), + getMDALiteCDDsArrayBySupervisorId(), + getMDALiteCDDsArrayByWardId(), + ], + (cdd1, cdd2, cdd3) => intersect([cdd1, cdd2, cdd3], JSON.stringify) ); }; diff --git a/src/store/ducks/superset/MDALite/supervisors.ts b/src/store/ducks/superset/MDALite/supervisors.ts index 9aec434985..263c83ae4e 100644 --- a/src/store/ducks/superset/MDALite/supervisors.ts +++ b/src/store/ducks/superset/MDALite/supervisors.ts @@ -74,7 +74,7 @@ export const getWardId = (_: Partial, props: MDALiteSupervisorFilters) => * @param {Partial} state - the redux store * @param {MDALiteSupervisorFilters} props - the Supervisors filters object */ -export const getMDALiteSupervisorsArrayByTitle = () => +export const getMDALiteSupervisorsArrayByName = () => createSelector([MDALiteSupervisorsArrayBaseSelector, getName], (Supervisors, supervisorName) => supervisorName ? Supervisors.filter(supervisor => @@ -88,7 +88,7 @@ export const getMDALiteSupervisorsArrayByTitle = () => * @param {Partial} state - the redux store * @param {MDALiteSupervisorFilters} props - the Supervisors filters object */ -export const getMDALiteSupervisorsArrayByStatus = () => +export const getMDALiteSupervisorsArrayByWardId = () => createSelector([MDALiteSupervisorsArrayBaseSelector, getWardId], (Supervisors, wardId) => wardId ? Supervisors.filter(supervisor => wardId === supervisor.ward_id) : Supervisors ); @@ -111,7 +111,7 @@ export const getMDALiteSupervisorsArrayByStatus = () => */ export const makeMDALiteSupervisorsArraySelector = () => { return createSelector( - [getMDALiteSupervisorsArrayByTitle(), getMDALiteSupervisorsArrayByStatus()], + [getMDALiteSupervisorsArrayByName(), getMDALiteSupervisorsArrayByWardId()], (supervisor1, supervisor2) => intersect([supervisor1, supervisor2], JSON.stringify) ); }; From 00cedc8461276572701271ae103be878285e7ac0 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Fri, 12 Mar 2021 17:57:51 +0300 Subject: [PATCH 17/40] MDA-Lite connect Supervisor reports component to store --- .../pages/MDALite/cddReports/cdds.tsx | 9 +- .../pages/MDALite/cddReports/supervisors.tsx | 96 +++++++++++++++++-- 2 files changed, 91 insertions(+), 14 deletions(-) diff --git a/src/containers/pages/MDALite/cddReports/cdds.tsx b/src/containers/pages/MDALite/cddReports/cdds.tsx index 5b631f0980..fff994f00e 100644 --- a/src/containers/pages/MDALite/cddReports/cdds.tsx +++ b/src/containers/pages/MDALite/cddReports/cdds.tsx @@ -16,11 +16,7 @@ import { SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE, } from '../../../../configs/env'; import { HOME, MDA_LITE_REPORTING_TITLE } from '../../../../configs/lang'; -import { - HOME_URL, - REPORT_MDA_LITE_CDD_REPORT_URL, - REPORT_MDA_LITE_PLAN_URL, -} from '../../../../constants'; +import { HOME_URL, REPORT_MDA_LITE_CDD_REPORT_URL } from '../../../../constants'; import { displayError } from '../../../../helpers/errors'; import { RouteParams } from '../../../../helpers/utils'; import supersetFetch from '../../../../services/superset'; @@ -46,6 +42,7 @@ import { cddReportColumns, getCddTableProps } from './helpers'; /** declear selectors */ const CDDsArraySelector = makeMDALiteCDDsArraySelector(); const supervisorsArraySelector = makeMDALiteSupervisorsArraySelector(); + /** MDA Lite CDD report props */ interface MDALiteCddReportsProps { cddData: MDALiteCDDData[]; @@ -129,7 +126,7 @@ const MDALiteCddReports = (props: MDALiteCddReportsProps & RouteComponentProps ) => { - const { supervisorData, wardData, service } = props; + const { supervisorData, wardData, service, slices, fetchJurisdictions, fetchSupervisors } = props; const [loading, setLoading] = useState(false); @@ -38,12 +63,21 @@ const MDALiteSupervisorReports = ( async function loadData() { setLoading(supervisorData.length < 1); try { - if (planId && jurisdictionId) { - await service(SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE); + if (jurisdictionId && !supervisorData.length) { + const fetchSupervisorParams = superset.getFormData(SUPERSET_MAX_RECORDS, [ + { comparator: jurisdictionId, operator: '==', subject: 'ward_id' }, + ]); + await service( + SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE, + fetchSupervisorParams + ).then(res => fetchSupervisors(res)); } if (planId && jurisdictionId && wardData.length) { - const slices = SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES.split(','); - await service(slices[0]); + const fetchWardParams = superset.getFormData(SUPERSET_MAX_RECORDS, [ + { comparator: jurisdictionId, operator: '==', subject: 'jurisdiction_id' }, + { comparator: planId, operator: '==', subject: 'plan_id' }, + ]); + await service(slices[0], fetchWardParams).then(res => fetchJurisdictions(slices[0], res)); } } catch (e) { displayError(e); @@ -58,7 +92,7 @@ const MDALiteSupervisorReports = ( const currentPage = { label: wardName, - url: `${REPORT_MDA_LITE_PLAN_URL}/${planId}/${wardData[0].jurisdiction_parent_id}`, + url: `${REPORT_MDA_LITE_CDD_REPORT_URL}/${planId}/${wardData[0].jurisdiction_id}`, }; const breadcrumbProps = { currentPage, @@ -105,7 +139,10 @@ const MDALiteSupervisorReports = ( /** default props */ const defaultProps: MDALiteSupervisorReportsProps = { + fetchJurisdictions: fetchGenericJurisdictions, + fetchSupervisors: fetchMDALiteSupervisors, service: supersetFetch, + slices: SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES.split(','), supervisorData: [], wardData: [], }; @@ -113,3 +150,46 @@ const defaultProps: MDALiteSupervisorReportsProps = { MDALiteSupervisorReports.defaultProps = defaultProps; export { MDALiteSupervisorReports }; + +/** map dispatch to props */ +const mapDispatchToProps = { + fetchJurisdictions: fetchGenericJurisdictions, + fetchSupervisors: fetchMDALiteSupervisors, +}; + +/** Dispatched State Props */ +type DispatchedStateProps = Pick; + +/** map state to props */ +const mapStateToProps = ( + state: Partial, + ownProps: RouteComponentProps +): DispatchedStateProps => { + const { params } = ownProps.match; + const { planId, jurisdictionId } = params; + const supervisorFilters: MDALiteSupervisorFilters = { + ward_id: jurisdictionId, + }; + const supervisorData = supervisorsArraySelector(state, supervisorFilters); + const wardData: GenericJurisdiction[] = []; + if (jurisdictionId) { + defaultProps.slices.forEach((slice: string) => { + const jur = getGenericJurisdictionById(state, slice, jurisdictionId); + if (jur && jur.plan_id === planId) { + wardData.push(jur); + } + }); + } + return { + supervisorData, + wardData, + }; +}; + +/** Connected MDALiteCddReports component */ +const ConnectedMDALiteCddReports = connect( + mapStateToProps, + mapDispatchToProps +)(MDALiteSupervisorReports); + +export default ConnectedMDALiteCddReports; From 89d207e4a6663698227c9b3342f86e9ca109005f Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Fri, 12 Mar 2021 18:51:13 +0300 Subject: [PATCH 18/40] Clean up and create links for CDD and supervisor views --- src/App/App.tsx | 17 +++++++++++ .../pages/MDALite/cddReports/cdds.tsx | 23 +++++++++----- .../pages/MDALite/cddReports/helpers.tsx | 13 ++++++-- .../pages/MDALite/cddReports/supervisors.tsx | 30 ++++++++++++------- 4 files changed, 62 insertions(+), 21 deletions(-) diff --git a/src/App/App.tsx b/src/App/App.tsx index a733b67f3f..125ee3552e 100644 --- a/src/App/App.tsx +++ b/src/App/App.tsx @@ -82,6 +82,7 @@ import { REACT_LOGIN_URL, REPORT_IRS_LITE_PLAN_URL, REPORT_IRS_PLAN_URL, + REPORT_MDA_LITE_CDD_REPORT_URL, REPORT_MDA_LITE_PLAN_URL, REPORT_MDA_PLAN_URL, REPORT_MDA_POINT_PLAN_URL, @@ -124,6 +125,8 @@ import ConnectedAutoSelectView from '../containers/pages/JurisdictionAssignment/ import { ConnectedEntryView } from '../containers/pages/JurisdictionAssignment/EntryView'; import ConnectedJurisdictionAssignmentView from '../containers/pages/JurisdictionAssignment/ManualSelectJurisdiction'; import JurisdictionMetadata from '../containers/pages/JurisdictionMetadata'; +import ConnectedMDALiteCddReports from '../containers/pages/MDALite/cddReports/cdds'; +import ConnectedMDALiteSupervisorReports from '../containers/pages/MDALite/cddReports/supervisors'; import ConnectedMdaLiteJurisdictionReport from '../containers/pages/MDALite/jurisdictionsReport'; import ConnectedMDALitePlansList from '../containers/pages/MDALite/plans'; import ConnectedChildReports from '../containers/pages/MDAPoint/ChildReports'; @@ -306,6 +309,20 @@ const App = () => { path={`${REPORT_MDA_LITE_PLAN_URL}/:planId/:jurisdictionId`} component={ConnectedMdaLiteJurisdictionReport} /> + + {/* IRS Reporting plan table view */} ; diff --git a/src/containers/pages/MDALite/cddReports/helpers.tsx b/src/containers/pages/MDALite/cddReports/helpers.tsx index 5a6cffd154..8ad6541e22 100644 --- a/src/containers/pages/MDALite/cddReports/helpers.tsx +++ b/src/containers/pages/MDALite/cddReports/helpers.tsx @@ -1,4 +1,6 @@ +import { Dictionary } from '@onaio/utils/dist/types/types'; import React from 'react'; +import { RouteComponentProps } from 'react-router'; import { Cell } from 'react-table'; import { defaultOptions, @@ -45,14 +47,18 @@ type ColumnsType = typeof supervisorColumns | typeof cddReportColumns; /** * gets MDA_lite cdd and supervisor drill down table props * @param {ColumnsType} columns - table columns - * @param {any} data - table data + * @param {Dictionary[]} data - table data */ -export const getCddTableProps = (columns: ColumnsType, data: any) => { +export const getCddTableProps = ( + columns: ColumnsType, + data: Dictionary[], + props: RouteComponentProps +) => { return { columns, data: data || [], identifierField: 'id', - paginate: false, + paginate: true, renderInBottomFilterBar: renderInFilterFactory({ showColumnHider: false, showFilters: false, @@ -62,6 +68,7 @@ export const getCddTableProps = (columns: ColumnsType, data: any) => { }), renderInTopFilterBar: renderInFilterFactory({ ...defaultOptions, + componentProps: props, queryParam: QUERY_PARAM_TITLE, }), renderNullDataComponent: () => , diff --git a/src/containers/pages/MDALite/cddReports/supervisors.tsx b/src/containers/pages/MDALite/cddReports/supervisors.tsx index 1d8b9f3fc8..6a506160e2 100644 --- a/src/containers/pages/MDALite/cddReports/supervisors.tsx +++ b/src/containers/pages/MDALite/cddReports/supervisors.tsx @@ -1,4 +1,5 @@ -import { DrillDownTable } from '@onaio/drill-down-table/dist/types'; +import { DrillDownTable } from '@onaio/drill-down-table'; +import reducerRegistry from '@onaio/redux-reducer-registry'; import superset from '@onaio/superset-connector'; import React, { useEffect, useState } from 'react'; import Helmet from 'react-helmet'; @@ -23,18 +24,25 @@ import { import { displayError } from '../../../../helpers/errors'; import { RouteParams } from '../../../../helpers/utils'; import supersetFetch from '../../../../services/superset'; -import { +import GenericJurisdictionsReducer, { fetchGenericJurisdictions, GenericJurisdiction, getGenericJurisdictionById, + reducerName as genericJurisdictionsReducerName, } from '../../../../store/ducks/generic/jurisdictions'; -import { +import supervisorReducer, { fetchMDALiteSupervisors, makeMDALiteSupervisorsArraySelector, + MDALiteSupervisor, MDALiteSupervisorFilters, + reducerName as supervisorReducerName, } from '../../../../store/ducks/superset/MDALite/supervisors'; import { getCddTableProps, supervisorColumns } from './helpers'; +/** register the reducers */ +reducerRegistry.register(genericJurisdictionsReducerName, GenericJurisdictionsReducer); +reducerRegistry.register(supervisorReducerName, supervisorReducer); + /** declear selectors */ const supervisorsArraySelector = makeMDALiteSupervisorsArraySelector(); @@ -44,7 +52,7 @@ interface MDALiteSupervisorReportsProps { fetchSupervisors: typeof fetchMDALiteSupervisors; service: typeof supersetFetch; slices: string[]; - supervisorData: any[]; + supervisorData: MDALiteSupervisor[]; wardData: GenericJurisdiction[]; } @@ -58,7 +66,7 @@ const MDALiteSupervisorReports = ( const { params } = props.match; const { planId, jurisdictionId, supervisorId } = params; - const wardName = wardData[0].jurisdiction_name; + const wardName = wardData[0]?.jurisdiction_name; async function loadData() { setLoading(supervisorData.length < 1); @@ -92,7 +100,7 @@ const MDALiteSupervisorReports = ( const currentPage = { label: wardName, - url: `${REPORT_MDA_LITE_CDD_REPORT_URL}/${planId}/${wardData[0].jurisdiction_id}`, + url: `${REPORT_MDA_LITE_CDD_REPORT_URL}/${planId}/${wardData[0]?.jurisdiction_id}`, }; const breadcrumbProps = { currentPage, @@ -103,8 +111,8 @@ const MDALiteSupervisorReports = ( }, // change to subcounty name { - label: wardData[0].jurisdiction_name, - url: `${REPORT_MDA_LITE_PLAN_URL}/${planId}/${wardData[0].jurisdiction_parent_id}`, + label: wardData[0]?.jurisdiction_name, + url: `${REPORT_MDA_LITE_PLAN_URL}/${planId}/${wardData[0]?.jurisdiction_parent_id}`, }, ], }; @@ -113,7 +121,7 @@ const MDALiteSupervisorReports = ( : MDA_LITE_REPORTING_TITLE; // table props - const tableProps = getCddTableProps(supervisorColumns, supervisorData); + const tableProps = getCddTableProps(supervisorColumns, supervisorData, props); if (loading) { return ; @@ -187,9 +195,9 @@ const mapStateToProps = ( }; /** Connected MDALiteCddReports component */ -const ConnectedMDALiteCddReports = connect( +const ConnectedMDALiteSupervisorReports = connect( mapStateToProps, mapDispatchToProps )(MDALiteSupervisorReports); -export default ConnectedMDALiteCddReports; +export default ConnectedMDALiteSupervisorReports; From 43c6652877888876c89bd56f263b4b12c9b1e090 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Mon, 15 Mar 2021 12:39:51 +0300 Subject: [PATCH 19/40] Fix tests failling after add MDA-lite Reports --- src/App/tests/AppNoBackend.test.tsx | 1 + src/configs/__mocks__/env.ts | 1 + .../pages/GenericJurisdictionReport/tests/helpers.test.ts | 2 ++ 3 files changed, 4 insertions(+) diff --git a/src/App/tests/AppNoBackend.test.tsx b/src/App/tests/AppNoBackend.test.tsx index 90a17523f0..4e0505dc7c 100644 --- a/src/App/tests/AppNoBackend.test.tsx +++ b/src/App/tests/AppNoBackend.test.tsx @@ -18,6 +18,7 @@ jest.mock('../../configs/env', () => ({ SUPERSET_IRS_LITE_REPORTING_JURISDICTIONS_DATA_SLICES: '11, 12', SUPERSET_IRS_MOPUP_REPORTING_JURISDICTIONS_DATA_SLICES: '0', SUPERSET_IRS_REPORTING_JURISDICTIONS_DATA_SLICES: '11, 12', + SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES: '1', SUPERSET_MDA_POINT_REPORTING_JURISDICTIONS_DATA_SLICES: '12', SUPERSET_SMC_REPORTING_JURISDICTIONS_DATA_SLICES: '1', })); diff --git a/src/configs/__mocks__/env.ts b/src/configs/__mocks__/env.ts index 6cefa47fea..d318890941 100644 --- a/src/configs/__mocks__/env.ts +++ b/src/configs/__mocks__/env.ts @@ -228,3 +228,4 @@ export const SUPERSET_SMC_REPORTING_INDICATOR_STOPS = 'nigeria2020'; export const CHECK_SESSION_EXPIRY_STATUS = false; export const OPENSRP_GENERATED_TASKS_INTERVENTIONS = []; +export const SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES = '1'; diff --git a/src/containers/pages/GenericJurisdictionReport/tests/helpers.test.ts b/src/containers/pages/GenericJurisdictionReport/tests/helpers.test.ts index 967773244b..b1e09eb701 100644 --- a/src/containers/pages/GenericJurisdictionReport/tests/helpers.test.ts +++ b/src/containers/pages/GenericJurisdictionReport/tests/helpers.test.ts @@ -27,6 +27,8 @@ describe('containers/pages/IRS/JurisdictionsReport/helpers', () => { 'irsLiteZambiaFocusArea2020', 'irsLiteZambiaJurisdictions2020', 'mdaJurisdictionsColumns', + 'mdaLiteJurisdictionsColumns', + 'mdaLitewardColumns', 'namibia2019', 'smcJurisdictionsColumns', 'zambiaFocusArea2019', From 33b6d6db05f75f5d6cf170cdac1f706e35aea1a8 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Mon, 15 Mar 2021 15:46:44 +0300 Subject: [PATCH 20/40] Add MDA-Lite plans tests --- src/configs/__mocks__/env.ts | 1 + .../tests/__snapshots__/index.test.tsx.snap | 118 ++++++++++++++++++ .../pages/MDALite/plans/tests/index.test.tsx | 116 +++++++++++++++++ .../ducks/superset/MDALite/tests/fixtures.ts | 36 ++++++ 4 files changed, 271 insertions(+) create mode 100644 src/containers/pages/MDALite/plans/tests/__snapshots__/index.test.tsx.snap create mode 100644 src/containers/pages/MDALite/plans/tests/index.test.tsx create mode 100644 src/store/ducks/superset/MDALite/tests/fixtures.ts diff --git a/src/configs/__mocks__/env.ts b/src/configs/__mocks__/env.ts index d318890941..99a57c7af0 100644 --- a/src/configs/__mocks__/env.ts +++ b/src/configs/__mocks__/env.ts @@ -229,3 +229,4 @@ export const CHECK_SESSION_EXPIRY_STATUS = false; export const OPENSRP_GENERATED_TASKS_INTERVENTIONS = []; export const SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES = '1'; +export const SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE = '1'; diff --git a/src/containers/pages/MDALite/plans/tests/__snapshots__/index.test.tsx.snap b/src/containers/pages/MDALite/plans/tests/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..e7d1f47a20 --- /dev/null +++ b/src/containers/pages/MDALite/plans/tests/__snapshots__/index.test.tsx.snap @@ -0,0 +1,118 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`components/MDALiteReports/MDALitePlansList handles search correctly: search results props 1`] = ` +Array [ + Object { + "jurisdiction_root_parent_ids": "[\\"bac41d87-b09d-4e76-be3b-3b6d07399891\\"]", + "plan_date": 1610064000000, + "plan_effective_period_end": 1640822400000, + "plan_effective_period_start": 1610064000000, + "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada", + "plan_intervention_type": "MDA-Lite", + "plan_name": "MDA-Lite-2021-01-08", + "plan_status": "active", + "plan_title": "MDA-Lite kenya 2021-01-08", + }, +] +`; + +exports[`components/MDALiteReports/MDALitePlansList renders plan definition list correctly: GenericPlansList props 1`] = ` +Object { + "fetchPlans": [Function], + "history": Object { + "action": "POP", + "block": [Function], + "createHref": [Function], + "go": [Function], + "goBack": [Function], + "goForward": [Function], + "length": 1, + "listen": [Function], + "location": Object { + "hash": "", + "pathname": "/", + "search": "", + "state": undefined, + }, + "push": [Function], + "replace": [Function], + }, + "location": Object { + "hash": "", + "pathname": "/intervention/mda-lite/report", + "search": "", + "state": undefined, + }, + "match": Object { + "isExact": true, + "params": Object {}, + "path": "/intervention/mda-lite/report/", + "url": "/intervention/mda-lite/report/", + }, + "pageTitle": "MDA Lite Plans", + "pageUrl": "/intervention/mda-lite/report", + "plans": Array [ + Object { + "jurisdiction_root_parent_ids": "[\\"bac41d87-b09d-4e76-be3b-3b6d07399891\\"]", + "plan_date": 1614643200000, + "plan_effective_period_end": 1616371200000, + "plan_effective_period_start": 1614643200000, + "plan_id": "5e396185-6094-4817-9dd4-24bcbbc698b0", + "plan_intervention_type": "MDA-Lite", + "plan_name": "MDA-Lite-2021-03-02", + "plan_status": "active", + "plan_title": "MDA-Lite 2021-03-02", + }, + Object { + "jurisdiction_root_parent_ids": "[\\"bac41d87-b09d-4e76-be3b-3b6d07399891\\"]", + "plan_date": 1610064000000, + "plan_effective_period_end": 1640822400000, + "plan_effective_period_start": 1610064000000, + "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada", + "plan_intervention_type": "MDA-Lite", + "plan_name": "MDA-Lite-2021-01-08", + "plan_status": "active", + "plan_title": "MDA-Lite kenya 2021-01-08", + }, + Object { + "jurisdiction_root_parent_ids": "[\\"bac41d87-b09d-4e76-be3b-3b6d07399891\\"]", + "plan_date": 1613520000000, + "plan_effective_period_end": 1615248000000, + "plan_effective_period_start": 1613520000000, + "plan_id": "bbaf9674-e381-45f1-94d1-23bd373bc88e", + "plan_intervention_type": "MDA-Lite", + "plan_name": "MDA-Lite-2021-02-17", + "plan_status": "active", + "plan_title": "MDA-Lite Em test3 2021-02-17", + }, + ], + "service": [MockFunction] { + "calls": Array [ + Array [ + "1", + ], + ], + "results": Array [ + Object { + "type": "return", + "value": Promise {}, + }, + ], + }, + "supersetReportingSlice": "1", +} +`; + +exports[`components/MDALiteReports/MDALitePlansList renders plan definition list correctly: breadcrumb item-1 1`] = `"Home"`; + +exports[`components/MDALiteReports/MDALitePlansList renders plan definition list correctly: breadcrumb item-2 1`] = `"MDA Lite Plans"`; + +exports[`components/MDALiteReports/MDALitePlansList renders plan definition list correctly: table header-1 1`] = `"Title"`; + +exports[`components/MDALiteReports/MDALitePlansList renders plan definition list correctly: table header-2 1`] = `"Date Created"`; + +exports[`components/MDALiteReports/MDALitePlansList renders plan definition list correctly: table header-3 1`] = `"Start Date"`; + +exports[`components/MDALiteReports/MDALitePlansList renders plan definition list correctly: table header-4 1`] = `"End Date"`; + +exports[`components/MDALiteReports/MDALitePlansList renders plan definition list correctly: table header-5 1`] = `"Status"`; diff --git a/src/containers/pages/MDALite/plans/tests/index.test.tsx b/src/containers/pages/MDALite/plans/tests/index.test.tsx new file mode 100644 index 0000000000..a298284a45 --- /dev/null +++ b/src/containers/pages/MDALite/plans/tests/index.test.tsx @@ -0,0 +1,116 @@ +import { mount, shallow } from 'enzyme'; +import flushPromises from 'flush-promises'; +import { createBrowserHistory } from 'history'; +import React from 'react'; +import { act } from 'react-dom/test-utils'; +import { Provider } from 'react-redux'; +import { Router } from 'react-router'; +import { REPORT_MDA_LITE_PLAN_URL } from '../../../../../constants'; +import store from '../../../../../store'; +import { MDALitePlans } from '../../../../../store/ducks/superset/MDALite/tests/fixtures'; +import ConnectedMDALitePlansList, { MDALitePlansList } from '../index'; + +jest.mock('../../../../../configs/env'); + +const history = createBrowserHistory(); + +const props = { + history, + location: { + hash: '', + pathname: REPORT_MDA_LITE_PLAN_URL, + search: '', + state: undefined, + }, + match: { + isExact: true, + params: {}, + path: `${REPORT_MDA_LITE_PLAN_URL}/`, + url: `${REPORT_MDA_LITE_PLAN_URL}/`, + }, +}; + +describe('components/MDALiteReports/MDALitePlansList', () => { + beforeEach(() => { + jest.resetAllMocks(); + }); + + it('renders without crashing', () => { + shallow( + + + + ); + }); + + it('renders plan definition list correctly', async () => { + const service = jest.fn().mockImplementationOnce(() => Promise.resolve(MDALitePlans)); + const wrapper = mount( + + + + + + ); + await act(async () => { + await flushPromises(); + }); + wrapper.update(); + + expect(wrapper.find('h3.page-title').text()).toEqual('MDA Lite Plans'); + wrapper + .find('BreadcrumbItem li') + .forEach((item, i) => expect(item.text()).toMatchSnapshot(`breadcrumb item-${i + 1}`)); + wrapper.find('.thead .tr .th').forEach((item, i) => { + expect(item.text()).toMatchSnapshot(`table header-${i + 1}`); + }); + expect(wrapper.find('.tbody .tr').length).toEqual(3); + // have searchbar + expect(wrapper.find('.search-input-wrapper').length).toEqual(1); + // have top and bottom pagination + expect(wrapper.find('.pagination').length).toEqual(2); + // have height and columns filters + expect( + wrapper + .find('.filter-bar-btns span') + .at(0) + .text() + ).toEqual('Row Height'); + expect( + wrapper + .find('.filter-bar-btns span') + .at(1) + .text() + ).toEqual('Customize Columns'); + + expect(wrapper.find('GenericPlansList').length).toBe(1); + expect(wrapper.find('GenericPlansList').props()).toMatchSnapshot('GenericPlansList props'); + + expect(wrapper.find('.page-title').text()).toEqual('MDA Lite Plans'); + + wrapper.unmount(); + }); + + it('handles search correctly', async () => { + const service = jest.fn().mockImplementationOnce(() => Promise.resolve(MDALitePlans)); + props.location.search = '?title=kenya'; + const wrapper = mount( + + + + + + ); + await act(async () => { + await flushPromises(); + }); + wrapper.update(); + + expect(wrapper.find('.tbody .tr').length).toEqual(1); + expect(wrapper.find('.tbody .tr .td a').text()).toEqual('MDA-Lite kenya 2021-01-08'); + + expect((wrapper.find('GenericPlansList').props() as any).plans).toMatchSnapshot( + 'search results props' + ); + }); +}); diff --git a/src/store/ducks/superset/MDALite/tests/fixtures.ts b/src/store/ducks/superset/MDALite/tests/fixtures.ts new file mode 100644 index 0000000000..329847cb34 --- /dev/null +++ b/src/store/ducks/superset/MDALite/tests/fixtures.ts @@ -0,0 +1,36 @@ +// tslint:disable: object-literal-sort-keys +export const MDALitePlans = [ + { + plan_id: '5e396185-6094-4817-9dd4-24bcbbc698b0', + jurisdiction_root_parent_ids: '["bac41d87-b09d-4e76-be3b-3b6d07399891"]', + plan_title: 'MDA-Lite 2021-03-02', + plan_name: 'MDA-Lite-2021-03-02', + plan_status: 'active', + plan_date: 1614643200000, + plan_effective_period_start: 1614643200000, + plan_effective_period_end: 1616371200000, + plan_intervention_type: 'MDA-Lite', + }, + { + plan_id: '6b485d4b-1043-40ed-ab8a-c64d24045ada', + jurisdiction_root_parent_ids: '["bac41d87-b09d-4e76-be3b-3b6d07399891"]', + plan_title: 'MDA-Lite kenya 2021-01-08', + plan_name: 'MDA-Lite-2021-01-08', + plan_status: 'active', + plan_date: 1610064000000, + plan_effective_period_start: 1610064000000, + plan_effective_period_end: 1640822400000, + plan_intervention_type: 'MDA-Lite', + }, + { + plan_id: 'bbaf9674-e381-45f1-94d1-23bd373bc88e', + jurisdiction_root_parent_ids: '["bac41d87-b09d-4e76-be3b-3b6d07399891"]', + plan_title: 'MDA-Lite Em test3 2021-02-17', + plan_name: 'MDA-Lite-2021-02-17', + plan_status: 'active', + plan_date: 1613520000000, + plan_effective_period_start: 1613520000000, + plan_effective_period_end: 1615248000000, + plan_intervention_type: 'MDA-Lite', + }, +]; From 6e12096afa27153585f1c168d39362cdb75b89ab Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Tue, 16 Mar 2021 14:26:35 +0300 Subject: [PATCH 21/40] Add MDA-Lite jurisdictions report fixtures --- .../jurisdictionsReport/tests/fixtures.ts | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 src/containers/pages/MDALite/jurisdictionsReport/tests/fixtures.ts diff --git a/src/containers/pages/MDALite/jurisdictionsReport/tests/fixtures.ts b/src/containers/pages/MDALite/jurisdictionsReport/tests/fixtures.ts new file mode 100644 index 0000000000..afad629234 --- /dev/null +++ b/src/containers/pages/MDALite/jurisdictionsReport/tests/fixtures.ts @@ -0,0 +1,117 @@ +// tslint:disable: object-literal-sort-keys +export const MDALiteJurReports = [ + { + id: '165b0ae7-92fa-5b70-a7bb-283797f565c2', + plan_id: '5e396185-6094-4817-9dd4-24bcbbc698b0', + jurisdiction_id: '25e8a10b-737c-44e7-bfff-3b6344b1126f', + jurisdiction_parent_id: '', + jurisdiction_name: 'Kenya', + jurisdiction_depth: 0, + jurisdiction_path: '[]', + jurisdiction_name_path: '[]', + treated_male_1_4: '200', + treated_male_5_14: 0, + treated_male_above_15: 0, + treated_female_1_4: 0, + treated_female_5_14: 0, + treated_female_above_15: 0, + total_males: 20, + total_females: 3, + total_all_genders: 20, + supervisor_distributed: 0, + received_number: 0, + adminstered: 0, + damaged: 0, + adverse: 0, + remaining_with_cdd: 10, + returned_to_supervisor: 3, + census_pop_target: 200, + treatment_coverage: 0.8, + other_pop_target: 500, + other_pop_coverage: 0.65, + }, + { + id: '89bb4010-38ee-5eac-b92a-4deafa62765a', + plan_id: '5e396185-6094-4817-9dd4-24bcbbc698b0', + jurisdiction_id: 'f2482d8c-e6ed-433b-860f-96c9cd09b4a3', + jurisdiction_parent_id: '38482d8c-e6ed-433b-860f-96c9cd09b4a3', + jurisdiction_name: 'emuhaya', + jurisdiction_depth: 2, + jurisdiction_path: + '["25e8a10b-737c-44e7-bfff-3b6344b1126f", "f2482d8c-e6ed-433b-860f-96c9cd09b4a3"]', + jurisdiction_name_path: '["Kenya", "Vihiga"]', + treated_male_1_4: 0, + treated_male_5_14: 0, + treated_male_above_15: 0, + treated_female_1_4: 0, + treated_female_5_14: 0, + treated_female_above_15: 0, + total_males: 19, + total_females: 100, + total_all_genders: 0, + supervisor_distributed: 0, + received_number: 0, + adminstered: 0, + damaged: 0, + adverse: 0, + remaining_with_cdd: 0, + returned_to_supervisor: 0, + census_pop_target: 300, + treatment_coverage: 0.9, + other_pop_target: 400, + other_pop_coverage: 0.6, + }, + { + id: '541e7ed0-2dc6-586e-b563-4c988c5ac585', + plan_id: '5e396185-6094-4817-9dd4-24bcbbc698b0', + jurisdiction_id: '3c63f48e-bb86-42e5-b3ff-bc539fbf5295', + jurisdiction_parent_id: '25e8a10b-737c-44e7-bfff-3b6344b1126f', + jurisdiction_name: 'vihiga', + jurisdiction_depth: 1, + jurisdiction_path: '["25e8a10b-737c-44e7-bfff-3b6344b1126f"]', + jurisdiction_name_path: '["Kenya"]', + treated_male_1_4: 0, + treated_male_5_14: 0, + treated_male_above_15: 0, + treated_female_1_4: 0, + treated_female_5_14: 0, + treated_female_above_15: 0, + total_males: 0, + total_females: 0, + total_all_genders: 0, + supervisor_distributed: 0, + received_number: 0, + adminstered: 0, + damaged: 0, + adverse: 0, + remaining_with_cdd: 0, + returned_to_supervisor: 0, + }, + { + id: 'c477af78-93ce-51f8-bf1e-0bae3a80fcae', + plan_id: '5e396185-6094-4817-9dd4-24bcbbc698b0', + jurisdiction_id: 'f2482d8c-e6ed-433b-860f-96c9cd09b4a3', + jurisdiction_parent_id: '3c63f48e-bb86-42e5-b3ff-bc539fbf5295', + jurisdiction_name: 'hamisi', + jurisdiction_depth: 2, + jurisdiction_path: + '["25e8a10b-737c-44e7-bfff-3b6344b1126f", "f2482d8c-e6ed-433b-860f-96c9cd09b4a3"]', + jurisdiction_name_path: '["Kenya", "Vihiga"]', + treated_male_1_4: 0, + treated_male_5_14: 0, + treated_male_above_15: 0, + treated_female_1_4: 0, + treated_female_5_14: 0, + treated_female_above_15: 0, + total_males: 0, + total_females: 0, + total_all_genders: 0, + supervisor_distributed: 0, + received_number: 0, + adminstered: 0, + damaged: 0, + adverse: 0, + remaining_with_cdd: 0, + returned_to_supervisor: 0, + }, +]; From 1aaae84f5c27421ba4c156b4fee15e5cdd8e0892 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Tue, 16 Mar 2021 19:20:58 +0300 Subject: [PATCH 22/40] Add MDA-Lite jurisdiction reports tests --- src/components/MDALiteCellTable/index.tsx | 19 +- src/configs/__mocks__/env.ts | 5 +- .../tests/__snapshots__/index.test.tsx.snap | 9 + .../jurisdictionsReport/tests/fixtures.ts | 8 +- .../jurisdictionsReport/tests/index.test.tsx | 162 ++++++++++++++++++ 5 files changed, 190 insertions(+), 13 deletions(-) create mode 100644 src/containers/pages/MDALite/jurisdictionsReport/tests/__snapshots__/index.test.tsx.snap create mode 100644 src/containers/pages/MDALite/jurisdictionsReport/tests/index.test.tsx diff --git a/src/components/MDALiteCellTable/index.tsx b/src/components/MDALiteCellTable/index.tsx index 11575b14cc..7e68e46bd9 100644 --- a/src/components/MDALiteCellTable/index.tsx +++ b/src/components/MDALiteCellTable/index.tsx @@ -3,6 +3,7 @@ import { DropDownCellProps } from '@onaio/drill-down-table'; import { Dictionary } from '@onaio/utils'; import React from 'react'; import { Link } from 'react-router-dom'; +import { Col, Row } from 'reactstrap'; import { SHOW_MAP_AT_JURISDICTION_LEVEL } from '../../configs/env'; import { MAP } from '../../constants'; @@ -17,18 +18,20 @@ export interface LinkedCellProps extends DropDownCellProps { const MDALiteTableCell: React.ElementType = (props: LinkedCellProps) => { const { cell, cellValue, hasChildren, urlPath } = props; const original: Dictionary = cell.row.original; - const { jurisdiction_id, plan_id, jurisdiction_depth } = original; - const url = `${urlPath}/${plan_id}/${jurisdiction_id}`; + const { jurisdiction_id, jurisdiction_depth } = original; + const url = `${urlPath}/${jurisdiction_id}`; const jurLink = {cellValue}; if (SHOW_MAP_AT_JURISDICTION_LEVEL === +jurisdiction_depth) { return (
- {jurLink} - - - - - + + {jurLink} + + + + + +
); } diff --git a/src/configs/__mocks__/env.ts b/src/configs/__mocks__/env.ts index 99a57c7af0..23cacbb455 100644 --- a/src/configs/__mocks__/env.ts +++ b/src/configs/__mocks__/env.ts @@ -228,5 +228,8 @@ export const SUPERSET_SMC_REPORTING_INDICATOR_STOPS = 'nigeria2020'; export const CHECK_SESSION_EXPIRY_STATUS = false; export const OPENSRP_GENERATED_TASKS_INTERVENTIONS = []; -export const SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES = '1'; +export const SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES = '1,2'; export const SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE = '1'; + +export const SUPERSET_MDA_LITE_REPORTING_WARD_COLUMNS = 'mdaLitewardColumns'; +export const SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_COLUMNS = 'mdaLiteJurisdictionsColumns'; diff --git a/src/containers/pages/MDALite/jurisdictionsReport/tests/__snapshots__/index.test.tsx.snap b/src/containers/pages/MDALite/jurisdictionsReport/tests/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..6b13f1015b --- /dev/null +++ b/src/containers/pages/MDALite/jurisdictionsReport/tests/__snapshots__/index.test.tsx.snap @@ -0,0 +1,9 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`components/MDA/Lite/Reports/JurisdictionReport renders correctly 1`] = `"{\\"history\\":{\\"length\\":1,\\"action\\":\\"POP\\",\\"location\\":{\\"pathname\\":\\"/\\",\\"search\\":\\"\\",\\"hash\\":\\"\\"}},\\"match\\":{\\"isExact\\":true,\\"params\\":{\\"planId\\":\\"5e396185-6094-4817-9dd4-24bcbbc698b0\\"},\\"path\\":\\"/intervention/mda-lite/report/:planId\\",\\"url\\":\\"/intervention/mda-lite/report/5e396185-6094-4817-9dd4-24bcbbc698b0\\"},\\"jurisdictions\\":[{\\"id\\":\\"165b0ae7-92fa-5b70-a7bb-283797f565c2\\",\\"plan_id\\":\\"5e396185-6094-4817-9dd4-24bcbbc698b0\\",\\"jurisdiction_id\\":\\"25e8a10b-737c-44e7-bfff-3b6344b1126f\\",\\"jurisdiction_parent_id\\":\\"\\",\\"jurisdiction_name\\":\\"Kenya\\",\\"jurisdiction_depth\\":0,\\"jurisdiction_path\\":[],\\"jurisdiction_name_path\\":[],\\"treated_male_1_4\\":\\"200\\",\\"treated_male_5_14\\":0,\\"treated_male_above_15\\":0,\\"treated_female_1_4\\":0,\\"treated_female_5_14\\":0,\\"treated_female_above_15\\":0,\\"total_males\\":20,\\"total_females\\":3,\\"total_all_genders\\":20,\\"supervisor_distributed\\":0,\\"received_number\\":0,\\"adminstered\\":0,\\"damaged\\":0,\\"adverse\\":0,\\"remaining_with_cdd\\":10,\\"returned_to_supervisor\\":3,\\"census_pop_target\\":200,\\"treatment_coverage\\":0.8,\\"other_pop_target\\":500,\\"other_pop_coverage\\":0.65},{\\"id\\":\\"89bb4010-38ee-5eac-b92a-4deafa62765a\\",\\"plan_id\\":\\"5e396185-6094-4817-9dd4-24bcbbc698b0\\",\\"jurisdiction_id\\":\\"38482d8c-e6ed-433b-860f-96c9cd09b4a3\\",\\"jurisdiction_parent_id\\":\\"3c63f48e-bb86-42e5-b3ff-bc539fbf5295\\",\\"jurisdiction_name\\":\\"emuhaya\\",\\"jurisdiction_depth\\":2,\\"jurisdiction_path\\":[\\"25e8a10b-737c-44e7-bfff-3b6344b1126f\\",\\"3c63f48e-bb86-42e5-b3ff-bc539fbf5295\\"],\\"jurisdiction_name_path\\":[\\"Kenya\\",\\"Vihiga\\"],\\"treated_male_1_4\\":0,\\"treated_male_5_14\\":0,\\"treated_male_above_15\\":0,\\"treated_female_1_4\\":0,\\"treated_female_5_14\\":0,\\"treated_female_above_15\\":0,\\"total_males\\":19,\\"total_females\\":100,\\"total_all_genders\\":0,\\"supervisor_distributed\\":0,\\"received_number\\":0,\\"adminstered\\":0,\\"damaged\\":0,\\"adverse\\":0,\\"remaining_with_cdd\\":0,\\"returned_to_supervisor\\":0,\\"census_pop_target\\":300,\\"treatment_coverage\\":0.9,\\"other_pop_target\\":400,\\"other_pop_coverage\\":0.6},{\\"id\\":\\"541e7ed0-2dc6-586e-b563-4c988c5ac585\\",\\"plan_id\\":\\"5e396185-6094-4817-9dd4-24bcbbc698b0\\",\\"jurisdiction_id\\":\\"3c63f48e-bb86-42e5-b3ff-bc539fbf5295\\",\\"jurisdiction_parent_id\\":\\"25e8a10b-737c-44e7-bfff-3b6344b1126f\\",\\"jurisdiction_name\\":\\"vihiga\\",\\"jurisdiction_depth\\":1,\\"jurisdiction_path\\":[\\"25e8a10b-737c-44e7-bfff-3b6344b1126f\\"],\\"jurisdiction_name_path\\":[\\"Kenya\\"],\\"treated_male_1_4\\":0,\\"treated_male_5_14\\":0,\\"treated_male_above_15\\":0,\\"treated_female_1_4\\":0,\\"treated_female_5_14\\":0,\\"treated_female_above_15\\":0,\\"total_males\\":0,\\"total_females\\":0,\\"total_all_genders\\":0,\\"supervisor_distributed\\":0,\\"received_number\\":0,\\"adminstered\\":0,\\"damaged\\":0,\\"adverse\\":0,\\"remaining_with_cdd\\":0,\\"returned_to_supervisor\\":0},{\\"id\\":\\"c477af78-93ce-51f8-bf1e-0bae3a80fcae\\",\\"plan_id\\":\\"5e396185-6094-4817-9dd4-24bcbbc698b0\\",\\"jurisdiction_id\\":\\"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\\",\\"jurisdiction_parent_id\\":\\"3c63f48e-bb86-42e5-b3ff-bc539fbf5295\\",\\"jurisdiction_name\\":\\"hamisi\\",\\"jurisdiction_depth\\":2,\\"jurisdiction_path\\":[\\"25e8a10b-737c-44e7-bfff-3b6344b1126f\\",\\"3c63f48e-bb86-42e5-b3ff-bc539fbf5295\\"],\\"jurisdiction_name_path\\":[\\"Kenya\\",\\"Vihiga\\"],\\"treated_male_1_4\\":0,\\"treated_male_5_14\\":0,\\"treated_male_above_15\\":0,\\"treated_female_1_4\\":0,\\"treated_female_5_14\\":0,\\"treated_female_above_15\\":0,\\"total_males\\":0,\\"total_females\\":0,\\"total_all_genders\\":0,\\"supervisor_distributed\\":0,\\"received_number\\":0,\\"adminstered\\":0,\\"damaged\\":0,\\"adverse\\":0,\\"remaining_with_cdd\\":0,\\"returned_to_supervisor\\":0}],\\"plan\\":{\\"plan_id\\":\\"5e396185-6094-4817-9dd4-24bcbbc698b0\\",\\"jurisdiction_root_parent_ids\\":\\"[\\\\\\"bac41d87-b09d-4e76-be3b-3b6d07399891\\\\\\"]\\",\\"plan_title\\":\\"MDA-Lite 2021-03-02\\",\\"plan_name\\":\\"MDA-Lite-2021-03-02\\",\\"plan_status\\":\\"active\\",\\"plan_date\\":1614643200000,\\"plan_effective_period_start\\":1614643200000,\\"plan_effective_period_end\\":1616371200000,\\"plan_intervention_type\\":\\"MDA-Lite\\"},\\"baseURL\\":\\"/intervention/mda-lite/report\\",\\"focusAreaColumn\\":\\"mdaLitewardColumns\\",\\"jurisdictionColumn\\":\\"mdaLiteJurisdictionsColumns\\",\\"pageTitle\\":\\"MDA Lite Reporting\\",\\"reportingPlanSlice\\":\\"1\\",\\"slices\\":[\\"1\\",\\"2\\"]}"`; + +exports[`components/MDA/Lite/Reports/JurisdictionReport renders correctly: breadcrumb item-1 1`] = `"Home"`; + +exports[`components/MDA/Lite/Reports/JurisdictionReport renders correctly: breadcrumb item-2 1`] = `"MDA Lite Reporting"`; + +exports[`components/MDA/Lite/Reports/JurisdictionReport renders correctly: breadcrumb item-3 1`] = `"MDA-Lite 2021-03-02"`; diff --git a/src/containers/pages/MDALite/jurisdictionsReport/tests/fixtures.ts b/src/containers/pages/MDALite/jurisdictionsReport/tests/fixtures.ts index afad629234..75dfd7f0b3 100644 --- a/src/containers/pages/MDALite/jurisdictionsReport/tests/fixtures.ts +++ b/src/containers/pages/MDALite/jurisdictionsReport/tests/fixtures.ts @@ -33,12 +33,12 @@ export const MDALiteJurReports = [ { id: '89bb4010-38ee-5eac-b92a-4deafa62765a', plan_id: '5e396185-6094-4817-9dd4-24bcbbc698b0', - jurisdiction_id: 'f2482d8c-e6ed-433b-860f-96c9cd09b4a3', - jurisdiction_parent_id: '38482d8c-e6ed-433b-860f-96c9cd09b4a3', + jurisdiction_id: '38482d8c-e6ed-433b-860f-96c9cd09b4a3', + jurisdiction_parent_id: '3c63f48e-bb86-42e5-b3ff-bc539fbf5295', jurisdiction_name: 'emuhaya', jurisdiction_depth: 2, jurisdiction_path: - '["25e8a10b-737c-44e7-bfff-3b6344b1126f", "f2482d8c-e6ed-433b-860f-96c9cd09b4a3"]', + '["25e8a10b-737c-44e7-bfff-3b6344b1126f", "3c63f48e-bb86-42e5-b3ff-bc539fbf5295"]', jurisdiction_name_path: '["Kenya", "Vihiga"]', treated_male_1_4: 0, treated_male_5_14: 0, @@ -95,7 +95,7 @@ export const MDALiteJurReports = [ jurisdiction_name: 'hamisi', jurisdiction_depth: 2, jurisdiction_path: - '["25e8a10b-737c-44e7-bfff-3b6344b1126f", "f2482d8c-e6ed-433b-860f-96c9cd09b4a3"]', + '["25e8a10b-737c-44e7-bfff-3b6344b1126f", "3c63f48e-bb86-42e5-b3ff-bc539fbf5295"]', jurisdiction_name_path: '["Kenya", "Vihiga"]', treated_male_1_4: 0, treated_male_5_14: 0, diff --git a/src/containers/pages/MDALite/jurisdictionsReport/tests/index.test.tsx b/src/containers/pages/MDALite/jurisdictionsReport/tests/index.test.tsx new file mode 100644 index 0000000000..d5c7edc569 --- /dev/null +++ b/src/containers/pages/MDALite/jurisdictionsReport/tests/index.test.tsx @@ -0,0 +1,162 @@ +import reducerRegistry from '@onaio/redux-reducer-registry'; +import superset from '@onaio/superset-connector'; +import { mount, shallow } from 'enzyme'; +import flushPromises from 'flush-promises'; +import { createBrowserHistory } from 'history'; +import React from 'react'; +import { act } from 'react-dom/test-utils'; +import { Provider } from 'react-redux'; +import { Router } from 'react-router'; +import ConnectedMdaLiteJurisdictionReport, { MdaLiteJurisdictionReport } from '../'; +import { REPORT_MDA_LITE_PLAN_URL } from '../../../../../constants'; +import store from '../../../../../store'; +import GenericJurisdictionsReducer, { + fetchGenericJurisdictions, + reducerName as GenericJurisdictionsReducerName, +} from '../../../../../store/ducks/generic/jurisdictions'; +import { genericFetchPlans } from '../../../../../store/ducks/generic/plans'; +import { GenericPlan } from '../../../../../store/ducks/generic/plans'; +import { MDALitePlans } from '../../../../../store/ducks/superset/MDALite/tests/fixtures'; +import { MDALiteJurReports } from './fixtures'; + +/* tslint:disable-next-line no-var-requires */ +const fetch = require('jest-fetch-mock'); + +jest.mock('../../../../../configs/env'); + +const history = createBrowserHistory(); + +/** register the reducers */ +reducerRegistry.register(GenericJurisdictionsReducerName, GenericJurisdictionsReducer); + +store.dispatch(fetchGenericJurisdictions('1', MDALiteJurReports)); +store.dispatch(genericFetchPlans(MDALitePlans as GenericPlan[])); + +describe('components/MDA/Lite/Reports/JurisdictionReport', () => { + beforeEach(() => { + jest.resetAllMocks(); + }); + + it('renders without crashing', async () => { + const mock: any = jest.fn(); + const props = { + history, + location: mock, + match: { + isExact: true, + params: { + planId: MDALitePlans[0].plan_id, + }, + path: `${REPORT_MDA_LITE_PLAN_URL}/:planId`, + url: `${REPORT_MDA_LITE_PLAN_URL}/${MDALitePlans[0].plan_id}`, + }, + }; + shallow( + + + + ); + }); + + it('renders correctly', async () => { + fetch.mockResponseOnce(JSON.stringify({})); + const mock: any = jest.fn(); + + superset.api.doFetch = jest.fn(() => Promise.resolve({})); + + const supersetServiceMock: any = jest.fn(); + supersetServiceMock.mockImplementation(async () => []); + const props = { + history, + location: mock, + match: { + isExact: true, + params: { + planId: MDALitePlans[0].plan_id, + }, + path: `${REPORT_MDA_LITE_PLAN_URL}/:planId`, + url: `${REPORT_MDA_LITE_PLAN_URL}/${MDALitePlans[0].plan_id}`, + }, + }; + + const wrapper = mount( + + + + + + ); + await act(async () => { + await flushPromises(); + }); + wrapper.update(); + + expect(JSON.stringify(wrapper.find('GenericJurisdictionReport').props())).toMatchSnapshot(); + wrapper + .find('BreadcrumbItem li') + .forEach((item, i) => expect(item.text()).toMatchSnapshot(`breadcrumb item-${i + 1}`)); + expect(wrapper.find('h3.page-title').text()).toEqual('MDA Lite Reporting: MDA-Lite 2021-03-02'); + expect(wrapper.find('.page-title').text()).toEqual('MDA Lite Reporting: MDA-Lite 2021-03-02'); + expect((wrapper.find('DrillDownTable').props().data as any).length).toEqual(4); + + expect(wrapper.find('DrillDownTable .thead .tr').length).toEqual(2); + expect(wrapper.find('.thead .tr .th').length).toEqual(38); + expect(wrapper.find('.no-data-cls').length).toMatchInlineSnapshot(`0`); + // drilling down + // country level + expect(wrapper.find('.tbody .tr').length).toEqual(1); + expect(wrapper.find('.tbody .tr .td').length).toEqual(21); + expect( + wrapper + .find('.tbody .tr .td') + .at(0) + .text() + ).toEqual('Kenya'); + wrapper + .find('.tbody .tr .td') + .at(0) + .simulate('click'); + await act(async () => { + await flushPromises(); + }); + wrapper.update(); + expect(wrapper.find('.page-title').text()).toEqual( + 'MDA Lite Reporting: MDA-Lite 2021-03-02: Kenya' + ); + // county level + expect( + wrapper + .find('.tbody .tr .td') + .at(0) + .text() + ).toEqual('vihiga'); + wrapper + .find('.tbody .tr .td') + .at(0) + .simulate('click'); + await act(async () => { + await flushPromises(); + }); + wrapper.update(); + expect(wrapper.find('.page-title').text()).toEqual( + 'MDA Lite Reporting: MDA-Lite 2021-03-02: vihiga' + ); + // sub-county level + const rows = wrapper.find('.tbody .tr'); + expect(rows.length).toEqual(2); + expect( + rows + .at(0) + .find('.td') + .at(0) + .text() + ).toEqual('emuhaya'); + expect( + rows + .at(1) + .find('.td') + .at(0) + .text() + ).toEqual('hamisi'); + }); +}); From 95b7ea3b697b1c3e8fb512f51bd80f7cee956c5d Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Wed, 7 Apr 2021 11:26:29 +0300 Subject: [PATCH 23/40] Update CDDs columns --- .env.sample | 6 ++- src/configs/env.ts | 8 +++ .../pages/MDALite/cddReports/cdds.tsx | 8 +-- .../pages/MDALite/cddReports/supervisors.tsx | 3 +- src/store/ducks/superset/MDALite/cdd.ts | 33 ++++++++++--- .../ducks/superset/MDALite/supervisors.ts | 49 ++++++++++++++----- 6 files changed, 84 insertions(+), 23 deletions(-) diff --git a/.env.sample b/.env.sample index df2c061038..7509576df7 100644 --- a/.env.sample +++ b/.env.sample @@ -186,5 +186,7 @@ REACT_APP_ASSIGNED_TEAMS_REQUEST_PAGE_SIZE=1000 REACT_APP_OPENSRP_GENERATED_TASKS_INTERVENTIONS=Dynamic-FI,FI REACT_APP_SHOW_MAP_AT_JURISDICTION_LEVEL=99 -REACT_APP_SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE=0 -REACT_APP_SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE=0 +REACT_APP_SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE=633 +REACT_APP_SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE=630 +REACT_APP_SUPERSET_MDA_LITE_REPORTING_WARD_SLICE=631 +REACT_APP_SUPERSET_MDA_LITE_REPORTING_WARD_GEOJSON_SLICE=632 diff --git a/src/configs/env.ts b/src/configs/env.ts index 5e6237e835..8727d47214 100644 --- a/src/configs/env.ts +++ b/src/configs/env.ts @@ -624,3 +624,11 @@ export type SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE = typeof SUPERSET export const SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE = process.env.REACT_APP_SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE || '0'; export type SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE = typeof SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE; + +export const SUPERSET_MDA_LITE_REPORTING_WARD_SLICE = + process.env.REACT_APP_SUPERSET_MDA_LITE_REPORTING_WARD_SLICE || '0'; +export type SUPERSET_MDA_LITE_REPORTING_WARD_SLICE = typeof SUPERSET_MDA_LITE_REPORTING_WARD_SLICE; + +export const SUPERSET_MDA_LITE_REPORTING_WARD_GEOJSON_SLICE = + process.env.REACT_APP_SUPERSET_MDA_LITE_REPORTING_WARD_GEOJSON_SLICE || '0'; +export type SUPERSET_MDA_LITE_REPORTING_WARD_GEOJSON_SLICE = typeof SUPERSET_MDA_LITE_REPORTING_WARD_GEOJSON_SLICE; diff --git a/src/containers/pages/MDALite/cddReports/cdds.tsx b/src/containers/pages/MDALite/cddReports/cdds.tsx index 294e483ad2..4e8741f681 100644 --- a/src/containers/pages/MDALite/cddReports/cdds.tsx +++ b/src/containers/pages/MDALite/cddReports/cdds.tsx @@ -81,7 +81,7 @@ const MDALiteCddReports = (props: MDALiteCddReportsProps & RouteComponentProps(reducerNa export interface MDALiteCDDFilters { cdd_name?: string /** CDD name */; supervisor_id?: string /** supervisor id */; - ward_id?: string /** ward id */; + base_entity_id?: string /** ward id */; + plan_id?: string /** plan id */; } /** MDALiteCDDsArrayBaseSelector select an array of all CDDs @@ -94,12 +96,19 @@ export const getName = (_: Partial, props: MDALiteCDDFilters) => props.cd */ export const getSupervisorId = (_: Partial, props: MDALiteCDDFilters) => props.supervisor_id; +/** + * Gets plan id from filters + * @param state - the redux store + * @param props - the cdd filters object + */ +export const getPlanId = (_: Partial, props: MDALiteCDDFilters) => props.plan_id; + /** * Gets ward id from filters * @param state - the redux store * @param props - the cdd filters object */ -export const getWardId = (_: Partial, props: MDALiteCDDFilters) => props.ward_id; +export const getWardId = (_: Partial, props: MDALiteCDDFilters) => props.base_entity_id; /** * Gets an array of CDDs filtered by name @@ -121,6 +130,16 @@ export const getMDALiteCDDsArrayBySupervisorId = () => supervisorId ? cdds.filter(cdd => supervisorId === cdd.supervisor_id) : cdds ); +/** + * Gets an array of CDDs objects filtered by supervisor id + * @param {Partial} state - the redux store + * @param {MDALiteCDDFilters} props - the CDDs filters object + */ +export const getMDALiteCDDsArrayByPlanId = () => + createSelector([MDALiteCDDsArrayBaseSelector, getPlanId], (cdds, planId) => + planId ? cdds.filter(cdd => planId === cdd.plan_id) : cdds + ); + /** * Gets an array of CDDs objects filtered by ward id * @param {Partial} state - the redux store @@ -128,7 +147,7 @@ export const getMDALiteCDDsArrayBySupervisorId = () => */ export const getMDALiteCDDsArrayByWardId = () => createSelector([MDALiteCDDsArrayBaseSelector, getWardId], (cdds, wardId) => - wardId ? cdds.filter(cdd => wardId === cdd.ward_id) : cdds + wardId ? cdds.filter(cdd => wardId === cdd.base_entity_id) : cdds ); /** @@ -136,7 +155,8 @@ export const getMDALiteCDDsArrayByWardId = () => * of the following: * - cdd_name * - supervisor_id - * - ward_id + * - base_entity_id + * - plan_id * * These filter params are all optional and are supplied via the prop parameter. * @@ -154,7 +174,8 @@ export const makeMDALiteCDDsArraySelector = () => { getMDALiteCDDsArrayByName(), getMDALiteCDDsArrayBySupervisorId(), getMDALiteCDDsArrayByWardId(), + getMDALiteCDDsArrayByPlanId(), ], - (cdd1, cdd2, cdd3) => intersect([cdd1, cdd2, cdd3], JSON.stringify) + (cdd1, cdd2, cdd3, cdd4) => intersect([cdd1, cdd2, cdd3, cdd4], JSON.stringify) ); }; diff --git a/src/store/ducks/superset/MDALite/supervisors.ts b/src/store/ducks/superset/MDALite/supervisors.ts index 263c83ae4e..759f55a94b 100644 --- a/src/store/ducks/superset/MDALite/supervisors.ts +++ b/src/store/ducks/superset/MDALite/supervisors.ts @@ -17,8 +17,9 @@ export const reducerName = 'MDALiteSupervisors'; /** MDALiteSupervisors interface */ export interface MDALiteSupervisor extends MDALiteDrugsReportInterface { id: string; - name: string; - ward_id: string; + supervisor_name: string; + base_entity_id: string; + plan_id: string; } /** MDA-Lite supervisor Reducer */ @@ -45,8 +46,9 @@ export const getMDALiteSupervisorsArray = getItemsByIdFactory /** This interface represents the structure of MDA Lite Supervisors filter options/params */ export interface MDALiteSupervisorFilters { - name?: string /** Supervisor name */; - ward_id?: string /** ward id */; + supervisor_name?: string /** Supervisor name */; + base_entity_id?: string /** ward id */; + plan_id?: string /** plan id */; } /** MDALiteSupervisorsArrayBaseSelector select an array of all Supervisors @@ -60,14 +62,23 @@ export const MDALiteSupervisorsArrayBaseSelector = (state: Partial): MDAL * @param state - the redux store * @param props - the supervisor filters object */ -export const getName = (_: Partial, props: MDALiteSupervisorFilters) => props.name; +export const getName = (_: Partial, props: MDALiteSupervisorFilters) => + props.supervisor_name; /** * Gets ward id from filters * @param state - the redux store * @param props - the supervisor filters object */ -export const getWardId = (_: Partial, props: MDALiteSupervisorFilters) => props.ward_id; +export const getWardId = (_: Partial, props: MDALiteSupervisorFilters) => + props.base_entity_id; + +/** + * Gets plan id from filters + * @param state - the redux store + * @param props - the supervisor filters object + */ +export const getPlanId = (_: Partial, props: MDALiteSupervisorFilters) => props.plan_id; /** * Gets an array of Supervisors filtered by name @@ -78,7 +89,7 @@ export const getMDALiteSupervisorsArrayByName = () => createSelector([MDALiteSupervisorsArrayBaseSelector, getName], (Supervisors, supervisorName) => supervisorName ? Supervisors.filter(supervisor => - supervisor.name.toLowerCase().includes(supervisorName.toLowerCase()) + supervisor.supervisor_name.toLowerCase().includes(supervisorName.toLowerCase()) ) : Supervisors ); @@ -90,14 +101,25 @@ export const getMDALiteSupervisorsArrayByName = () => */ export const getMDALiteSupervisorsArrayByWardId = () => createSelector([MDALiteSupervisorsArrayBaseSelector, getWardId], (Supervisors, wardId) => - wardId ? Supervisors.filter(supervisor => wardId === supervisor.ward_id) : Supervisors + wardId ? Supervisors.filter(supervisor => wardId === supervisor.base_entity_id) : Supervisors + ); + +/** + * Gets an array of Supervisors objects filtered by ward id + * @param {Partial} state - the redux store + * @param {MDALiteSupervisorFilters} props - the Supervisors filters object + */ +export const getMDALiteSupervisorsArrayByPlanId = () => + createSelector([MDALiteSupervisorsArrayBaseSelector, getPlanId], (Supervisors, planId) => + planId ? Supervisors.filter(supervisor => planId === supervisor.plan_id) : Supervisors ); /** * Returns a selector that gets an array of Supervisors objects filtered by one or all * of the following: * - name - * - ward_id + * - base_entity_id + * - plan_id * * These filter params are all optional and are supplied via the prop parameter. * @@ -111,7 +133,12 @@ export const getMDALiteSupervisorsArrayByWardId = () => */ export const makeMDALiteSupervisorsArraySelector = () => { return createSelector( - [getMDALiteSupervisorsArrayByName(), getMDALiteSupervisorsArrayByWardId()], - (supervisor1, supervisor2) => intersect([supervisor1, supervisor2], JSON.stringify) + [ + getMDALiteSupervisorsArrayByName(), + getMDALiteSupervisorsArrayByWardId(), + getMDALiteSupervisorsArrayByPlanId(), + ], + (supervisor1, supervisor2, supervisor3) => + intersect([supervisor1, supervisor2, supervisor3], JSON.stringify) ); }; From 396c6db15bc954ec3077854ed2492c85e821651b Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Wed, 7 Apr 2021 12:18:47 +0300 Subject: [PATCH 24/40] Add MDA Lite wards reducer --- src/store/ducks/superset/MDALite/wards.ts | 153 ++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 src/store/ducks/superset/MDALite/wards.ts diff --git a/src/store/ducks/superset/MDALite/wards.ts b/src/store/ducks/superset/MDALite/wards.ts new file mode 100644 index 0000000000..03897e9d0d --- /dev/null +++ b/src/store/ducks/superset/MDALite/wards.ts @@ -0,0 +1,153 @@ +import { + fetchActionCreatorFactory, + getItemByIdFactory, + getItemsByIdFactory, + reducerFactory, + removeActionCreatorFactory, +} from '@opensrp/reducer-factory'; +import intersect from 'fast_array_intersect'; +import { values } from 'lodash'; +import { Store } from 'redux'; +import { createSelector } from 'reselect'; +import { MDALiteGenderInterface } from './cdd'; + +/** the reducer name */ +export const reducerName = 'MDALiteWards'; + +export interface MDALiteWards extends MDALiteGenderInterface { + base_entity_id: string; + id: string; + parent_id: string; + plan_id: string; + ward_name: string; +} + +/** MDA-Lite Ward Reducer */ +const reducer = reducerFactory(reducerName); +export default reducer; + +// actions +/** actionCreator returns action to to add Item records to store */ +export const fetchMDALiteWards = fetchActionCreatorFactory(reducerName, 'id'); +/** actionCreator returns action to to remove Item records to store */ +export const removeMDALiteWards = removeActionCreatorFactory(reducerName); + +// selectors +/** get one Ward using their id */ +export const getMDALiteWardById = getItemByIdFactory(reducerName); + +/** get all Wards by ids */ +export const getMDALiteWardsArray = getItemsByIdFactory(reducerName); + +/** RESELECT USAGE STARTS HERE */ + +/** This interface represents the structure of MDA Lite wards filter options/params */ +export interface MDALiteWardsFilters { + base_entity_id?: string /** ward id */; + parent_id?: string /** parent id */; + ward_name?: string /** ward name */; + plan_id?: string /** plan id */; +} + +/** MDALiteWardsArrayBaseSelector select an array of all wards + * @param state - the redux store + */ +export const MDALiteWardsArrayBaseSelector = (state: Partial): MDALiteWards[] => + values(getMDALiteWardsArray(state) || {}); + +/** + * Gets plan id from filters + * @param state - the redux store + * @param props - the wards filters object + */ +export const getPlanId = (_: Partial, props: MDALiteWardsFilters) => props.plan_id; + +/** + * Gets parent id from filters + * @param state - the redux store + * @param props - the wards filters object + */ +export const getParentId = (_: Partial, props: MDALiteWardsFilters) => props.parent_id; + +/** + * Gets ward name from filters + * @param state - the redux store + * @param props - the wards filters object + */ +export const getWardName = (_: Partial, props: MDALiteWardsFilters) => props.ward_name; + +/** + * Gets ward id from filters + * @param state - the redux store + * @param props - the wards filters object + */ +export const getWardId = (_: Partial, props: MDALiteWardsFilters) => props.base_entity_id; + +/** + * Gets an array of wards filtered by ward name + * @param {Partial} state - the redux store + * @param {MDALiteWardsFilters} props - the wards filters object + */ +export const getMDALiteWardsArrayByName = () => + createSelector([MDALiteWardsArrayBaseSelector, getWardName], (wards, wardName) => + wardName + ? wards.filter(ward => ward.ward_name.toLowerCase().includes(wardName.toLowerCase())) + : wards + ); + +/** + * Gets an array of wards objects filtered by parent id + * @param {Partial} state - the redux store + * @param {MDALiteWardsFilters} props - the wards filters object + */ +export const getMDALiteWardsArrayByParentId = () => + createSelector([MDALiteWardsArrayBaseSelector, getParentId], (wards, parentId) => + parentId ? wards.filter(ward => parentId === ward.parent_id) : wards + ); + +/** + * Gets an array of wards objects filtered by plan id + * @param {Partial} state - the redux store + * @param {MDALiteWardsFilters} props - the wards filters object + */ +export const getMDALiteWardsArrayByPlanId = () => + createSelector([MDALiteWardsArrayBaseSelector, getPlanId], (wards, planId) => + planId ? wards.filter(ward => planId === ward.plan_id) : wards + ); + +/** + * Gets an array of wards objects filtered by ward id + * @param {Partial} state - the redux store + * @param {MDALiteWardsFilters} props - the wards filters object + */ +export const getMDALiteWardsArrayByWardId = () => + createSelector([MDALiteWardsArrayBaseSelector, getPlanId], (wards, wardId) => + wardId ? wards.filter(ward => wardId === ward.base_entity_id) : wards + ); + +/** + * Returns a selector that gets an array of wards objects filtered by one or all + * of the following: + * - ward_name + * - parent_id + * - plan_id + * + * These filter params are all optional and are supplied via the prop parameter. + * + * To use this selector, do something like: + * const makeMDALiteWardsArraySelector = makeMDALiteWardsArraySelector(); + * + * @param {Partial} state - the redux store + * @param {MDALiteWardsFilters} props - the wards filters object + */ +export const makeMDALiteWardsArraySelector = () => { + return createSelector( + [ + getMDALiteWardsArrayByPlanId(), + getMDALiteWardsArrayByParentId(), + getMDALiteWardsArrayByName(), + getMDALiteWardsArrayByWardId(), + ], + (ward1, ward2, ward3, ward4) => intersect([ward1, ward2, ward3, ward4], JSON.stringify) + ); +}; From 9a6a143c36f4a8ae1f78f576677dd12f35a0d0f3 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Wed, 7 Apr 2021 16:38:02 +0300 Subject: [PATCH 25/40] Add MDA Lite wards report page --- src/App/App.tsx | 9 + src/configs/lang.ts | 2 + src/constants.tsx | 1 + .../GenericJurisdictionReport/helpers.ts | 2 +- .../pages/MDALite/wardReports/helpers.tsx | 13 + .../pages/MDALite/wardReports/index.tsx | 284 ++++++++++++++++++ src/store/ducks/superset/MDALite/wards.ts | 4 +- 7 files changed, 312 insertions(+), 3 deletions(-) create mode 100644 src/containers/pages/MDALite/wardReports/helpers.tsx create mode 100644 src/containers/pages/MDALite/wardReports/index.tsx diff --git a/src/App/App.tsx b/src/App/App.tsx index 125ee3552e..f6ecfe1a83 100644 --- a/src/App/App.tsx +++ b/src/App/App.tsx @@ -84,6 +84,7 @@ import { REPORT_IRS_PLAN_URL, REPORT_MDA_LITE_CDD_REPORT_URL, REPORT_MDA_LITE_PLAN_URL, + REPORT_MDA_LITE_WARD_URL, REPORT_MDA_PLAN_URL, REPORT_MDA_POINT_PLAN_URL, REPORT_SMC_PLAN_URL, @@ -129,6 +130,7 @@ import ConnectedMDALiteCddReports from '../containers/pages/MDALite/cddReports/c import ConnectedMDALiteSupervisorReports from '../containers/pages/MDALite/cddReports/supervisors'; import ConnectedMdaLiteJurisdictionReport from '../containers/pages/MDALite/jurisdictionsReport'; import ConnectedMDALitePlansList from '../containers/pages/MDALite/plans'; +import ConnectedMDALiteWardsReport from '../containers/pages/MDALite/wardReports'; import ConnectedChildReports from '../containers/pages/MDAPoint/ChildReports'; import ConnectedClientListView from '../containers/pages/MDAPoint/ClientListView'; import ConnectedMdaPointJurisdictionReport from '../containers/pages/MDAPoint/jurisdictionsReport'; @@ -309,6 +311,13 @@ const App = () => { path={`${REPORT_MDA_LITE_PLAN_URL}/:planId/:jurisdictionId`} component={ConnectedMdaLiteJurisdictionReport} /> + getIRSThresholdAdherenceIndicator(cell, indicatorThresholdsMDALite), diff --git a/src/containers/pages/MDALite/wardReports/helpers.tsx b/src/containers/pages/MDALite/wardReports/helpers.tsx new file mode 100644 index 0000000000..42e011fc38 --- /dev/null +++ b/src/containers/pages/MDALite/wardReports/helpers.tsx @@ -0,0 +1,13 @@ +import { DrillDownColumn } from '@onaio/drill-down-table/dist/types'; +import { Dictionary } from '@onaio/utils'; +import { censusPopColumns, genderReportColumns } from '../../GenericJurisdictionReport/helpers'; + +/** wards columns */ +export const wardColumns: Array> = [ + { + Header: 'Name', + accessor: 'ward_name', + }, + ...genderReportColumns, + ...censusPopColumns, +]; diff --git a/src/containers/pages/MDALite/wardReports/index.tsx b/src/containers/pages/MDALite/wardReports/index.tsx new file mode 100644 index 0000000000..50a658b1b8 --- /dev/null +++ b/src/containers/pages/MDALite/wardReports/index.tsx @@ -0,0 +1,284 @@ +import reducerRegistry from '@onaio/redux-reducer-registry'; +import React, { useEffect, useState } from 'react'; +import { RouteComponentProps } from 'react-router-dom'; + +import { DrillDownTable } from '@onaio/drill-down-table'; +import superset, { SupersetAdhocFilterOption } from '@onaio/superset-connector'; +import Helmet from 'react-helmet'; +import { connect } from 'react-redux'; +import { Col, Row } from 'reactstrap'; +import { Store } from 'redux'; +import HeaderBreadcrumb from '../../../../components/page/HeaderBreadcrumb/HeaderBreadcrumb'; +import Loading from '../../../../components/page/Loading'; +import { + defaultOptions, + renderInFilterFactory, +} from '../../../../components/Table/DrillDownFilters/utils'; +import { NoDataComponent } from '../../../../components/Table/NoDataComponent'; +import { + SUPERSET_MAX_RECORDS, + SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES, + SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE, + SUPERSET_MDA_LITE_REPORTING_WARD_SLICE, +} from '../../../../configs/env'; +import { HOME, MDA_LITE_REPORTING_TITLE, SUBCOUNTY_LABEL } from '../../../../configs/lang'; +import { HOME_URL, REPORT_MDA_LITE_PLAN_URL } from '../../../../constants'; +import { displayError } from '../../../../helpers/errors'; +import { RouteParams } from '../../../../helpers/utils'; +import supersetFetch from '../../../../services/superset'; +import GenericJurisdictionsReducer, { + fetchGenericJurisdictions, + GenericJurisdiction, + getGenericJurisdictionByJurisdictionId, + reducerName as genericJurisdictionsReducerName, +} from '../../../../store/ducks/generic/jurisdictions'; +import GenericPlansReducer, { + genericFetchPlans, + GenericPlan, + getPlanByIdSelector, + reducerName as genericPlanReducerName, +} from '../../../../store/ducks/generic/plans'; +import wardReducer, { + fetchMDALiteWards, + makeMDALiteWardsArraySelector, + MDALiteWards, + reducerName as wardReducerName, +} from '../../../../store/ducks/superset/MDALite/wards'; +import { wardColumns } from './helpers'; + +/** register the reducers */ +reducerRegistry.register(genericJurisdictionsReducerName, GenericJurisdictionsReducer); +reducerRegistry.register(genericPlanReducerName, GenericPlansReducer); +reducerRegistry.register(wardReducerName, wardReducer); + +/** selectors */ +const makeMDALiteWardsSelector = makeMDALiteWardsArraySelector(); + +interface MDALiteWardsrReportsProps { + baseUrl: string; + fetchJurisdictions: typeof fetchGenericJurisdictions; + fetchPlans: typeof genericFetchPlans; + fetchWards: typeof fetchMDALiteWards; + planData: GenericPlan | null; + service: typeof supersetFetch; + slices: string[]; + subcountyData: GenericJurisdiction[]; + wardData: MDALiteWards[]; +} + +const MDALiteWardsReport = ( + props: MDALiteWardsrReportsProps & RouteComponentProps +) => { + const { + wardData, + service, + fetchWards, + planData, + subcountyData, + slices, + fetchJurisdictions, + baseUrl, + } = props; + const [loading, setLoading] = useState(false); + + const { params } = props.match; + const { planId, jurisdictionId } = params; + + // load data + async function loadData() { + setLoading(!wardData || (wardData && wardData.length < 1)); + try { + const parentJurFilter: SupersetAdhocFilterOption[] = []; + const planIdFilter: SupersetAdhocFilterOption[] = []; + const jurisdictionFilter: SupersetAdhocFilterOption[] = []; + if (jurisdictionId) { + jurisdictionFilter.push({ + comparator: jurisdictionId, + operator: '==', + subject: 'jurisdiction_id', + }); + parentJurFilter.push({ comparator: jurisdictionId, operator: '==', subject: 'parent_id' }); + } + if (planId) { + planIdFilter.push({ comparator: planId, operator: '==', subject: 'plan_id' }); + } + // get ward data + const wardDataFilters = superset.getFormData(SUPERSET_MAX_RECORDS, [ + ...planIdFilter, + ...parentJurFilter, + ]); + await service(SUPERSET_MDA_LITE_REPORTING_WARD_SLICE, wardDataFilters).then(res => + fetchWards(res) + ); + // get plan data + if (!planData) { + const planDataFilter = superset.getFormData(SUPERSET_MAX_RECORDS, [...planIdFilter]); + await service(SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE, planDataFilter).then(res => + fetchWards(res) + ); + } + if (!subcountyData.length) { + const subCountyFilters = superset.getFormData(SUPERSET_MAX_RECORDS, [ + ...planIdFilter, + ...jurisdictionFilter, + ]); + slices.forEach(async slice => { + await service(slice, subCountyFilters).then(res => fetchJurisdictions(slice, res)); + }); + } + } catch (e) { + displayError(e); + } finally { + setLoading(false); + } + } + + useEffect(() => { + loadData().catch(err => displayError(err)); + }, [planId, jurisdictionId]); + + if (loading) { + return ; + } + + const jurBreadcrumb = []; + if (planData && subcountyData.length) { + jurBreadcrumb.push({ + label: planData.plan_title, + url: `${baseUrl}/${planData.plan_id}`, + }); + const paths = subcountyData[0].jurisdiction_path; + const names = subcountyData[0].jurisdiction_name_path; + if (paths?.length && names?.length) { + paths.forEach((_, index) => { + jurBreadcrumb.push({ + label: names[index], + url: `${baseUrl}/${planData.plan_id}/${paths[index]}`, + }); + }); + } + } + + const currentPage = { + label: subcountyData[0]?.jurisdiction_name || SUBCOUNTY_LABEL, + url: '', + }; + + const pageTitle = `${MDA_LITE_REPORTING_TITLE}: ${currentPage.label}`; + const breadcrumbProps = { + currentPage, + pages: [ + { + label: HOME, + url: HOME_URL, + }, + { + label: MDA_LITE_REPORTING_TITLE, + url: baseUrl, + }, + ...jurBreadcrumb, + ], + }; + + const tableProps = { + columns: wardColumns, + data: wardData || [], + // identifierField: 'id', + paginate: true, + renderInBottomFilterBar: renderInFilterFactory({ + showColumnHider: false, + showFilters: false, + showPagination: true, + showRowHeightPicker: false, + showSearch: false, + }), + renderInTopFilterBar: renderInFilterFactory({ + ...defaultOptions, + showColumnHider: false, + showRowHeightPicker: false, + }), + renderNullDataComponent: () => , + resize: true, + useDrillDown: false, + }; + + return ( +
+ + {pageTitle} + + + + +

{pageTitle}

+
+ +
+ +
+
+ ); +}; + +const defaultProps: MDALiteWardsrReportsProps = { + baseUrl: REPORT_MDA_LITE_PLAN_URL, + fetchJurisdictions: fetchGenericJurisdictions, + fetchPlans: genericFetchPlans, + fetchWards: fetchMDALiteWards, + planData: null, + service: supersetFetch, + slices: SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES.split(','), + subcountyData: [], + wardData: [], +}; + +MDALiteWardsReport.defaultProps = defaultProps; +export { MDALiteWardsReport }; + +/** map dispatch to props */ +const mapDispatchToProps = { + fetchJurisdictions: fetchGenericJurisdictions, + fetchPlans: genericFetchPlans, + fetchWards: fetchMDALiteWards, +}; + +type DispatchedStateProps = Pick< + MDALiteWardsrReportsProps, + 'planData' | 'wardData' | 'subcountyData' +>; + +/** map state to props */ +const mapStateToProps = ( + state: Partial, + ownProps: RouteComponentProps +): DispatchedStateProps => { + const { params } = ownProps.match; + const { planId, jurisdictionId } = params; + const planData = planId ? getPlanByIdSelector(state, planId) : null; + const wardData = makeMDALiteWardsSelector(state, { + parent_id: jurisdictionId, + plan_id: planId, + }); + const subcountyData: GenericJurisdiction[] = []; + if (jurisdictionId) { + defaultProps.slices.forEach((slice: string) => { + const jur = getGenericJurisdictionByJurisdictionId(state, slice, jurisdictionId); + if (jur && jur.plan_id === planId) { + subcountyData.push(jur); + } + }); + } + return { + planData, + subcountyData, + wardData, + }; +}; + +/** Connected MDALiteWardsReport component */ +const ConnectedMDALiteWardsReport = connect( + mapStateToProps, + mapDispatchToProps +)(MDALiteWardsReport); + +export default ConnectedMDALiteWardsReport; diff --git a/src/store/ducks/superset/MDALite/wards.ts b/src/store/ducks/superset/MDALite/wards.ts index 03897e9d0d..1059e608e5 100644 --- a/src/store/ducks/superset/MDALite/wards.ts +++ b/src/store/ducks/superset/MDALite/wards.ts @@ -121,7 +121,7 @@ export const getMDALiteWardsArrayByPlanId = () => * @param {MDALiteWardsFilters} props - the wards filters object */ export const getMDALiteWardsArrayByWardId = () => - createSelector([MDALiteWardsArrayBaseSelector, getPlanId], (wards, wardId) => + createSelector([MDALiteWardsArrayBaseSelector, getWardId], (wards, wardId) => wardId ? wards.filter(ward => wardId === ward.base_entity_id) : wards ); @@ -135,7 +135,7 @@ export const getMDALiteWardsArrayByWardId = () => * These filter params are all optional and are supplied via the prop parameter. * * To use this selector, do something like: - * const makeMDALiteWardsArraySelector = makeMDALiteWardsArraySelector(); + * const makeMDALiteWardsSelector = makeMDALiteWardsArraySelector(); * * @param {Partial} state - the redux store * @param {MDALiteWardsFilters} props - the wards filters object From 29ed5efdd96dcc09e0b32e1c25ddbcf6bcce0c56 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Wed, 7 Apr 2021 20:14:04 +0300 Subject: [PATCH 26/40] Link all MDA Lite views correctly --- .env.sample | 1 - docs/env.md | 5 - src/components/MDALiteCellTable/index.tsx | 9 +- src/configs/__mocks__/env.ts | 1 - src/configs/env.ts | 4 - .../GenericJurisdictionReport/helpers.ts | 11 -- .../tests/helpers.test.ts | 1 - .../pages/MDALite/cddReports/cdds.tsx | 137 +++++++----------- .../pages/MDALite/cddReports/helpers.tsx | 12 +- .../pages/MDALite/cddReports/supervisors.tsx | 103 +++++++------ .../MDALite/jurisdictionsReport/index.tsx | 3 +- .../pages/MDALite/wardReports/helpers.tsx | 9 ++ src/store/ducks/superset/MDALite/cdd.ts | 25 +++- 13 files changed, 155 insertions(+), 166 deletions(-) diff --git a/.env.sample b/.env.sample index 7509576df7..e4a60db1da 100644 --- a/.env.sample +++ b/.env.sample @@ -56,7 +56,6 @@ REACT_APP_SUPERSET_PLAN_STRUCTURE_PIVOT_SLICE=0 REACT_APP_SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE=0 REACT_APP_SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES=0 REACT_APP_SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_COLUMNS=mdaLiteJurisdictionsColumns -REACT_APP_SUPERSET_MDA_LITE_REPORTING_WARD_COLUMNS=mdaLitewardColumns REACT_APP_SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_FOCUS_AREA_LEVEL=99 REACT_APP_GISIDA_TIMEOUT=3000 diff --git a/docs/env.md b/docs/env.md index eaa44e61f5..edbd640b8a 100644 --- a/docs/env.md +++ b/docs/env.md @@ -135,11 +135,6 @@ Below is a list of currently supported environment variables: - MDA-Lite jurisdictions report table columns - **Required** -- **REACT_APP_SUPERSET_MDA_LITE_REPORTING_WARD_COLUMNS** - - - MDA-Lite Focus area report table columns - - **Required** - - **REACT_APP_SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_FOCUS_AREA_LEVEL** - MDA-Lite level were focus areas start diff --git a/src/components/MDALiteCellTable/index.tsx b/src/components/MDALiteCellTable/index.tsx index 7e68e46bd9..0bb7fc7624 100644 --- a/src/components/MDALiteCellTable/index.tsx +++ b/src/components/MDALiteCellTable/index.tsx @@ -5,7 +5,7 @@ import React from 'react'; import { Link } from 'react-router-dom'; import { Col, Row } from 'reactstrap'; import { SHOW_MAP_AT_JURISDICTION_LEVEL } from '../../configs/env'; -import { MAP } from '../../constants'; +import { MAP, REPORT_MDA_LITE_WARD_URL } from '../../constants'; /** Interface for linked cell props */ export interface LinkedCellProps extends DropDownCellProps { @@ -18,14 +18,17 @@ export interface LinkedCellProps extends DropDownCellProps { const MDALiteTableCell: React.ElementType = (props: LinkedCellProps) => { const { cell, cellValue, hasChildren, urlPath } = props; const original: Dictionary = cell.row.original; - const { jurisdiction_id, jurisdiction_depth } = original; + const { jurisdiction_id, jurisdiction_depth, plan_id } = original; const url = `${urlPath}/${jurisdiction_id}`; + const wardUrl = `${REPORT_MDA_LITE_WARD_URL}/${plan_id}/${jurisdiction_id}`; const jurLink = {cellValue}; if (SHOW_MAP_AT_JURISDICTION_LEVEL === +jurisdiction_depth) { return (
- {jurLink} + + {cellValue} + diff --git a/src/configs/__mocks__/env.ts b/src/configs/__mocks__/env.ts index 23cacbb455..00af3768ca 100644 --- a/src/configs/__mocks__/env.ts +++ b/src/configs/__mocks__/env.ts @@ -231,5 +231,4 @@ export const OPENSRP_GENERATED_TASKS_INTERVENTIONS = []; export const SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES = '1,2'; export const SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE = '1'; -export const SUPERSET_MDA_LITE_REPORTING_WARD_COLUMNS = 'mdaLitewardColumns'; export const SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_COLUMNS = 'mdaLiteJurisdictionsColumns'; diff --git a/src/configs/env.ts b/src/configs/env.ts index 8727d47214..6693762052 100644 --- a/src/configs/env.ts +++ b/src/configs/env.ts @@ -605,10 +605,6 @@ export const SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_COLUMNS = 'mdaLiteJurisdictionsColumns'; export type SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_COLUMNS = typeof SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_COLUMNS; -export const SUPERSET_MDA_LITE_REPORTING_WARD_COLUMNS = - process.env.REACT_APP_SUPERSET_MDA_LITE_REPORTING_WARD_COLUMNS || 'mdaLitewardColumns'; -export type SUPERSET_MDA_LITE_REPORTING_WARD_COLUMNS = typeof SUPERSET_MDA_LITE_REPORTING_WARD_COLUMNS; - export const SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_FOCUS_AREA_LEVEL = process.env.REACT_APP_SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_FOCUS_AREA_LEVEL || '99'; export type SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_FOCUS_AREA_LEVEL = typeof SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_FOCUS_AREA_LEVEL; diff --git a/src/containers/pages/GenericJurisdictionReport/helpers.ts b/src/containers/pages/GenericJurisdictionReport/helpers.ts index 17737140d5..e5d0202e5b 100644 --- a/src/containers/pages/GenericJurisdictionReport/helpers.ts +++ b/src/containers/pages/GenericJurisdictionReport/helpers.ts @@ -532,16 +532,6 @@ export const mdaLiteJurisdictionsColumns = [ ...drugDistributionColumns, ]; -export const mdaLitewardColumns = [ - { - Header: 'Name', - accessor: 'jurisdiction_name', - minWidth: 180, - }, - ...genderReportColumns, - ...censusPopColumns, -]; - /** IRS Table Columns * These are all the table columns for IRS that we know about. */ @@ -550,7 +540,6 @@ export const plansTableColumns: { [key: string]: Array { 'irsLiteZambiaJurisdictions2020', 'mdaJurisdictionsColumns', 'mdaLiteJurisdictionsColumns', - 'mdaLitewardColumns', 'namibia2019', 'smcJurisdictionsColumns', 'zambiaFocusArea2019', diff --git a/src/containers/pages/MDALite/cddReports/cdds.tsx b/src/containers/pages/MDALite/cddReports/cdds.tsx index 4e8741f681..75e7f3b18b 100644 --- a/src/containers/pages/MDALite/cddReports/cdds.tsx +++ b/src/containers/pages/MDALite/cddReports/cdds.tsx @@ -1,6 +1,6 @@ import { DrillDownTable } from '@onaio/drill-down-table'; import reducerRegistry from '@onaio/redux-reducer-registry'; -import superset from '@onaio/superset-connector'; +import superset, { SupersetAdhocFilterOption } from '@onaio/superset-connector'; import React, { useEffect, useState } from 'react'; import Helmet from 'react-helmet'; import { connect } from 'react-redux'; @@ -13,20 +13,13 @@ import Loading from '../../../../components/page/Loading'; import { SUPERSET_MAX_RECORDS, SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE, - SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES, - SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE, + SUPERSET_MDA_LITE_REPORTING_WARD_SLICE, } from '../../../../configs/env'; -import { HOME, MDA_LITE_REPORTING_TITLE } from '../../../../configs/lang'; -import { HOME_URL, REPORT_MDA_LITE_CDD_REPORT_URL } from '../../../../constants'; +import { MDA_LITE_REPORTING_TITLE } from '../../../../configs/lang'; +import { REPORT_MDA_LITE_CDD_REPORT_URL, REPORT_MDA_LITE_WARD_URL } from '../../../../constants'; import { displayError } from '../../../../helpers/errors'; import { RouteParams } from '../../../../helpers/utils'; import supersetFetch from '../../../../services/superset'; -import GenericJurisdictionsReducer, { - fetchGenericJurisdictions, - GenericJurisdiction, - getGenericJurisdictionById, - reducerName as genericJurisdictionsReducerName, -} from '../../../../store/ducks/generic/jurisdictions'; import cddReducer, { fetchMDALiteCDDs, makeMDALiteCDDsArraySelector, @@ -34,82 +27,79 @@ import cddReducer, { MDALiteCDDFilters, reducerName as cddReducerName, } from '../../../../store/ducks/superset/MDALite/cdd'; -import supervisorReducer, { - fetchMDALiteSupervisors, - makeMDALiteSupervisorsArraySelector, - MDALiteSupervisor, - MDALiteSupervisorFilters, - reducerName as supervisorReducerName, -} from '../../../../store/ducks/superset/MDALite/supervisors'; +import wardsReducer, { + fetchMDALiteWards, + makeMDALiteWardsArraySelector, + MDALiteWards, + reducerName as wardsReducerName, +} from '../../../../store/ducks/superset/MDALite/wards'; + import { cddReportColumns, getCddTableProps } from './helpers'; /** register the reducers */ -reducerRegistry.register(genericJurisdictionsReducerName, GenericJurisdictionsReducer); -reducerRegistry.register(supervisorReducerName, supervisorReducer); reducerRegistry.register(cddReducerName, cddReducer); +reducerRegistry.register(wardsReducerName, wardsReducer); /** declear selectors */ const CDDsArraySelector = makeMDALiteCDDsArraySelector(); -const supervisorsArraySelector = makeMDALiteSupervisorsArraySelector(); +const makeMDALiteWardsSelector = makeMDALiteWardsArraySelector(); /** MDA Lite CDD report props */ interface MDALiteCddReportsProps { cddData: MDALiteCDDData[]; fetchCDDs: typeof fetchMDALiteCDDs; - fetchJurisdictions: typeof fetchGenericJurisdictions; - fetchSupervisors: typeof fetchMDALiteSupervisors; + fetchWards: typeof fetchMDALiteWards; service: typeof supersetFetch; - slices: string[]; - supervisorData: MDALiteSupervisor[]; - wardData: GenericJurisdiction[]; + wardData: MDALiteWards[]; } /** Component for displaying MDA Lite CDD Reports */ const MDALiteCddReports = (props: MDALiteCddReportsProps & RouteComponentProps) => { - const { - cddData, - supervisorData, - wardData, - service, - slices, - fetchCDDs, - fetchJurisdictions, - fetchSupervisors, - } = props; + const { cddData, wardData, service, fetchCDDs, fetchWards } = props; const [loading, setLoading] = useState(false); const { params } = props.match; const { planId, jurisdictionId, supervisorId } = params; - const supervisorName = supervisorData[0]?.supervisor_name || cddData[0]?.supervisor_name; + const supervisorName = (cddData[0]?.supervisor_name || supervisorId) as string; async function loadData() { setLoading(cddData.length < 1); try { - if (jurisdictionId && !supervisorData.length) { - const fetchSupervisorParams = superset.getFormData(SUPERSET_MAX_RECORDS, [ - { comparator: jurisdictionId, operator: '==', subject: 'ward_id' }, - ]); - await service( - SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE, - fetchSupervisorParams - ).then(res => fetchSupervisors(res)); - } - if (planId && jurisdictionId && wardData.length) { - const fetchWardParams = superset.getFormData(SUPERSET_MAX_RECORDS, [ - { comparator: jurisdictionId, operator: '==', subject: 'jurisdiction_id' }, - { comparator: planId, operator: '==', subject: 'plan_id' }, - ]); - await service(slices[0], fetchWardParams).then(res => fetchJurisdictions(slices[0], res)); - } - if (jurisdictionId && supervisorId) { + const planIdFilter: SupersetAdhocFilterOption[] = []; + const jurisdictionFilter: SupersetAdhocFilterOption[] = []; + const supervisorFilter: SupersetAdhocFilterOption[] = []; + if (jurisdictionId && supervisorId && planId) { + jurisdictionFilter.push({ + comparator: jurisdictionId, + operator: '==', + subject: 'base_entity_id', + }); + planIdFilter.push({ comparator: planId, operator: '==', subject: 'plan_id' }); + supervisorFilter.push({ + comparator: supervisorId, + operator: '==', + subject: 'supervisor_name', + }); + // get cdd data const fetchCDDParams = superset.getFormData(SUPERSET_MAX_RECORDS, [ - { comparator: jurisdictionId, operator: '==', subject: 'ward_id' }, - { comparator: supervisorId, operator: '==', subject: 'supervisor_id' }, + ...planIdFilter, + ...jurisdictionFilter, + ...supervisorFilter, ]); await service(SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE, fetchCDDParams).then(res => fetchCDDs(res) ); + // get ward data + const fetchWardParams = superset.getFormData(SUPERSET_MAX_RECORDS, [ + ...planIdFilter, + ...jurisdictionFilter, + ]); + if (!wardData.length) { + await service(SUPERSET_MDA_LITE_REPORTING_WARD_SLICE, fetchWardParams).then(res => + fetchWards(res) + ); + } } } catch (e) { displayError(e); @@ -130,11 +120,11 @@ const MDALiteCddReports = (props: MDALiteCddReportsProps & RouteComponentProps; +type DispatchedStateProps = Pick; /** map state to props */ const mapStateToProps = ( @@ -204,26 +190,15 @@ const mapStateToProps = ( const cddFilters: MDALiteCDDFilters = { base_entity_id: jurisdictionId, plan_id: planId, - supervisor_id: supervisorId, + supervisor_name: supervisorId, }; - const supervisorFilters: MDALiteSupervisorFilters = { + const cddData = CDDsArraySelector(state, cddFilters); + const wardData = makeMDALiteWardsSelector(state, { base_entity_id: jurisdictionId, plan_id: planId, - }; - const cddData = CDDsArraySelector(state, cddFilters); - const supervisorData = supervisorsArraySelector(state, supervisorFilters); - const wardData: GenericJurisdiction[] = []; - if (jurisdictionId) { - defaultProps.slices.forEach((slice: string) => { - const jur = getGenericJurisdictionById(state, slice, jurisdictionId); - if (jur && jur.plan_id === planId) { - wardData.push(jur); - } - }); - } + }); return { cddData, - supervisorData, wardData, }; }; diff --git a/src/containers/pages/MDALite/cddReports/helpers.tsx b/src/containers/pages/MDALite/cddReports/helpers.tsx index 8ad6541e22..2fad2db795 100644 --- a/src/containers/pages/MDALite/cddReports/helpers.tsx +++ b/src/containers/pages/MDALite/cddReports/helpers.tsx @@ -1,6 +1,7 @@ import { Dictionary } from '@onaio/utils/dist/types/types'; import React from 'react'; import { RouteComponentProps } from 'react-router'; +import { Link } from 'react-router-dom'; import { Cell } from 'react-table'; import { defaultOptions, @@ -8,7 +9,7 @@ import { } from '../../../../components/Table/DrillDownFilters/utils'; import { NoDataComponent } from '../../../../components/Table/NoDataComponent'; import { indicatorThresholdsMDALite } from '../../../../configs/settings'; -import { QUERY_PARAM_TITLE } from '../../../../constants'; +import { REPORT_MDA_LITE_CDD_REPORT_URL } from '../../../../constants'; import { getIRSThresholdAdherenceIndicator } from '../../../../helpers/indicators'; import { drugDistributionColumns, @@ -18,6 +19,11 @@ import { /** supervisor columns */ export const supervisorColumns = [ { + Cell: (cell: Cell) => { + const original: Dictionary = cell.row.original; + const url = `${REPORT_MDA_LITE_CDD_REPORT_URL}/${original.plan_id}/${original.base_entity_id}/${original.supervisor_name}`; + return {cell.value}; + }, Header: 'Name', accessor: 'supervisor_name', }, @@ -69,7 +75,9 @@ export const getCddTableProps = ( renderInTopFilterBar: renderInFilterFactory({ ...defaultOptions, componentProps: props, - queryParam: QUERY_PARAM_TITLE, + showColumnHider: false, + showRowHeightPicker: false, + showSearch: false, }), renderNullDataComponent: () => , resize: true, diff --git a/src/containers/pages/MDALite/cddReports/supervisors.tsx b/src/containers/pages/MDALite/cddReports/supervisors.tsx index cf0dbb415e..e873b62394 100644 --- a/src/containers/pages/MDALite/cddReports/supervisors.tsx +++ b/src/containers/pages/MDALite/cddReports/supervisors.tsx @@ -1,6 +1,6 @@ import { DrillDownTable } from '@onaio/drill-down-table'; import reducerRegistry from '@onaio/redux-reducer-registry'; -import superset from '@onaio/superset-connector'; +import superset, { SupersetAdhocFilterOption } from '@onaio/superset-connector'; import React, { useEffect, useState } from 'react'; import Helmet from 'react-helmet'; import { connect } from 'react-redux'; @@ -12,24 +12,14 @@ import HeaderBreadcrumb from '../../../../components/page/HeaderBreadcrumb/Heade import Loading from '../../../../components/page/Loading'; import { SUPERSET_MAX_RECORDS, - SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES, SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE, + SUPERSET_MDA_LITE_REPORTING_WARD_SLICE, } from '../../../../configs/env'; -import { HOME, MDA_LITE_REPORTING_TITLE } from '../../../../configs/lang'; -import { - HOME_URL, - REPORT_MDA_LITE_CDD_REPORT_URL, - REPORT_MDA_LITE_PLAN_URL, -} from '../../../../constants'; +import { MDA_LITE_REPORTING_TITLE } from '../../../../configs/lang'; +import { REPORT_MDA_LITE_WARD_URL } from '../../../../constants'; import { displayError } from '../../../../helpers/errors'; import { RouteParams } from '../../../../helpers/utils'; import supersetFetch from '../../../../services/superset'; -import GenericJurisdictionsReducer, { - fetchGenericJurisdictions, - GenericJurisdiction, - getGenericJurisdictionById, - reducerName as genericJurisdictionsReducerName, -} from '../../../../store/ducks/generic/jurisdictions'; import supervisorReducer, { fetchMDALiteSupervisors, makeMDALiteSupervisorsArraySelector, @@ -37,55 +27,71 @@ import supervisorReducer, { MDALiteSupervisorFilters, reducerName as supervisorReducerName, } from '../../../../store/ducks/superset/MDALite/supervisors'; +import wardsReducer, { + fetchMDALiteWards, + makeMDALiteWardsArraySelector, + MDALiteWards, + reducerName as wardsReducerName, +} from '../../../../store/ducks/superset/MDALite/wards'; import { getCddTableProps, supervisorColumns } from './helpers'; /** register the reducers */ -reducerRegistry.register(genericJurisdictionsReducerName, GenericJurisdictionsReducer); reducerRegistry.register(supervisorReducerName, supervisorReducer); +reducerRegistry.register(wardsReducerName, wardsReducer); /** declear selectors */ const supervisorsArraySelector = makeMDALiteSupervisorsArraySelector(); +const makeMDALiteWardsSelector = makeMDALiteWardsArraySelector(); /** MDA-Lite supervisor reports props */ interface MDALiteSupervisorReportsProps { - fetchJurisdictions: typeof fetchGenericJurisdictions; fetchSupervisors: typeof fetchMDALiteSupervisors; + fetchWards: typeof fetchMDALiteWards; service: typeof supersetFetch; - slices: string[]; supervisorData: MDALiteSupervisor[]; - wardData: GenericJurisdiction[]; + wardData: MDALiteWards[]; } /** MDA-Lite supervisor reports table component */ const MDALiteSupervisorReports = ( props: MDALiteSupervisorReportsProps & RouteComponentProps ) => { - const { supervisorData, wardData, service, slices, fetchJurisdictions, fetchSupervisors } = props; + const { supervisorData, wardData, service, fetchWards, fetchSupervisors } = props; const [loading, setLoading] = useState(false); const { params } = props.match; const { planId, jurisdictionId, supervisorId } = params; - const wardName = wardData[0]?.jurisdiction_name; + const wardName = wardData[0]?.ward_name; async function loadData() { setLoading(supervisorData.length < 1); try { - if (jurisdictionId && !supervisorData.length) { - const fetchSupervisorParams = superset.getFormData(SUPERSET_MAX_RECORDS, [ - { comparator: jurisdictionId, operator: '==', subject: 'ward_id' }, - ]); - await service( - SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE, - fetchSupervisorParams - ).then(res => fetchSupervisors(res)); + const planIdFilter: SupersetAdhocFilterOption[] = []; + const jurisdictionFilter: SupersetAdhocFilterOption[] = []; + if (jurisdictionId) { + jurisdictionFilter.push({ + comparator: jurisdictionId, + operator: '==', + subject: 'base_entity_id', + }); + } + if (planId) { + planIdFilter.push({ comparator: planId, operator: '==', subject: 'plan_id' }); } - if (planId && jurisdictionId && wardData.length) { - const fetchWardParams = superset.getFormData(SUPERSET_MAX_RECORDS, [ - { comparator: jurisdictionId, operator: '==', subject: 'jurisdiction_id' }, - { comparator: planId, operator: '==', subject: 'plan_id' }, - ]); - await service(slices[0], fetchWardParams).then(res => fetchJurisdictions(slices[0], res)); + // get supervisors data + const fetchDataParams = superset.getFormData(SUPERSET_MAX_RECORDS, [ + ...planIdFilter, + ...jurisdictionFilter, + ]); + await service(SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE, fetchDataParams).then(res => + fetchSupervisors(res) + ); + // get ward data + if (!wardData.length) { + await service(SUPERSET_MDA_LITE_REPORTING_WARD_SLICE, fetchDataParams).then(res => + fetchWards(res) + ); } } catch (e) { displayError(e); @@ -100,19 +106,14 @@ const MDALiteSupervisorReports = ( const currentPage = { label: wardName, - url: `${REPORT_MDA_LITE_CDD_REPORT_URL}/${planId}/${wardData[0]?.jurisdiction_id}`, + url: '', }; const breadcrumbProps = { currentPage, pages: [ { - label: HOME, - url: HOME_URL, - }, - // change to subcounty name - { - label: wardData[0]?.jurisdiction_name, - url: `${REPORT_MDA_LITE_PLAN_URL}/${planId}/${wardData[0]?.jurisdiction_parent_id}`, + label: '...', + url: `${REPORT_MDA_LITE_WARD_URL}/${planId}/${wardData[0]?.parent_id}`, }, ], }; @@ -147,10 +148,9 @@ const MDALiteSupervisorReports = ( /** default props */ const defaultProps: MDALiteSupervisorReportsProps = { - fetchJurisdictions: fetchGenericJurisdictions, fetchSupervisors: fetchMDALiteSupervisors, + fetchWards: fetchMDALiteWards, service: supersetFetch, - slices: SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES.split(','), supervisorData: [], wardData: [], }; @@ -161,8 +161,8 @@ export { MDALiteSupervisorReports }; /** map dispatch to props */ const mapDispatchToProps = { - fetchJurisdictions: fetchGenericJurisdictions, fetchSupervisors: fetchMDALiteSupervisors, + fetchWards: fetchMDALiteWards, }; /** Dispatched State Props */ @@ -180,15 +180,10 @@ const mapStateToProps = ( plan_id: planId, }; const supervisorData = supervisorsArraySelector(state, supervisorFilters); - const wardData: GenericJurisdiction[] = []; - if (jurisdictionId) { - defaultProps.slices.forEach((slice: string) => { - const jur = getGenericJurisdictionById(state, slice, jurisdictionId); - if (jur && jur.plan_id === planId) { - wardData.push(jur); - } - }); - } + const wardData = makeMDALiteWardsSelector(state, { + base_entity_id: jurisdictionId, + plan_id: planId, + }); return { supervisorData, wardData, diff --git a/src/containers/pages/MDALite/jurisdictionsReport/index.tsx b/src/containers/pages/MDALite/jurisdictionsReport/index.tsx index dfd866bebf..1b1697157c 100644 --- a/src/containers/pages/MDALite/jurisdictionsReport/index.tsx +++ b/src/containers/pages/MDALite/jurisdictionsReport/index.tsx @@ -11,7 +11,6 @@ import { SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES, SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_FOCUS_AREA_LEVEL, SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE, - SUPERSET_MDA_LITE_REPORTING_WARD_COLUMNS, } from '../../../../configs/env'; import { MDA_LITE_REPORTING_TITLE } from '../../../../configs/lang'; import { REPORT_MDA_LITE_PLAN_URL } from '../../../../constants'; @@ -58,7 +57,7 @@ const defaultProps: GenericJurisdictionProps = { cellComponent: MDALiteTableCell, fetchJurisdictions: fetchGenericJurisdictions, fetchPlans: genericFetchPlans, - focusAreaColumn: SUPERSET_MDA_LITE_REPORTING_WARD_COLUMNS, + focusAreaColumn: SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_COLUMNS, focusAreaLevel: SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_FOCUS_AREA_LEVEL, hasChildren: hasChildrenFunc, jurisdictionColumn: SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_COLUMNS, diff --git a/src/containers/pages/MDALite/wardReports/helpers.tsx b/src/containers/pages/MDALite/wardReports/helpers.tsx index 42e011fc38..941312fada 100644 --- a/src/containers/pages/MDALite/wardReports/helpers.tsx +++ b/src/containers/pages/MDALite/wardReports/helpers.tsx @@ -1,10 +1,19 @@ import { DrillDownColumn } from '@onaio/drill-down-table/dist/types'; import { Dictionary } from '@onaio/utils'; +import React from 'react'; +import { Link } from 'react-router-dom'; +import { Cell } from 'react-table'; +import { REPORT_MDA_LITE_CDD_REPORT_URL } from '../../../../constants'; import { censusPopColumns, genderReportColumns } from '../../GenericJurisdictionReport/helpers'; /** wards columns */ export const wardColumns: Array> = [ { + Cell: (cell: Cell) => { + const original: Dictionary = cell.row.original; + const url = `${REPORT_MDA_LITE_CDD_REPORT_URL}/${original.plan_id}/${original.base_entity_id}`; + return {cell.value}; + }, Header: 'Name', accessor: 'ward_name', }, diff --git a/src/store/ducks/superset/MDALite/cdd.ts b/src/store/ducks/superset/MDALite/cdd.ts index 92e77f2461..298f476cdc 100644 --- a/src/store/ducks/superset/MDALite/cdd.ts +++ b/src/store/ducks/superset/MDALite/cdd.ts @@ -74,6 +74,7 @@ export interface MDALiteCDDFilters { supervisor_id?: string /** supervisor id */; base_entity_id?: string /** ward id */; plan_id?: string /** plan id */; + supervisor_name?: string /** supervisor name */; } /** MDALiteCDDsArrayBaseSelector select an array of all CDDs @@ -96,6 +97,14 @@ export const getName = (_: Partial, props: MDALiteCDDFilters) => props.cd */ export const getSupervisorId = (_: Partial, props: MDALiteCDDFilters) => props.supervisor_id; +/** + * Gets supervisor name from filters + * @param state - the redux store + * @param props - the cdd filters object + */ +export const getSupervisorName = (_: Partial, props: MDALiteCDDFilters) => + props.supervisor_name; + /** * Gets plan id from filters * @param state - the redux store @@ -120,6 +129,18 @@ export const getMDALiteCDDsArrayByName = () => cddName ? cdds.filter(cdd => cdd.cdd_name.toLowerCase().includes(cddName.toLowerCase())) : cdds ); +/** + * Gets an array of CDDs filtered by supervisor name + * @param {Partial} state - the redux store + * @param {MDALiteCDDFilters} props - the CDDs filters object + */ +export const getMDALiteCDDsArrayBySupervisorName = () => + createSelector([MDALiteCDDsArrayBaseSelector, getSupervisorName], (cdds, supervisorName) => + supervisorName + ? cdds.filter(cdd => cdd.supervisor_name.toLowerCase().includes(supervisorName.toLowerCase())) + : cdds + ); + /** * Gets an array of CDDs objects filtered by supervisor id * @param {Partial} state - the redux store @@ -157,6 +178,7 @@ export const getMDALiteCDDsArrayByWardId = () => * - supervisor_id * - base_entity_id * - plan_id + * - suprevisor_name * * These filter params are all optional and are supplied via the prop parameter. * @@ -175,7 +197,8 @@ export const makeMDALiteCDDsArraySelector = () => { getMDALiteCDDsArrayBySupervisorId(), getMDALiteCDDsArrayByWardId(), getMDALiteCDDsArrayByPlanId(), + getMDALiteCDDsArrayBySupervisorName(), ], - (cdd1, cdd2, cdd3, cdd4) => intersect([cdd1, cdd2, cdd3, cdd4], JSON.stringify) + (cdd1, cdd2, cdd3, cdd4, cdd5) => intersect([cdd1, cdd2, cdd3, cdd4, cdd5], JSON.stringify) ); }; From b98abb4f620bfa0c8f1983a800556e8bd6383691 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Thu, 8 Apr 2021 14:56:08 +0300 Subject: [PATCH 27/40] Add MDA Lite Map component --- src/App/App.tsx | 8 + src/components/GisidaLite/helpers.tsx | 1 + src/constants.tsx | 1 + .../map/active/helpers/utils.tsx | 9 +- src/containers/pages/MDALite/map/index.tsx | 327 ++++++++++++++++++ .../pages/MDALite/wardReports/index.tsx | 3 +- src/helpers/utils.tsx | 1 + 7 files changed, 347 insertions(+), 3 deletions(-) create mode 100644 src/containers/pages/MDALite/map/index.tsx diff --git a/src/App/App.tsx b/src/App/App.tsx index f6ecfe1a83..6bde3256fe 100644 --- a/src/App/App.tsx +++ b/src/App/App.tsx @@ -129,6 +129,7 @@ import JurisdictionMetadata from '../containers/pages/JurisdictionMetadata'; import ConnectedMDALiteCddReports from '../containers/pages/MDALite/cddReports/cdds'; import ConnectedMDALiteSupervisorReports from '../containers/pages/MDALite/cddReports/supervisors'; import ConnectedMdaLiteJurisdictionReport from '../containers/pages/MDALite/jurisdictionsReport'; +import ConnectedMDALiteMapReport from '../containers/pages/MDALite/map'; import ConnectedMDALitePlansList from '../containers/pages/MDALite/plans'; import ConnectedMDALiteWardsReport from '../containers/pages/MDALite/wardReports'; import ConnectedChildReports from '../containers/pages/MDAPoint/ChildReports'; @@ -311,6 +312,13 @@ const App = () => { path={`${REPORT_MDA_LITE_PLAN_URL}/:planId/:jurisdictionId`} component={ConnectedMdaLiteJurisdictionReport} /> + ) => { + const { + wardData, + service, + fetchWards, + fetchPlans, + planData, + subcountyData, + slices, + fetchJurisdictions, + baseUrl, + } = props; + const [loading, setLoading] = useState(false); + + const { params } = props.match; + const { planId, jurisdictionId } = params; + + // load data + async function loadData() { + setLoading(!wardData); + try { + const planIdFilter: SupersetAdhocFilterOption[] = []; + const jurisdictionFilter: SupersetAdhocFilterOption[] = []; + if (jurisdictionId && planId) { + jurisdictionFilter.push({ + comparator: jurisdictionId, + operator: '==', + subject: 'jurisdiction_id', + }); + planIdFilter.push({ comparator: planId, operator: '==', subject: 'plan_id' }); + // get ward data + const supersetFilters = superset.getFormData(SUPERSET_MAX_RECORDS, [ + ...planIdFilter, + ...jurisdictionFilter, + ]); + await service(SUPERSET_MDA_LITE_REPORTING_WARD_GEOJSON_SLICE, supersetFilters).then(res => + fetchWards(SUPERSET_MDA_LITE_REPORTING_WARD_GEOJSON_SLICE, res) + ); + // get plan data + if (!planData) { + const planDataFilter = superset.getFormData(SUPERSET_MAX_RECORDS, [...planIdFilter]); + await service(SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE, planDataFilter).then(res => + fetchPlans(res) + ); + } + // get subcounty data + if (!subcountyData.length) { + slices.forEach(async slice => { + await service(slice, supersetFilters).then(res => fetchJurisdictions(slice, res)); + }); + } + } + } catch (e) { + displayError(e); + } finally { + setLoading(false); + } + } + + useEffect(() => { + loadData().catch(err => displayError(err)); + }, [planId, jurisdictionId]); + + if (loading) { + return ; + } + + if (!jurisdictionId || !planId) { + return ; + } + + const jurBreadcrumb = []; + if (planData && subcountyData.length) { + jurBreadcrumb.push({ + label: planData.plan_title, + url: `${baseUrl}/${planData.plan_id}`, + }); + const paths = subcountyData[0].jurisdiction_path; + const names = subcountyData[0].jurisdiction_name_path; + if (paths?.length && names?.length) { + paths.forEach((_, index) => { + jurBreadcrumb.push({ + label: names[index], + url: `${baseUrl}/${planData.plan_id}/${paths[index]}`, + }); + }); + } + } + + const currentPage = { + label: subcountyData[0]?.jurisdiction_name || SUBCOUNTY_LABEL, + url: '', + }; + + const pageTitle = `${MDA_LITE_REPORTING_TITLE}: ${currentPage.label}`; + const breadcrumbProps = { + currentPage, + pages: [ + { + label: HOME, + url: HOME_URL, + }, + { + label: MDA_LITE_REPORTING_TITLE, + url: baseUrl, + }, + ...jurBreadcrumb, + ], + }; + + // get map zoom, center and bounds + const { zoom, mapBounds, mapCenter } = getZoomCenterAndBounds( + wardData, + null, + DefaultMapDimensions + ); + + const polygons = wardData?.features.filter((feature: any) => + [POLYGON].includes(feature.geometry.type) + ); + + // get each polygon centroid + const centroidPoints = polygons?.map(polygon => { + const genPolygon = turfPolygon((polygon as Dictionary).geometry?.coordinates); + const genCentroids = centroid(genPolygon); + return { + ...genCentroids, + properties: polygon.properties, + }; + }); + + const polygonsFC = polygons ? featureCollection(polygons) : null; + const pointsFC = centroidPoints ? featureCollection(centroidPoints) : null; + + const preferedColor = '#FFDC00'; + const wardLayers = buildGsLiteLayers( + MDA_LITE_STRUCTURES, + null, + polygonsFC as geojson.FeatureCollection, + { + polygonLinePaintColor: preferedColor, + } + ); + + // layer for drawing displaying text on map + if (pointsFC) { + wardLayers.push( + + ); + } + + return ( +
+ + {pageTitle} + + + + +

{pageTitle}

+
+ {wardLayers.length ? ( + + ) : ( +
{MAP_LOAD_ERROR}
+ )} +
+ +
+
+ ); +}; + +const defaultProps: MDALiteMapProps = { + baseUrl: REPORT_MDA_LITE_PLAN_URL, + fetchJurisdictions: fetchGenericJurisdictions, + fetchPlans: genericFetchPlans, + fetchWards: fetchGenericStructures, + planData: null, + service: supersetFetch, + slices: SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES.split(','), + subcountyData: [], + wardData: null, +}; + +MDALiteMapReport.defaultProps = defaultProps; +export { MDALiteMapReport as MDALiteWardsReport }; + +/** map dispatch to props */ +const mapDispatchToProps = { + fetchJurisdictions: fetchGenericJurisdictions, + fetchPlans: genericFetchPlans, + fetchWards: fetchGenericStructures, +}; + +type DispatchedStateProps = Pick; + +/** map state to props */ +const mapStateToProps = ( + state: Partial, + ownProps: RouteComponentProps +): DispatchedStateProps => { + const { params } = ownProps.match; + const { planId, jurisdictionId } = params; + const planData = planId ? getPlanByIdSelector(state, planId) : null; + const wardData = getGenericStructures( + state, + SUPERSET_MDA_LITE_REPORTING_WARD_GEOJSON_SLICE, + jurisdictionId, + planId + ); + const subcountyData: GenericJurisdiction[] = []; + if (jurisdictionId) { + defaultProps.slices.forEach((slice: string) => { + const jur = getGenericJurisdictionByJurisdictionId(state, slice, jurisdictionId); + if (jur && jur.plan_id === planId) { + subcountyData.push(jur); + } + }); + } + return { + planData, + subcountyData, + wardData, + }; +}; + +/** Connected MDALiteMapReport component */ +const ConnectedMDALiteMapReport = connect(mapStateToProps, mapDispatchToProps)(MDALiteMapReport); + +export default ConnectedMDALiteMapReport; diff --git a/src/containers/pages/MDALite/wardReports/index.tsx b/src/containers/pages/MDALite/wardReports/index.tsx index 50a658b1b8..6a346d8c50 100644 --- a/src/containers/pages/MDALite/wardReports/index.tsx +++ b/src/containers/pages/MDALite/wardReports/index.tsx @@ -73,6 +73,7 @@ const MDALiteWardsReport = ( wardData, service, fetchWards, + fetchPlans, planData, subcountyData, slices, @@ -114,7 +115,7 @@ const MDALiteWardsReport = ( if (!planData) { const planDataFilter = superset.getFormData(SUPERSET_MAX_RECORDS, [...planIdFilter]); await service(SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE, planDataFilter).then(res => - fetchWards(res) + fetchPlans(res) ); } if (!subcountyData.length) { diff --git a/src/helpers/utils.tsx b/src/helpers/utils.tsx index ad36d91eb8..c88568104d 100644 --- a/src/helpers/utils.tsx +++ b/src/helpers/utils.tsx @@ -233,6 +233,7 @@ export const ConfigStore = ( mapConfigStyle || (DIGITAL_GLOBE_CONNECT_ID ? { + glyphs: 'mapbox://fonts/mapbox/{fontstack}/{range}.pbf', layers: [ { id: 'earthwatch-basemap', From 2d831cc5954877882d83bc64618c3245da7dcecb Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Thu, 8 Apr 2021 15:17:57 +0300 Subject: [PATCH 28/40] Fix failling test --- .../jurisdictionsReport/tests/__snapshots__/index.test.tsx.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/pages/MDALite/jurisdictionsReport/tests/__snapshots__/index.test.tsx.snap b/src/containers/pages/MDALite/jurisdictionsReport/tests/__snapshots__/index.test.tsx.snap index 6b13f1015b..b0312c1873 100644 --- a/src/containers/pages/MDALite/jurisdictionsReport/tests/__snapshots__/index.test.tsx.snap +++ b/src/containers/pages/MDALite/jurisdictionsReport/tests/__snapshots__/index.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`components/MDA/Lite/Reports/JurisdictionReport renders correctly 1`] = `"{\\"history\\":{\\"length\\":1,\\"action\\":\\"POP\\",\\"location\\":{\\"pathname\\":\\"/\\",\\"search\\":\\"\\",\\"hash\\":\\"\\"}},\\"match\\":{\\"isExact\\":true,\\"params\\":{\\"planId\\":\\"5e396185-6094-4817-9dd4-24bcbbc698b0\\"},\\"path\\":\\"/intervention/mda-lite/report/:planId\\",\\"url\\":\\"/intervention/mda-lite/report/5e396185-6094-4817-9dd4-24bcbbc698b0\\"},\\"jurisdictions\\":[{\\"id\\":\\"165b0ae7-92fa-5b70-a7bb-283797f565c2\\",\\"plan_id\\":\\"5e396185-6094-4817-9dd4-24bcbbc698b0\\",\\"jurisdiction_id\\":\\"25e8a10b-737c-44e7-bfff-3b6344b1126f\\",\\"jurisdiction_parent_id\\":\\"\\",\\"jurisdiction_name\\":\\"Kenya\\",\\"jurisdiction_depth\\":0,\\"jurisdiction_path\\":[],\\"jurisdiction_name_path\\":[],\\"treated_male_1_4\\":\\"200\\",\\"treated_male_5_14\\":0,\\"treated_male_above_15\\":0,\\"treated_female_1_4\\":0,\\"treated_female_5_14\\":0,\\"treated_female_above_15\\":0,\\"total_males\\":20,\\"total_females\\":3,\\"total_all_genders\\":20,\\"supervisor_distributed\\":0,\\"received_number\\":0,\\"adminstered\\":0,\\"damaged\\":0,\\"adverse\\":0,\\"remaining_with_cdd\\":10,\\"returned_to_supervisor\\":3,\\"census_pop_target\\":200,\\"treatment_coverage\\":0.8,\\"other_pop_target\\":500,\\"other_pop_coverage\\":0.65},{\\"id\\":\\"89bb4010-38ee-5eac-b92a-4deafa62765a\\",\\"plan_id\\":\\"5e396185-6094-4817-9dd4-24bcbbc698b0\\",\\"jurisdiction_id\\":\\"38482d8c-e6ed-433b-860f-96c9cd09b4a3\\",\\"jurisdiction_parent_id\\":\\"3c63f48e-bb86-42e5-b3ff-bc539fbf5295\\",\\"jurisdiction_name\\":\\"emuhaya\\",\\"jurisdiction_depth\\":2,\\"jurisdiction_path\\":[\\"25e8a10b-737c-44e7-bfff-3b6344b1126f\\",\\"3c63f48e-bb86-42e5-b3ff-bc539fbf5295\\"],\\"jurisdiction_name_path\\":[\\"Kenya\\",\\"Vihiga\\"],\\"treated_male_1_4\\":0,\\"treated_male_5_14\\":0,\\"treated_male_above_15\\":0,\\"treated_female_1_4\\":0,\\"treated_female_5_14\\":0,\\"treated_female_above_15\\":0,\\"total_males\\":19,\\"total_females\\":100,\\"total_all_genders\\":0,\\"supervisor_distributed\\":0,\\"received_number\\":0,\\"adminstered\\":0,\\"damaged\\":0,\\"adverse\\":0,\\"remaining_with_cdd\\":0,\\"returned_to_supervisor\\":0,\\"census_pop_target\\":300,\\"treatment_coverage\\":0.9,\\"other_pop_target\\":400,\\"other_pop_coverage\\":0.6},{\\"id\\":\\"541e7ed0-2dc6-586e-b563-4c988c5ac585\\",\\"plan_id\\":\\"5e396185-6094-4817-9dd4-24bcbbc698b0\\",\\"jurisdiction_id\\":\\"3c63f48e-bb86-42e5-b3ff-bc539fbf5295\\",\\"jurisdiction_parent_id\\":\\"25e8a10b-737c-44e7-bfff-3b6344b1126f\\",\\"jurisdiction_name\\":\\"vihiga\\",\\"jurisdiction_depth\\":1,\\"jurisdiction_path\\":[\\"25e8a10b-737c-44e7-bfff-3b6344b1126f\\"],\\"jurisdiction_name_path\\":[\\"Kenya\\"],\\"treated_male_1_4\\":0,\\"treated_male_5_14\\":0,\\"treated_male_above_15\\":0,\\"treated_female_1_4\\":0,\\"treated_female_5_14\\":0,\\"treated_female_above_15\\":0,\\"total_males\\":0,\\"total_females\\":0,\\"total_all_genders\\":0,\\"supervisor_distributed\\":0,\\"received_number\\":0,\\"adminstered\\":0,\\"damaged\\":0,\\"adverse\\":0,\\"remaining_with_cdd\\":0,\\"returned_to_supervisor\\":0},{\\"id\\":\\"c477af78-93ce-51f8-bf1e-0bae3a80fcae\\",\\"plan_id\\":\\"5e396185-6094-4817-9dd4-24bcbbc698b0\\",\\"jurisdiction_id\\":\\"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\\",\\"jurisdiction_parent_id\\":\\"3c63f48e-bb86-42e5-b3ff-bc539fbf5295\\",\\"jurisdiction_name\\":\\"hamisi\\",\\"jurisdiction_depth\\":2,\\"jurisdiction_path\\":[\\"25e8a10b-737c-44e7-bfff-3b6344b1126f\\",\\"3c63f48e-bb86-42e5-b3ff-bc539fbf5295\\"],\\"jurisdiction_name_path\\":[\\"Kenya\\",\\"Vihiga\\"],\\"treated_male_1_4\\":0,\\"treated_male_5_14\\":0,\\"treated_male_above_15\\":0,\\"treated_female_1_4\\":0,\\"treated_female_5_14\\":0,\\"treated_female_above_15\\":0,\\"total_males\\":0,\\"total_females\\":0,\\"total_all_genders\\":0,\\"supervisor_distributed\\":0,\\"received_number\\":0,\\"adminstered\\":0,\\"damaged\\":0,\\"adverse\\":0,\\"remaining_with_cdd\\":0,\\"returned_to_supervisor\\":0}],\\"plan\\":{\\"plan_id\\":\\"5e396185-6094-4817-9dd4-24bcbbc698b0\\",\\"jurisdiction_root_parent_ids\\":\\"[\\\\\\"bac41d87-b09d-4e76-be3b-3b6d07399891\\\\\\"]\\",\\"plan_title\\":\\"MDA-Lite 2021-03-02\\",\\"plan_name\\":\\"MDA-Lite-2021-03-02\\",\\"plan_status\\":\\"active\\",\\"plan_date\\":1614643200000,\\"plan_effective_period_start\\":1614643200000,\\"plan_effective_period_end\\":1616371200000,\\"plan_intervention_type\\":\\"MDA-Lite\\"},\\"baseURL\\":\\"/intervention/mda-lite/report\\",\\"focusAreaColumn\\":\\"mdaLitewardColumns\\",\\"jurisdictionColumn\\":\\"mdaLiteJurisdictionsColumns\\",\\"pageTitle\\":\\"MDA Lite Reporting\\",\\"reportingPlanSlice\\":\\"1\\",\\"slices\\":[\\"1\\",\\"2\\"]}"`; +exports[`components/MDA/Lite/Reports/JurisdictionReport renders correctly 1`] = `"{\\"history\\":{\\"length\\":1,\\"action\\":\\"POP\\",\\"location\\":{\\"pathname\\":\\"/\\",\\"search\\":\\"\\",\\"hash\\":\\"\\"}},\\"match\\":{\\"isExact\\":true,\\"params\\":{\\"planId\\":\\"5e396185-6094-4817-9dd4-24bcbbc698b0\\"},\\"path\\":\\"/intervention/mda-lite/report/:planId\\",\\"url\\":\\"/intervention/mda-lite/report/5e396185-6094-4817-9dd4-24bcbbc698b0\\"},\\"jurisdictions\\":[{\\"id\\":\\"165b0ae7-92fa-5b70-a7bb-283797f565c2\\",\\"plan_id\\":\\"5e396185-6094-4817-9dd4-24bcbbc698b0\\",\\"jurisdiction_id\\":\\"25e8a10b-737c-44e7-bfff-3b6344b1126f\\",\\"jurisdiction_parent_id\\":\\"\\",\\"jurisdiction_name\\":\\"Kenya\\",\\"jurisdiction_depth\\":0,\\"jurisdiction_path\\":[],\\"jurisdiction_name_path\\":[],\\"treated_male_1_4\\":\\"200\\",\\"treated_male_5_14\\":0,\\"treated_male_above_15\\":0,\\"treated_female_1_4\\":0,\\"treated_female_5_14\\":0,\\"treated_female_above_15\\":0,\\"total_males\\":20,\\"total_females\\":3,\\"total_all_genders\\":20,\\"supervisor_distributed\\":0,\\"received_number\\":0,\\"adminstered\\":0,\\"damaged\\":0,\\"adverse\\":0,\\"remaining_with_cdd\\":10,\\"returned_to_supervisor\\":3,\\"census_pop_target\\":200,\\"treatment_coverage\\":0.8,\\"other_pop_target\\":500,\\"other_pop_coverage\\":0.65},{\\"id\\":\\"89bb4010-38ee-5eac-b92a-4deafa62765a\\",\\"plan_id\\":\\"5e396185-6094-4817-9dd4-24bcbbc698b0\\",\\"jurisdiction_id\\":\\"38482d8c-e6ed-433b-860f-96c9cd09b4a3\\",\\"jurisdiction_parent_id\\":\\"3c63f48e-bb86-42e5-b3ff-bc539fbf5295\\",\\"jurisdiction_name\\":\\"emuhaya\\",\\"jurisdiction_depth\\":2,\\"jurisdiction_path\\":[\\"25e8a10b-737c-44e7-bfff-3b6344b1126f\\",\\"3c63f48e-bb86-42e5-b3ff-bc539fbf5295\\"],\\"jurisdiction_name_path\\":[\\"Kenya\\",\\"Vihiga\\"],\\"treated_male_1_4\\":0,\\"treated_male_5_14\\":0,\\"treated_male_above_15\\":0,\\"treated_female_1_4\\":0,\\"treated_female_5_14\\":0,\\"treated_female_above_15\\":0,\\"total_males\\":19,\\"total_females\\":100,\\"total_all_genders\\":0,\\"supervisor_distributed\\":0,\\"received_number\\":0,\\"adminstered\\":0,\\"damaged\\":0,\\"adverse\\":0,\\"remaining_with_cdd\\":0,\\"returned_to_supervisor\\":0,\\"census_pop_target\\":300,\\"treatment_coverage\\":0.9,\\"other_pop_target\\":400,\\"other_pop_coverage\\":0.6},{\\"id\\":\\"541e7ed0-2dc6-586e-b563-4c988c5ac585\\",\\"plan_id\\":\\"5e396185-6094-4817-9dd4-24bcbbc698b0\\",\\"jurisdiction_id\\":\\"3c63f48e-bb86-42e5-b3ff-bc539fbf5295\\",\\"jurisdiction_parent_id\\":\\"25e8a10b-737c-44e7-bfff-3b6344b1126f\\",\\"jurisdiction_name\\":\\"vihiga\\",\\"jurisdiction_depth\\":1,\\"jurisdiction_path\\":[\\"25e8a10b-737c-44e7-bfff-3b6344b1126f\\"],\\"jurisdiction_name_path\\":[\\"Kenya\\"],\\"treated_male_1_4\\":0,\\"treated_male_5_14\\":0,\\"treated_male_above_15\\":0,\\"treated_female_1_4\\":0,\\"treated_female_5_14\\":0,\\"treated_female_above_15\\":0,\\"total_males\\":0,\\"total_females\\":0,\\"total_all_genders\\":0,\\"supervisor_distributed\\":0,\\"received_number\\":0,\\"adminstered\\":0,\\"damaged\\":0,\\"adverse\\":0,\\"remaining_with_cdd\\":0,\\"returned_to_supervisor\\":0},{\\"id\\":\\"c477af78-93ce-51f8-bf1e-0bae3a80fcae\\",\\"plan_id\\":\\"5e396185-6094-4817-9dd4-24bcbbc698b0\\",\\"jurisdiction_id\\":\\"f2482d8c-e6ed-433b-860f-96c9cd09b4a3\\",\\"jurisdiction_parent_id\\":\\"3c63f48e-bb86-42e5-b3ff-bc539fbf5295\\",\\"jurisdiction_name\\":\\"hamisi\\",\\"jurisdiction_depth\\":2,\\"jurisdiction_path\\":[\\"25e8a10b-737c-44e7-bfff-3b6344b1126f\\",\\"3c63f48e-bb86-42e5-b3ff-bc539fbf5295\\"],\\"jurisdiction_name_path\\":[\\"Kenya\\",\\"Vihiga\\"],\\"treated_male_1_4\\":0,\\"treated_male_5_14\\":0,\\"treated_male_above_15\\":0,\\"treated_female_1_4\\":0,\\"treated_female_5_14\\":0,\\"treated_female_above_15\\":0,\\"total_males\\":0,\\"total_females\\":0,\\"total_all_genders\\":0,\\"supervisor_distributed\\":0,\\"received_number\\":0,\\"adminstered\\":0,\\"damaged\\":0,\\"adverse\\":0,\\"remaining_with_cdd\\":0,\\"returned_to_supervisor\\":0}],\\"plan\\":{\\"plan_id\\":\\"5e396185-6094-4817-9dd4-24bcbbc698b0\\",\\"jurisdiction_root_parent_ids\\":\\"[\\\\\\"bac41d87-b09d-4e76-be3b-3b6d07399891\\\\\\"]\\",\\"plan_title\\":\\"MDA-Lite 2021-03-02\\",\\"plan_name\\":\\"MDA-Lite-2021-03-02\\",\\"plan_status\\":\\"active\\",\\"plan_date\\":1614643200000,\\"plan_effective_period_start\\":1614643200000,\\"plan_effective_period_end\\":1616371200000,\\"plan_intervention_type\\":\\"MDA-Lite\\"},\\"baseURL\\":\\"/intervention/mda-lite/report\\",\\"focusAreaColumn\\":\\"mdaLiteJurisdictionsColumns\\",\\"jurisdictionColumn\\":\\"mdaLiteJurisdictionsColumns\\",\\"pageTitle\\":\\"MDA Lite Reporting\\",\\"reportingPlanSlice\\":\\"1\\",\\"slices\\":[\\"1\\",\\"2\\"]}"`; exports[`components/MDA/Lite/Reports/JurisdictionReport renders correctly: breadcrumb item-1 1`] = `"Home"`; From dce92b96d188b9af0da5f7add686f2110acf2049 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Thu, 8 Apr 2021 16:13:56 +0300 Subject: [PATCH 29/40] Test MDA Lite wards Reducer --- .../ducks/superset/MDALite/tests/fixtures.ts | 159 + .../superset/MDALite/tests/wards.test.ts | 85 + .../superset/MDALite/tests/wardsGeojson.json | 2546 +++++++++++++++++ 3 files changed, 2790 insertions(+) create mode 100644 src/store/ducks/superset/MDALite/tests/wards.test.ts create mode 100644 src/store/ducks/superset/MDALite/tests/wardsGeojson.json diff --git a/src/store/ducks/superset/MDALite/tests/fixtures.ts b/src/store/ducks/superset/MDALite/tests/fixtures.ts index 329847cb34..ac041e9614 100644 --- a/src/store/ducks/superset/MDALite/tests/fixtures.ts +++ b/src/store/ducks/superset/MDALite/tests/fixtures.ts @@ -1,4 +1,6 @@ // tslint:disable: object-literal-sort-keys +import wardGeojsonDataJson from './wardsGeojson.json'; +export const wardGeojsonData = wardGeojsonDataJson; export const MDALitePlans = [ { plan_id: '5e396185-6094-4817-9dd4-24bcbbc698b0', @@ -34,3 +36,160 @@ export const MDALitePlans = [ plan_intervention_type: 'MDA-Lite', }, ]; + +export const wardsJurisidtions = [ + { + id: '541e7ed0-2dc6-586e-b563-4c988c5ac585', + plan_id: '5e396185-6094-4817-9dd4-24bcbbc698b0', + jurisdiction_id: '3c63f48e-bb86-42e5-b3ff-bc539fbf5295', + jurisdiction_parent_id: 'f2482d8c-e6ed-433b-860f-96c9cd09b4a3', + jurisdiction_name: 'vihiga', + jurisdiction_depth: 2, + jurisdiction_path: + '["25e8a10b-737c-44e7-bfff-3b6344b1126f", "f2482d8c-e6ed-433b-860f-96c9cd09b4a3"]', + jurisdiction_name_path: '["Kenya", "Vihiga"]', + treated_male_1_4: 0, + treated_male_5_14: 0, + treated_male_above_15: 0, + treated_female_1_4: 0, + treated_female_5_14: 0, + treated_female_above_15: 0, + total_males: 0, + total_females: 0, + total_all_genders: 0, + supervisor_distributed: 0, + received_number: 0, + adminstered: 0, + damaged: 0, + adverse: 0, + remaining_with_cdd: 0, + returned_to_supervisor: 0, + }, + { + id: '45904fbb-256a-5872-a732-0189dcbc88a3', + plan_id: '6b485d4b-1043-40ed-ab8a-c64d24045ada', + jurisdiction_id: '3c63f48e-bb86-42e5-b3ff-bc539fbf5295', + jurisdiction_parent_id: 'f2482d8c-e6ed-433b-860f-96c9cd09b4a3', + jurisdiction_name: 'vihiga', + jurisdiction_depth: 2, + jurisdiction_path: + '["25e8a10b-737c-44e7-bfff-3b6344b1126f", "f2482d8c-e6ed-433b-860f-96c9cd09b4a3"]', + jurisdiction_name_path: '["Kenya", "Vihiga"]', + treated_male_1_4: 25, + treated_male_5_14: 57, + treated_male_above_15: 0, + treated_female_1_4: 20, + treated_female_5_14: 35, + treated_female_above_15: 85, + total_males: 82, + total_females: 140, + total_all_genders: 222, + supervisor_distributed: 166, + received_number: 288, + adminstered: 1200, + damaged: 3, + adverse: 7, + remaining_with_cdd: -915, + returned_to_supervisor: 20, + }, + { + id: '75c668a1-5a1c-5714-b5a1-47e4e7a141cc', + plan_id: 'bbaf9674-e381-45f1-94d1-23bd373bc88e', + jurisdiction_id: '3c63f48e-bb86-42e5-b3ff-bc539fbf5295', + jurisdiction_parent_id: 'f2482d8c-e6ed-433b-860f-96c9cd09b4a3', + jurisdiction_name: 'vihiga', + jurisdiction_depth: 2, + jurisdiction_path: + '["25e8a10b-737c-44e7-bfff-3b6344b1126f", "f2482d8c-e6ed-433b-860f-96c9cd09b4a3"]', + jurisdiction_name_path: '["Kenya", "Vihiga"]', + treated_male_1_4: 0, + treated_male_5_14: 0, + treated_male_above_15: 0, + treated_female_1_4: 0, + treated_female_5_14: 0, + treated_female_above_15: 0, + total_males: 0, + total_females: 0, + total_all_genders: 0, + supervisor_distributed: 0, + received_number: 0, + adminstered: 0, + damaged: 0, + adverse: 0, + remaining_with_cdd: 0, + returned_to_supervisor: 0, + }, +]; + +export const wardsData = [ + { + ward_name: 'lugaga', + parent_id: '3c63f48e-bb86-42e5-b3ff-bc539fbf5295', + base_entity_id: '28713d21-d4f9-49b7-aab7-b07838fb086f', + treated_male_1_4: 0, + treated_male_5_14: 0, + treated_male_above_15: 37, + treated_female_1_4: 0, + treated_female_5_14: 0, + treated_female_above_15: 37, + total_males: 37, + total_females: 37, + total_all_genders: 74, + supervisor_distributed: 0, + received_number: 14, + adminstered: 13, + damaged: 2, + adverse: 2, + remaining_with_cdd: -1, + returned_to_supervisor: 0, + id: 'a4c3973d-5076-59ea-b2bd-08abbb71894a', + plan_id: '5e396185-6094-4817-9dd4-24bcbbc698b0', + }, + { + ward_name: 'lugaga', + parent_id: '3c63f48e-bb86-42e5-b3ff-bc539fbf5295', + base_entity_id: '28713d21-d4f9-49b7-aab7-b07838fb086f', + treated_male_1_4: 0, + treated_male_5_14: 0, + treated_male_above_15: 37, + treated_female_1_4: 0, + treated_female_5_14: 0, + treated_female_above_15: 37, + total_males: 37, + total_females: 37, + total_all_genders: 74, + supervisor_distributed: 0, + received_number: 14, + adminstered: 13, + damaged: 2, + adverse: 2, + remaining_with_cdd: -1, + returned_to_supervisor: 0, + id: '6064cdd4-59d8-522f-a9c9-22ff8ac4b93a', + plan_id: '6b485d4b-1043-40ed-ab8a-c64d24045ada', + }, + + { + ward_name: 'mungoma', + parent_id: '3c63f48e-bb86-42e5-b3ff-bc539fbf5295', + base_entity_id: '9ec52632-7bfb-40f5-9ef7-8804627a65cb', + treated_male_1_4: 0, + treated_male_5_14: 50, + treated_male_above_15: 0, + treated_female_1_4: 0, + treated_female_5_14: 50, + treated_female_above_15: 50, + total_males: 50, + total_females: 100, + total_all_genders: 150, + supervisor_distributed: 0, + received_number: 576, + adminstered: 1800, + damaged: 6, + adverse: 10, + remaining_with_cdd: -1230, + returned_to_supervisor: 0, + id: '75eeb0ab-da38-5340-8ecd-b613d7354bad', + plan_id: '5e396185-6094-4817-9dd4-24bcbbc698b0', + }, +]; diff --git a/src/store/ducks/superset/MDALite/tests/wards.test.ts b/src/store/ducks/superset/MDALite/tests/wards.test.ts new file mode 100644 index 0000000000..792b2fded1 --- /dev/null +++ b/src/store/ducks/superset/MDALite/tests/wards.test.ts @@ -0,0 +1,85 @@ +import reducerRegistry from '@onaio/redux-reducer-registry'; +import { FlushThunks } from 'redux-testkit'; +import store from '../../../../'; +import reducer, { + fetchMDALiteWards, + getMDALiteWardById, + getMDALiteWardsArrayByName, + getMDALiteWardsArrayByParentId, + getMDALiteWardsArrayByPlanId, + getMDALiteWardsArrayByWardId, + makeMDALiteWardsArraySelector, + MDALiteWards, + reducerName, + removeMDALiteWards, +} from '../wards'; +import { wardsData } from './fixtures'; + +reducerRegistry.register(reducerName, reducer); + +const makeMDALiteWardsSelector = makeMDALiteWardsArraySelector(); +const defaultProps = {}; + +describe('reducers/MDA/Dynami-MDAPlan', () => { + let flushThunks; + + beforeEach(() => { + flushThunks = FlushThunks.createMiddleware(); + jest.resetAllMocks(); + }); + + it('should have initial state', () => { + expect(makeMDALiteWardsSelector(store.getState(), defaultProps)).toEqual([]); + expect(getMDALiteWardById(store.getState(), 'test-id')).toEqual(null); + }); + + it('Fetches wards data correctly', () => { + // action creators dispatch + store.dispatch(fetchMDALiteWards(wardsData as MDALiteWards[])); + + expect(getMDALiteWardById(store.getState(), 'a4c3973d-5076-59ea-b2bd-08abbb71894a')).toEqual( + wardsData[0] + ); + + // RESELECT TESTS + expect(getMDALiteWardsArrayByName()(store.getState(), { ward_name: 'mungoma' })).toEqual([ + wardsData[2], + ]); + expect( + getMDALiteWardsArrayByParentId()(store.getState(), { + parent_id: '3c63f48e-bb86-42e5-b3ff-bc539fbf5295', + }) + ).toEqual(wardsData); + expect( + getMDALiteWardsArrayByPlanId()(store.getState(), { + plan_id: '6b485d4b-1043-40ed-ab8a-c64d24045ada', + }) + ).toEqual([wardsData[1]]); + expect( + getMDALiteWardsArrayByWardId()(store.getState(), { + base_entity_id: '9ec52632-7bfb-40f5-9ef7-8804627a65cb', + }) + ).toEqual([wardsData[2]]); + + expect( + makeMDALiteWardsSelector(store.getState(), { + parent_id: '3c63f48e-bb86-42e5-b3ff-bc539fbf5295', + }) + ).toEqual(wardsData); + expect( + makeMDALiteWardsSelector(store.getState(), { + ward_name: 'onyx', + }) + ).toEqual([]); + expect( + makeMDALiteWardsSelector(store.getState(), { + base_entity_id: '9ec52632-7bfb-40f5-9ef7-8804627a65cb', + parent_id: '3c63f48e-bb86-42e5-b3ff-bc539fbf5295', + }) + ).toEqual([wardsData[2]]); + + // reset + store.dispatch(removeMDALiteWards()); + expect(makeMDALiteWardsSelector(store.getState(), defaultProps)).toEqual([]); + }); +}); diff --git a/src/store/ducks/superset/MDALite/tests/wardsGeojson.json b/src/store/ducks/superset/MDALite/tests/wardsGeojson.json new file mode 100644 index 0000000000..20c522dd56 --- /dev/null +++ b/src/store/ducks/superset/MDALite/tests/wardsGeojson.json @@ -0,0 +1,2546 @@ +[ + { + "id": "bff5c2e0-2c5f-4754-9aba-6139ece32bc7", + "geojson": { + "id": "bff5c2e0-2c5f-4754-9aba-6139ece32bc7", + "type": "Feature", + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [34.695806948, 0.029927645000043], + [34.696035802, 0.029920846000039], + [34.696314241, 0.030049309000049], + [34.696665151, 0.030285917000072], + [34.697031318, 0.030353513000023], + [34.6976187130001, 0.029968258000054], + [34.6979696230001, 0.029660748000026], + [34.698194663, 0.029390486000068], + [34.698244249, 0.029242346000046], + [34.698343419, 0.029032459000064], + [34.698438776, 0.028841192000073], + [34.6985150610001, 0.028662115000031], + [34.698816386, 0.028625069000043], + [34.698957512, 0.028581883000072], + [34.699075754, 0.028514013000063], + [34.699247395, 0.028408825000042], + [34.699388522, 0.028286570000034], + [34.699499136, 0.028170500000044], + [34.699636448, 0.028106630000025], + [34.699754689, 0.028094324000051], + [34.6998843740001, 0.028112830000055], + [34.7000216860001, 0.028149842000062], + [34.7001437420001, 0.028205419000074], + [34.700296311, 0.028310377000025], + [34.700395482, 0.028353577000075], + [34.700464138, 0.02844002400002], + [34.700574751, 0.028507915000034], + [34.7006701080001, 0.028581988000042], + [34.700773091, 0.028619065000044], + [34.7009332900001, 0.028575819000025], + [34.701093488, 0.028501756000026], + [34.7012231730001, 0.028433886000073], + [34.7013795560001, 0.028322818000049], + [34.7015016130001, 0.028273447000061], + [34.7016503680001, 0.028242576000025], + [34.7017914950001, 0.028254898000057], + [34.7019936500001, 0.02824259700003], + [34.7022301330001, 0.028254925000056], + [34.7024017730001, 0.028292006000072], + [34.702623, 0.028353713000058], + [34.702798455, 0.028390788000024], + [34.7030273080001, 0.028390802000047], + [34.7032599780001, 0.028328994000049], + [34.7034621330001, 0.028224126000055], + [34.703656659, 0.028125376000048], + [34.7037405720001, 0.028060688000039], + [34.7038473710001, 0.028051319000042], + [34.7040609680001, 0.028063707000058], + [34.7043508510001, 0.028106918000049], + [34.7046712470001, 0.028198882000027], + [34.7050297860001, 0.02830147700007], + [34.7057583060001, 0.028574740000067], + [34.706441055, 0.028939134000041], + [34.706997933, 0.02925007500005], + [34.7071848310001, 0.029297212000074], + [34.7075243, 0.029313734000027], + [34.707730268, 0.029334439000024], + [34.7082451900001, 0.029403537000064], + [34.708508373, 0.029318794000062], + [34.7087372280001, 0.029233989000033], + [34.708920312, 0.029198871000062], + [34.709091953, 0.029184255000075], + [34.7092521500001, 0.029172577000054], + [34.709427605, 0.029140398000038], + [34.7096259470001, 0.029119967000042], + [34.7097937730001, 0.029064410000046], + [34.710049327, 0.029002922000075], + [34.7102438540001, 0.028944548000027], + [34.7104231230001, 0.028877244000057], + [34.710560437, 0.028786616000048], + [34.7106634200001, 0.028695928000047], + [34.7107931050001, 0.028540982000038], + [34.710930418, 0.02836497100003], + [34.711018145, 0.028307033000033], + [34.7111249450001, 0.028260225000054], + [34.7112393720001, 0.028195913000047], + [34.711330913, 0.028116907000026], + [34.7114338980001, 0.027976524000053], + [34.7114796700001, 0.02785663800006], + [34.7115254400001, 0.027719190000028], + [34.7115673970001, 0.027572931000066], + [34.711594097, 0.027444296000056], + [34.711643683, 0.027321469000071], + [34.711693268, 0.02720152400002], + [34.7118153230001, 0.027040763000059], + [34.71188398, 0.026937631000067], + [34.712063249, 0.026694181000039], + [34.7121280910001, 0.026611679000041], + [34.7122501470001, 0.026470420000066], + [34.712334061, 0.026382668000053], + [34.712406532, 0.026289099000053], + [34.712501887, 0.026162032000059], + [34.71256673, 0.02607540200006], + [34.712654457, 0.025955771000042], + [34.712696414, 0.025841637000042], + [34.712772699, 0.025713], + [34.712833727, 0.025499480000065], + [34.7128718700001, 0.025242083000023], + [34.7128909420001, 0.025011063000022], + [34.7129023850001, 0.024815107000052], + [34.712906198, 0.024587018000034], + [34.7129023850001, 0.024341307000043], + [34.712940528, 0.024072279000052], + [34.7129748560001, 0.023776876000056], + [34.713009184, 0.023513665000053], + [34.713047327, 0.023215325000024], + [34.7130816550001, 0.023031123000067], + [34.7131350550001, 0.02287317300005], + [34.7132265970001, 0.022688904000063], + [34.713341024, 0.022577779000073], + [34.713501222, 0.02249884400004], + [34.7136614200001, 0.022487162000061], + [34.713859762, 0.022452112000053], + [34.7140237740001, 0.022460870000032], + [34.7142259290001, 0.022443317000068], + [34.714397569, 0.02241701500003], + [34.7146264240001, 0.022387773000048], + [34.714801879, 0.022373157000061], + [34.7149620770001, 0.022358544000042], + [34.7151451610001, 0.022326490000069], + [34.715339687, 0.022262057000034], + [34.715507514, 0.022209435000036], + [34.715679155, 0.022133440000061], + [34.7158469820001, 0.022039749000044], + [34.715991923, 0.021919937000064], + [34.7161139790001, 0.021750300000065], + [34.716190264, 0.021650856000065], + [34.716331391, 0.02145009700007], + [34.7164191190001, 0.021328152000024], + [34.7164839600001, 0.021216395000067], + [34.716583132, 0.021086451000031], + [34.716678487, 0.02100751200004], + [34.716811986, 0.020934385000032], + [34.7169264130001, 0.020893451000063], + [34.717113311, 0.020864207000045], + [34.7172468100001, 0.020875906000072], + [34.7174337070001, 0.020902170000056], + [34.717563392, 0.020963681000069], + [34.717853274, 0.021054337000066], + [34.7180630570001, 0.020913961000019], + [34.718120271, 0.020805829000039], + [34.7181202720001, 0.02068287700007], + [34.7180973860001, 0.020472356000028], + [34.7180363580001, 0.020334901000069], + [34.717963888, 0.020174067000028], + [34.7178380180001, 0.019975160000058], + [34.717712148, 0.019869893000021], + [34.7175405080001, 0.019744120000041], + [34.717353609, 0.019556902000033], + [34.717212483, 0.019404817000066], + [34.717094241, 0.019255667000039], + [34.717037028, 0.019126967000034], + [34.716995072, 0.018919315000062], + [34.7169721870001, 0.018743857000061], + [34.716956929, 0.01857134100004], + [34.7169226020001, 0.018430884000054], + [34.716853945, 0.01823786500006], + [34.716747147, 0.01801271000005], + [34.71660602, 0.017761174000043], + [34.7165144780001, 0.017553520000035], + [34.7164000510001, 0.017293176000067], + [34.716297067, 0.01700951600003], + [34.7162207820001, 0.016857493000032], + [34.7161521260001, 0.01668778800007], + [34.7161025410001, 0.016488886000047], + [34.716087284, 0.016330997000068], + [34.7160949130001, 0.016067781000061], + [34.7161292420001, 0.015781132000029], + [34.7161788270001, 0.015488666000067], + [34.7161559410001, 0.015205012000024], + [34.7161292430001, 0.015085122000073], + [34.716064401, 0.014836467000066], + [34.716033886, 0.014713641000071], + [34.715972859, 0.01458787200005], + [34.715881317, 0.014482607000048], + [34.7157897760001, 0.014365589000022], + [34.7157173050001, 0.014236949000065], + [34.7156677200001, 0.014122869000062], + [34.715652463, 0.01394153800004], + [34.7156791630001, 0.013698767000051], + [34.715644835, 0.013488241000061], + [34.715538037, 0.013379971000063], + [34.715404538, 0.013312707000068], + [34.7153091820001, 0.013239636000037], + [34.715225268, 0.013122618000068], + [34.7152023830001, 0.012973474000034], + [34.715213826, 0.012792144000059], + [34.715236711, 0.012669321000033], + [34.7153129960001, 0.012534749000054], + [34.7153892810001, 0.012432431000036], + [34.715446496, 0.012318359000062], + [34.715465567, 0.012163345000033], + [34.715488452, 0.01203758500003], + [34.715644836, 0.011843200000044], + [34.715846992, 0.011657443000047], + [34.7159652340001, 0.011517062000053], + [34.7160224470001, 0.011414675000026], + [34.7160453320001, 0.011277226000061], + [34.716098732, 0.011039334000031], + [34.716117803, 0.010928257000046], + [34.7161445030001, 0.010776497000052], + [34.716152132, 0.010631863000071], + [34.716068218, 0.010462679000057], + [34.715991934, 0.010274393000032], + [34.716011005, 0.010167969000065], + [34.7158775070001, 0.010036981000042], + [34.715782151, 0.009955113000046], + [34.715579996, 0.009853432000057], + [34.715488454, 0.009790037000073], + [34.715381656, 0.009711401000061], + [34.715290114, 0.009660015000065], + [34.715171873, 0.00955424700004], + [34.7150879590001, 0.009494607000022], + [34.715011674, 0.009397034000074], + [34.7149582760001, 0.009310332000041], + [34.7149277620001, 0.009174820000055], + [34.7148896190001, 0.009056515000054], + [34.715107032, 0.008865482000033], + [34.7151795020001, 0.008735037000065], + [34.7152214590001, 0.008546645000024], + [34.715263415, 0.008372692000023], + [34.715335887, 0.008213309000041], + [34.7154388710001, 0.007995855000047], + [34.7155990700001, 0.007821972000045], + [34.7157287530001, 0.007677024000031], + [34.7159080230001, 0.00735906500006], + [34.716087293, 0.007090424000069], + [34.7162436780001, 0.006923291000021], + [34.7163085190001, 0.00675547000003], + [34.7166136590001, 0.006451140000024], + [34.716956941, 0.006228016000023], + [34.7172811520001, 0.005883123000046], + [34.717445164, 0.005659923000053], + [34.717727419, 0.005497676000061], + [34.7180325590001, 0.005213602000026], + [34.7182156420001, 0.005051350000031], + [34.718509339, 0.004793277000033], + [34.721263225, 0.001079316000073], + [34.7217705200001, 0.00022776000003], + [34.7236929000001, -0.001928092999947], + [34.726862539, -0.005750853999928], + [34.7272401490001, -0.006403016999968], + [34.7268205820001, -0.006396167999981], + [34.7254512700001, -0.006520179999939], + [34.7251194310001, -0.006629054999962], + [34.7248333630001, -0.006722691999926], + [34.7237424900001, -0.007086394999931], + [34.7231741680001, -0.007403617999955], + [34.723059741, -0.007479424999929], + [34.7226249180001, -0.007767379999962], + [34.7219345400001, -0.008214972999951], + [34.721541674, -0.008420291999926], + [34.720889438, -0.008466920999979], + [34.7197794940001, -0.008448331999944], + [34.719340856, -0.008476301999963], + [34.71889459, -0.008672209999929], + [34.7186886210001, -0.008979992999969], + [34.718307198, -0.009464959999946], + [34.717654962, -0.009754198999929], + [34.717365081, -0.009893966999925], + [34.716937885, -0.010089904999973], + [34.71663656, -0.010200045999966], + [34.7162093650001, -0.010696143999951], + [34.715949998, -0.011143817999937], + [34.715869899, -0.011507948999963], + [34.715816499, -0.011740698999972], + [34.7156486740001, -0.012524106999933], + [34.715583832, -0.013298187999965], + [34.7153702360001, -0.014314742999943], + [34.7151108670001, -0.014678480999976], + [34.714466262, -0.01511684299993], + [34.7142335930001, -0.015342571999952], + [34.7140924660001, -0.015480582999942], + [34.713867426, -0.01584429899998], + [34.7136118720001, -0.016204089999974], + [34.7135127020001, -0.016344499999946], + [34.713440232, -0.016590448999978], + [34.713039737, -0.01724330899998], + [34.7125744000001, -0.017961424999953], + [34.712433273, -0.018229876999953], + [34.712254004, -0.018567643999972], + [34.712105249, -0.018856781999943], + [34.711555999, -0.019705474999967], + [34.7115216710001, -0.019857286999979], + [34.7114644580001, -0.020125610999969], + [34.711414873, -0.020521187999975], + [34.711369102, -0.020648681999944], + [34.7110639630001, -0.021020502999932], + [34.7107855240001, -0.02117147599995], + [34.7106138820001, -0.021262996999951], + [34.710148545, -0.021412234999957], + [34.7096832080001, -0.021580206999943], + [34.708882218, -0.021887964999962], + [34.708599963, -0.021887981999953], + [34.7080774130001, -0.021748129999935], + [34.7076959880001, -0.021608215999947], + [34.7068568550001, -0.021440430999974], + [34.7054951710001, -0.02148713899993], + [34.7050946740001, -0.021356591999961], + [34.70366052, -0.0213566799999], + [34.703202811, -0.021263393999959], + [34.702642117, -0.021151564999968], + [34.7017572130001, -0.021114343999955], + [34.7014597020001, -0.021207609999976], + [34.7009562220001, -0.021356680999929], + [34.7006205690001, -0.02126360799997], + [34.700143788, -0.021011844999975], + [34.6996784510001, -0.020825332999948], + [34.6989880730001, -0.020564193999974], + [34.6984006800001, -0.020275131999938], + [34.6980459550001, -0.020153960999949], + [34.6979162700001, -0.020135227999958], + [34.6975157750001, -0.020070118999968], + [34.6970580660001, -0.020098132999976], + [34.696573658, -0.020275284999968], + [34.696024407, -0.020788255999946], + [34.6957421540001, -0.021128225999973], + [34.695677312, -0.021207951999941], + [34.695154761, -0.021954071999971], + [34.6946055110001, -0.022578967999948], + [34.6941020310001, -0.022793480999951], + [34.6936748360001, -0.022886753999956], + [34.6933925820001, -0.022976003999929], + [34.6932056840001, -0.023036022999975], + [34.692980644, -0.023221108999962], + [34.69279756, -0.023371795999935], + [34.692080484, -0.024267142999975], + [34.691943172, -0.02463802799997], + [34.691863073, -0.024854700999924], + [34.6912108380001, -0.025768697999979], + [34.690898071, -0.025976150999952], + [34.690745501, -0.026076519999947], + [34.6902687210001, -0.026141807999977], + [34.6898605980001, -0.02614888599993], + [34.689727099, -0.026151141999947], + [34.689486801, -0.026058796999962], + [34.6892922750001, -0.025983336999957], + [34.6886209690001, -0.025992684999949], + [34.6886743680001, -0.025810793999938], + [34.688907036, -0.025433119999946], + [34.68913589, -0.025098892999949], + [34.689254132, -0.024929465999946], + [34.68931516, -0.024736384999926], + [34.689364744, -0.024584377999929], + [34.6894486570001, -0.024200751999956], + [34.6894867990001, -0.024015497999926], + [34.6895478270001, -0.023920136999948], + [34.6899788360001, -0.023260017999974], + [34.690119963, -0.02300781799994], + [34.6901962480001, -0.022868338999956], + [34.6906806550001, -0.022290089999956], + [34.6911650640001, -0.021562633999963], + [34.6917333850001, -0.020900422999944], + [34.692366549, -0.020256879999977], + [34.692606846, -0.019999235999933], + [34.6929005420001, -0.019687964999946], + [34.693533705, -0.01899780399998], + [34.693739674, -0.018568774999949], + [34.693838844, -0.018245222999951], + [34.6938960570001, -0.018055828999934], + [34.693999042, -0.017561537999939], + [34.694128725, -0.016843420999976], + [34.6941821250001, -0.016468852999935], + [34.69422408, -0.01618125899995], + [34.6942698510001, -0.015761565999981], + [34.6945597330001, -0.015229968999961], + [34.694681788, -0.014763655999957], + [34.6946703460001, -0.014515499999959], + [34.694662716, -0.014353307999954], + [34.6942889210001, -0.01420411099997], + [34.6941401650001, -0.014099028999965], + [34.6938960530001, -0.013924322999969], + [34.6933086600001, -0.013588640999956], + [34.693144648, -0.013459860999944], + [34.6928166230001, -0.013206305999972], + [34.69247334, -0.013055508999969], + [34.6921987150001, -0.012935892999963], + [34.6918363620001, -0.012749390999943], + [34.6914091670001, -0.012646823999944], + [34.69079126, -0.01245099099998], + [34.6904250920001, -0.012096130999964], + [34.690009339, -0.011695644999975], + [34.689872026, -0.011158793999925], + [34.6898453260001, -0.011050658999977], + [34.689521115, -0.011309479999966], + [34.689391432, -0.011432688999946], + [34.689063407, -0.011582945999976], + [34.68831963, -0.011819725999942], + [34.687305042, -0.012107291999939], + [34.685516163, -0.012571117999926], + [34.682079532, -0.013472038999964], + [34.673474604, -0.015961521999941], + [34.67286814, -0.016062782999938], + [34.672685057, -0.015979180999977], + [34.672208276, -0.015759149999951], + [34.6550632510001, -0.008219624999924], + [34.654807697, -0.00783071799998], + [34.6544033870001, -0.007492485999933], + [34.653999078, -0.007374155999969], + [34.653610025, -0.007407949999958], + [34.652999746, -0.007391112999926], + [34.6521873130001, -0.00732357499993], + [34.651741046, -0.006931604999977], + [34.651378693, -0.006613277999975], + [34.651050668, -0.006487317999927], + [34.6508523270001, -0.006410309999978], + [34.6506730580001, -0.006373837999945], + [34.650608215, -0.006246808999947], + [34.6505471880001, -0.006159056999934], + [34.650467088, -0.006091617999971], + [34.6504213170001, -0.005990359999942], + [34.650467088, -0.005821590999972], + [34.6505624440001, -0.00575407499997], + [34.6506349150001, -0.005652871999928], + [34.6505128590001, -0.005484112999966], + [34.6504136880001, -0.005443616999969], + [34.650306889, -0.005369365999968], + [34.6502039050001, -0.00531542799996], + [34.6501505050001, -0.005214170999977], + [34.650135248, -0.005085906999966], + [34.6501848340001, -0.004991396999969], + [34.6502840040001, -0.004829437999945], + [34.6503526590001, -0.004674166999962], + [34.650448016, -0.004545835999977], + [34.6505204860001, -0.004431255999975], + [34.650554814, -0.004323179999972], + [34.650543371, -0.00419491699995], + [34.6505128580001, -0.004093724999962], + [34.6504594580001, -0.003978963999941], + [34.650425129, -0.003870952999932], + [34.650425129, -0.003769691999935], + [34.650467086, -0.003668556999969], + [34.650554813, -0.003499719999979], + [34.650474715, -0.003330957999935], + [34.650406058, -0.003229762999979], + [34.6503984290001, -0.003128502999971], + [34.6505700700001, -0.002993481999965], + [34.6506577970001, -0.002878778999957], + [34.6507188250001, -0.002730259999964], + [34.6507493390001, -0.002601994999964], + [34.650764596, -0.002419724999925], + [34.6508370660001, -0.002264513999933], + [34.6509667510001, -0.002091991999976], + [34.651069734, -0.001917652999964], + [34.651180348, -0.001729879999971], + [34.6513062180001, -0.001563542999975], + [34.651382502, -0.001442771999962], + [34.651432087, -0.001346196999975], + [34.6515045580001, -0.001238931999978], + [34.6515732130001, -0.001096724999968], + [34.651611356, -0.000994778999939], + [34.65166857, -0.000860570999976], + [34.6517334120001, -0.000688986999933], + [34.651779182, -0.000592411999946], + [34.6518554670001, -0.000399263999952], + [34.651878352, -0.000299998999935], + [34.6519050520001, -0.000184614999966], + [34.6519546370001, -1.8343999955e-5], + [34.6519393790001, 0.000121170000057], + [34.6519012370001, 0.000284812000075], + [34.651897423, 0.000386756000069], + [34.651859281, 0.000574525000047], + [34.6518096950001, 0.000700594000023], + [34.651775366, 0.000805228000047], + [34.6517295960001, 0.00090179700004], + [34.6516494960001, 0.001113691000057], + [34.651603725, 0.001312210000037], + [34.651615168, 0.001505355000063], + [34.65170671, 0.001701191000052], + [34.651794437, 0.001781704000052], + [34.651947007, 0.001907791000065], + [34.6520728770001, 0.001972179000063], + [34.6523017310001, 0.002049953000039], + [34.652564914, 0.002141225000059], + [34.6527098540001, 0.002232432000028], + [34.6528853090001, 0.002444341000057], + [34.6529387090001, 0.002543603000049], + [34.653003551, 0.002640179000025], + [34.653041693, 0.002744818000053], + [34.653102721, 0.002838706000034], + [34.6531790060001, 0.002967476000038], + [34.653232405, 0.003058672000066], + [34.6533277610001, 0.003190130000064], + [34.653430745, 0.003316213000062], + [34.653510845, 0.003399351000041], + [34.6535985720001, 0.003509367000049], + [34.6536557850001, 0.003595191000045], + [34.6537778410001, 0.003718651000042], + [34.65393041, 0.003839360000029], + [34.654048652, 0.003871559000061], + [34.654197407, 0.003965448000031], + [34.654338534, 0.00404059300007], + [34.654456775, 0.004096915000048], + [34.65455976, 0.004121049000048], + [34.6547619150001, 0.004142502000036], + [34.654880157, 0.004164012000047], + [34.654979327, 0.00421496000007], + [34.655070869, 0.004273972000021], + [34.655166224, 0.004335671000035], + [34.655238694, 0.004405433000045], + [34.655326422, 0.004488633000051], + [34.6553912640001, 0.004569085000071], + [34.655478992, 0.00464592000003], + [34.6556124910001, 0.004762243000073], + [34.6557726880001, 0.004874953000069], + [34.6559710290001, 0.004966159000048], + [34.6560892700001, 0.004974230000073], + [34.6562036980001, 0.00498224100005], + [34.656318125, 0.004987622000044], + [34.6564516230001, 0.004979565000042], + [34.6565736790001, 0.005010748000075], + [34.656726248, 0.005049339000038], + [34.6567834620001, 0.005162606000056], + [34.656836862, 0.005313126000033], + [34.6569512890001, 0.005492711000045], + [34.657035202, 0.005550972000037], + [34.6571687000001, 0.005569796000032], + [34.6572678700001, 0.005542987000069], + [34.657374669, 0.005513428000029], + [34.657496725, 0.005578184000058], + [34.6576111520001, 0.005638952000027], + [34.6576416660001, 0.005867043000023], + [34.657672179, 0.006004808000057], + [34.657733207, 0.006087820000062], + [34.6578819630001, 0.006173649000061], + [34.6579887610001, 0.006151469000031], + [34.6580803040001, 0.006108531000052], + [34.658213802, 0.005993717000024], + [34.658362557, 0.005904152000028], + [34.658522756, 0.00594979300007], + [34.658576155, 0.00608393300007], + [34.658595226, 0.006225952000023], + [34.658595226, 0.00633377500003], + [34.658614297, 0.006531231000054], + [34.65867151, 0.006661561000044], + [34.6587706810001, 0.006777578000026], + [34.6588507800001, 0.006838653000045], + [34.6589575780001, 0.006891475000032], + [34.6590453060001, 0.00694855200004], + [34.659163547, 0.007021877000057], + [34.659270346, 0.00712564600002], + [34.6593847730001, 0.00725185400006], + [34.65945343, 0.007325176000052], + [34.659560228, 0.007433133000063], + [34.659678469, 0.007534835000058], + [34.659831039, 0.007599980000066], + [34.6599759800001, 0.007669179000061], + [34.6600560790001, 0.007736384000054], + [34.6601666920001, 0.007850399000063], + [34.660239163, 0.007921596000074], + [34.6603764760001, 0.008072249000065], + [34.6605824440001, 0.008139394000068], + [34.660788413, 0.008151654000073], + [34.6609142830001, 0.008231048000027], + [34.6610134530001, 0.008347126000047], + [34.66110881, 0.008459082000059], + [34.6611622080001, 0.00854453300002], + [34.66128045, 0.008713494000062], + [34.661356735, 0.008817319000059], + [34.6614406480001, 0.008949653000059], + [34.6615932170001, 0.009161372000051], + [34.661707645, 0.009293642000046], + [34.6617801150001, 0.009390372000041], + [34.661875471, 0.009513548000029], + [34.6619898980001, 0.009662131000027], + [34.6621005110001, 0.009772024000029], + [34.6622073090001, 0.009898232000069], + [34.662325551, 0.009989810000036], + [34.662478121, 0.01005501700007], + [34.6626383190001, 0.010130346000039], + [34.662764189, 0.010221926000042], + [34.66285573, 0.010331880000024], + [34.662943458, 0.010458085000039], + [34.663023557, 0.010650861000045], + [34.663092213, 0.010774562000051], + [34.66313417, 0.01088620400003], + [34.6631494270001, 0.011001214000032], + [34.6631951970001, 0.011105041000064], + [34.6632257110001, 0.01124055400004], + [34.663301995, 0.011439581000047], + [34.6633668370001, 0.011570663000043], + [34.663462194, 0.01168718100007], + [34.6635384790001, 0.01176969100004], + [34.663610949, 0.011857080000027], + [34.663771147, 0.011988167000027], + [34.664003816, 0.012193328000023], + [34.664369983, 0.012439626000059], + [34.664629351, 0.012604220000071], + [34.664770478, 0.012653735000072], + [34.6649878900001, 0.012709001000076], + [34.6651633450001, 0.012691825000047], + [34.6653655000001, 0.012655707000022], + [34.6655714680001, 0.012587152000037], + [34.665769809, 0.012590974000034], + [34.6659643350001, 0.012655744000028], + [34.666170304, 0.012794710000037], + [34.666349574, 0.012865163000072], + [34.666566985, 0.01291661800002], + [34.6668721240001, 0.012958518000062], + [34.6670704650001, 0.013018160000058], + [34.667367976, 0.013047184000072], + [34.667669301, 0.013056825000035], + [34.667997326, 0.01281588400002], + [34.668069797, 0.012449102000062], + [34.6681155680001, 0.012146513000062], + [34.6680545400001, 0.011906234000037], + [34.667901971, 0.011710451000056], + [34.6677532160001, 0.011532426000031], + [34.667448076, 0.011212063000073], + [34.6673336490001, 0.011080044000039], + [34.666971297, 0.010573780000072], + [34.666624202, 0.010051643000054], + [34.6665288460001, 0.009482079000065], + [34.666715745, 0.008849276000035], + [34.6667004880001, 0.008643628000073], + [34.666589876, 0.00810569500004], + [34.666505962, 0.007564380000019], + [34.66670049, 0.007077344000038], + [34.666597505, 0.006575664000025], + [34.666612763, 0.006323014000031], + [34.6666852330001, 0.006113744000061], + [34.6668454310001, 0.005832287000032], + [34.6670742860001, 0.005687852000051], + [34.667299326, 0.005608542000061], + [34.667451896, 0.005478664000066], + [34.667638794, 0.005305471000042], + [34.6677761070001, 0.005125023000062], + [34.6678562070001, 0.004886876000057], + [34.6678256930001, 0.004489898000031], + [34.667745595, 0.00407129000007], + [34.6676654950001, 0.003818697000042], + [34.667322214, 0.003154670000072], + [34.667203973, 0.002786563000029], + [34.667123874, 0.002533968000023], + [34.6671124320001, 0.002252501000044], + [34.667184902, 0.001985477000062], + [34.6672421170001, 0.001783338000052], + [34.6673336580001, 0.001602947000038], + [34.6674557150001, 0.001487445000066], + [34.6676731270001, 0.001552466000021], + [34.66787528, 0.001639050000051], + [34.667997337, 0.001833952000027], + [34.6681422770001, 0.002129867000065], + [34.6682300040001, 0.002418587000022], + [34.6684397880001, 0.002663937000023], + [34.6686571990001, 0.002923792000047], + [34.66890131, 0.003147581000064], + [34.6690386230001, 0.003428989000042], + [34.6692979910001, 0.003854860000047], + [34.6696641570001, 0.004468385000052], + [34.6697938410001, 0.004742607000026], + [34.670011253, 0.005096281000021], + [34.670190523, 0.00508910700006], + [34.6707474020001, 0.00499531600002], + [34.6710143980001, 0.004952017000051], + [34.671189854, 0.004829326000049], + [34.6714034510001, 0.004612818000055], + [34.6715636500001, 0.004475687000024], + [34.671807761, 0.004360315000042], + [34.671952703, 0.004259191000074], + [34.672189186, 0.004259205000039], + [34.6724065980001, 0.004360352000049], + [34.672509582, 0.004425242000025], + [34.67272318, 0.004504636000036], + [34.6728757500001, 0.004519084000037], + [34.6731160470001, 0.004504660000066], + [34.6732381030001, 0.004360402000032], + [34.673302945, 0.004158263000022], + [34.67328006, 0.003797348000035], + [34.673329645, 0.003544762000047], + [34.673539428, 0.003429264000033], + [34.6738560110001, 0.003393219000031], + [34.6742679490001, 0.003357176000065], + [34.6747752430001, 0.003393276000054], + [34.6752367660001, 0.003451060000032], + [34.6754579920001, 0.00355933000003], + [34.6756830320001, 0.003645982000023], + [34.675877558, 0.003732566000053], + [34.6761254840001, 0.00379752200007], + [34.676239912, 0.003862537000032], + [34.6763848520001, 0.00398524700006], + [34.676457322, 0.004093509000029], + [34.6765336070001, 0.004216154000062], + [34.6765259790001, 0.004382171000032], + [34.6764268090001, 0.004598686000065], + [34.6762551670001, 0.004743002000055], + [34.676159811, 0.004880137000043], + [34.676030127, 0.005096649000052], + [34.676037755, 0.005342049000035], + [34.676136925, 0.005522510000048], + [34.676289495, 0.005659599000069], + [34.676426808, 0.005746241000054], + [34.676514535, 0.005868948000057], + [34.6765717480001, 0.006085472000052], + [34.6766137050001, 0.006374189000041], + [34.6762322800001, 0.006677262000039], + [34.676014868, 0.006785507000075], + [34.6757783850001, 0.006908194000061], + [34.675724985, 0.007124710000028], + [34.6757478710001, 0.007398993000038], + [34.675812712, 0.007564949000027], + [34.6759271390001, 0.007716535000043], + [34.6760949660001, 0.007846499000038], + [34.676224651, 0.007983581000076], + [34.676392476, 0.008142418000034], + [34.676442062, 0.008265123000058], + [34.676442062, 0.008474457000034], + [34.6764268050001, 0.008864119000066], + [34.67646876, 0.009304420000035], + [34.6766137020001, 0.009571454000024], + [34.676789156, 0.009867369000062], + [34.6770904810001, 0.010105538000062], + [34.677315521, 0.010177746000068], + [34.6778113730001, 0.010199407000073], + [34.6785208220001, 0.01004793200002], + [34.6790319310001, 0.00981700400007], + [34.6793256280001, 0.009391162000043], + [34.6794858260001, 0.00916021200004], + [34.679657467, 0.008871570000053], + [34.6797757090001, 0.00866224300006], + [34.679939722, 0.008337469000026], + [34.680019821, 0.008164331000046], + [34.6804546440001, 0.008128228000032], + [34.680591957, 0.008243685000025], + [34.6806262850001, 0.008431335000068], + [34.680698756, 0.008922136000024], + [34.680706383, 0.009297489000062], + [34.680778853, 0.00945619700002], + [34.680950495, 0.009651103000067], + [34.681476859, 0.010242946000062], + [34.6812098620001, 0.010683163000067], + [34.680633911, 0.011361572000055], + [34.6802715580001, 0.011751280000055], + [34.680294443, 0.01215544400003], + [34.6805194830001, 0.012473055000044], + [34.680828435, 0.01279054400004], + [34.6811450170001, 0.013086530000066], + [34.6814654140001, 0.013318699000024], + [34.6816675690001, 0.013440411000033], + [34.6820146640001, 0.013622948000034], + [34.682190119, 0.013751351000053], + [34.682491444, 0.01398795700004], + [34.682708856, 0.014129921000062], + [34.6828652400001, 0.014204310000025], + [34.683101723, 0.014285457000028], + [34.6833725330001, 0.014400360000025], + [34.683547989, 0.014515260000053], + [34.683856942, 0.014738366000074], + [34.684055282, 0.014900581000063], + [34.684207852, 0.015110176000064], + [34.6842917660001, 0.015279196000051], + [34.684284136, 0.015482469000062], + [34.6844100060001, 0.01598871300007], + [34.6844100060001, 0.016117915000052], + [34.6843871200001, 0.016228112000022], + [34.6843909350001, 0.016532016000042], + [34.684413819, 0.016991757000028], + [34.6844176340001, 0.017212087000075], + [34.6843947470001, 0.017402043000061], + [34.6843871190001, 0.017660382000031], + [34.6843871190001, 0.01783896400002], + [34.6843794910001, 0.017994731000044], + [34.6843680470001, 0.018142866000062], + [34.6843451610001, 0.018287260000022], + [34.684310833, 0.018431584000041], + [34.6842955760001, 0.018553156000053], + [34.684211663, 0.018735542000059], + [34.6841849630001, 0.018853304000061], + [34.6841315630001, 0.01900906700007], + [34.6841277500001, 0.019115451000062], + [34.6841353770001, 0.019282592000025], + [34.68421929, 0.019442180000055], + [34.684337532, 0.019567576000043], + [34.6843642320001, 0.019666336000057], + [34.684436702, 0.019875302000059], + [34.684436702, 0.020000689000028], + [34.6844328870001, 0.020129827000062], + [34.684406187, 0.020391974000063], + [34.6843756740001, 0.020566740000049], + [34.684295574, 0.020760507000034], + [34.684226918, 0.020893450000074], + [34.6842192890001, 0.021022654000035], + [34.684204031, 0.021129035000058], + [34.684204031, 0.02123160900004], + [34.684204031, 0.021349372000032], + [34.684204031, 0.021467135000023], + [34.6842116600001, 0.021657091000066], + [34.684242173, 0.021771107000063], + [34.6843222730001, 0.02193825300003], + [34.6843794870001, 0.022071209000046], + [34.684474842, 0.022192787000051], + [34.68453587, 0.022314365000057], + [34.6845778270001, 0.022435945000041], + [34.68463504, 0.022603152000045], + [34.6846693680001, 0.022758920000058], + [34.684722767, 0.02290325000007], + [34.6847265810001, 0.023089458000072], + [34.6847189530001, 0.023248974000069], + [34.6846884390001, 0.023347791000049], + [34.684654111, 0.023450363000052], + [34.6845244260001, 0.023598497000023], + [34.6847380230001, 0.023661391000076], + [34.6849859490001, 0.023766355000021], + [34.6851652180001, 0.023871253000038], + [34.6853559300001, 0.02397008500003], + [34.6859318800001, 0.024321967000049], + [34.6864925740001, 0.024723168000037], + [34.6870532660001, 0.025225633000048], + [34.6879724980001, 0.026031328000045], + [34.688834516, 0.026808277000043], + [34.6892960390001, 0.027211094000052], + [34.6902457850001, 0.027815402000044], + [34.6912222300001, 0.028621107000049], + [34.691557883, 0.028964158000065], + [34.692156718, 0.029334550000044], + [34.692736483, 0.029575360000024], + [34.693136978, 0.029692646000058], + [34.693396347, 0.029735850000066], + [34.6935527300001, 0.029785243000049], + [34.693686229, 0.029822318000072], + [34.693815914, 0.029902521000054], + [34.6940028110001, 0.029927223000072], + [34.6941897090001, 0.029951924000045], + [34.694365164, 0.029995190000022], + [34.6945291760001, 0.030044580000038], + [34.6946512320001, 0.030093964000059], + [34.6947732880001, 0.030149480000034], + [34.6948610160001, 0.030211241000075], + [34.6949716280001, 0.03026681700004], + [34.69506317, 0.030328516000054], + [34.6951394550001, 0.030402587000026], + [34.6952691390001, 0.030482041000027], + [34.6954484080001, 0.030427795000037], + [34.695543764, 0.030049262000034], + [34.695665821, 0.029974953000021], + [34.695806948, 0.029927645000043] + ] + ] + ] + }, + "properties": { + "id": "bff5c2e0-2c5f-4754-9aba-6139ece32bc7", + "uid": "bff5c2e0-2c5f-4754-9aba-6139ece32bc7", + "code": "bff5c2e0-2c5f-4754-9aba-6139ece32bc7", + "name": "s. maragoli", + "type": "Feature", + "status": "Active", + "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada", + "version": 0, + "geometry": "0106000020E61000000100000001030000000100000044030000B0FEBA331059414089FF15425AA59E3FB8377FB31759414069C027FC91A39E3FC86A36D32059414064C0B0FD3EC59E3F70E7DB522C59414082C02D7C45039F3F888C7D523859414046809DC6FD149F3FD8B4EA914B59414085001DC0FFAF9E3F8031901157594140D23F8A1A635F9E3FD8E955715E5941400240BC208A189E3FA0094B116059414092FFE99EB4F19D3FB0FD3051635941405C00B657AFBA9D3FD8961A71665941406C00ACA18B889D3F206107F1685941407BBF3CFA99599D3FB8E3B9D07259414019C0CDDCE34F9D3FB8AA937077594140D83FF9B291449D3FA86D76507B5941404D804005C7329D3F50AB4AF080594140B2FF2BF933179D3F1098269085594140A5BF439427F79C3FA8590C3089594140AE3FD940BAD89C3FF89FE7AF8D59414040809A02FCC79C3F283DC88F91594140EB3F222BC2C49C3FE8A7A8CF955941407300CB159CC99C3F38EE834F9A59414064801CEB4FD39C3FD831654F9E5941407E80B3A0E1E19C3F98A03C4FA3594140B6FF683D65FD9C3F68BA248FA65941409C7FC257B8089D3F905D12CFA85941408200E9B3611F9D3F68F9F56EAC594140B9BF68CA2D319D3F9092DF8EAF5941404900DCBE98449D3F88E1C1EEB25941408A80DEF0504E9D3F309D9A2EB8594140D5FF3EC0FA429D3F0833716EBD59414079409877902F9D3FC89D51AEC1594140FBBFDFC9C51D9D3F388D27CEC6594140C3BF2924A8009D3F98F60ACECA5941408C80D7E8B6F39C3FB0E4E3ADCF594140E07F19319FEB9C3F70D1BF4DD459414005C0721BDAEE9C3F00608CEDDA5941408D7FE099A0EB9C3F20C04FADE259414061004EEBDBEE9C3F08D8214DE859414006C0086294F89C3F6E35EB8CEF594140CDBF3878C1089D3FC8F3BD4CF5594140B5FFDE8779129D3F100780CCFC5941404DC063787A129D3F480C476C045A41406C00099B46029D3FD89A130C0B5A414068808308C9E69C3F4802E16B115A4140D17F6E08E6CC9C3FE8CDCA2B145A4140D9BF0DE5F0BB9C3F10E9AFAB175A41400400DC267CB99C3FA8F977AB1E5A4140FF3F147FBBBC9C3F40FA2E2B285A4140710068560FC89C3F0026DCAA325A41408C40E5EF2AE09C3FC0C9806A3E5A41407B3F93F80FFB9C3F4893C549565A4140A3FF2A57B2429D3F70E315A96C5A414060406B6838A29D3F904984E87E5A41400F801F4EBBF39D3FB0AF5408855A4140ECFF9D9D16009E3F10D00028905A4140DC3F6A636B049E3F88B9C9E7965A4140A83F9BE0D8099E3FC04C44C7A75A4140B53F35F7F51B9E3F187D0167B05A4140E4BF8DF5BE059E3FE8DBC7E6B75A4140733FBFCA83EF9D3F50C199E6BD5A41409AFF19104FE69D3FF8FE6D86C35A4140D43F22337AE29D3F186F42C6C85A414013009F806ADF9D3F682D1586CE5A4140C53F9C01FBD69D3F1061E505D55A414093FFB3E79FD19D3F48F8B885DA5A41409FFFB5890FC39D3F880177E5E25A41405540EA25F1B29D3FC08E4645E95A414042003BBCA3A39D3FC0CD1725EF5A4140E6BF500AFF919D3F905FF7A4F35A41406F8021193D7A9D3F90AED904F75A4140907F272177629D3F4819BA44FB5A4140CBBF24E1D8399D3F588597C4FF5A4140823F30FBB40B9D3FA0D17FA4025B41403D80EDD384FC9C3F90126724065B414064809C983FF09C3F182F49E4095B4140A63FDDB063DF9C3F08FC2FE40C5B4140FF7F1EB0ADCA9C3F88961644105B41401B408BBEE0A59C3FA8350DC4115B41404140BF5473869C3F4089FF43135B41408540165A6B629C3FF081F5A3145B414069C09913143C9C3F2852EF83155B414073C020875B1A9C3FF071E423175B414094FF55BF28FA9B3FF86BD7C3185B4140EBFFEC5FB7DA9B3FD889B6C31C5B4140E7FFF9E292B09B3FC052A6031F5B41406A40B5D089959B3FC09177E3245B41400E008E29B8559B3F40B46603275B4140FABFFC8B17409B3FE0F747032B5B414071BFD8D00F1B9B3F38E933C32D5B41408D3FF7E00E049B3FD0322223305B41403140C99187EB9A3F70800743335B41402D40593F38CA9A3FB0C8F862355B414087FF479B82B39A3FF814E142385B4140C5BF594E26949A3FA80DD7A2395B4140314029E73A769A3FE8D7C3223C5B41406404543882549A3FB879B4223E5B41408A40A922891C9A3FC0F1AB623F5B4140AE3FDF830FD9993FA0C0A802405B4140C53F7E06809C993F6868A662405B41404B400CA42169993F50C3A282405B41403380DDD8562D993F6868A662405B414020400776EDEC983F68E09DA2415B414033802E4C67A6983F00B294C2425B4140ACFF4823F758983F90838BE2435B414057C0BC58F713983F90FB8222455B414043809016C2C5973F28CD7942465B414073404D807895973FA06D6D02485B414084BFF6A7106C973F586056024B5B41402C40A692C23B973FD87C38C24E5B41408BBFAF19A11E973FB8120F02545B4140C43FB6DCEF09973F98A8E541595B4140ADFF7AE5DF06973F38DCB5C15F5B4140D5BF10BBAFFD963FC8F28A21655B414051005C78FBFF963F588157C16B5B41400AC01D8261FB963F38992961715B41407B3F32697CF4963F08F8EFE0785B4140DB3F7603D2EC963F58B6C2A07E5B414015807E26FDE8963F384C99E0835B4140FFBF107D28E5963FA8316BE0895B414077008A61C1DC963F18993840905B414077FF065BDDCB963F10560EC0955B4140D87FF3F311BE963FB893E25F9B5B41407DFFCA0326AA963FB850B8DFA05B41405B40AB849691963F20BE929FA55B41403FC02E122E72963FC001749FA95B41404FC0B6ECB545963F00CC601FAC5B41404080CD59A42B963FC0B83CBFB05B4140100072A403F7953FD02A279FB35B414059004C0D0CD7953F882714BFB55B4140C03FA82AC0B9953F1867FEFEB85B41407540BCC5AF97953FB8B4E31EBC5B414057C00A44FE82953F20A0C27EC05B4140A77FBFCBD26F953FA8BCA43EC45B4140DCBFFBC21765953FC022755ECA5B4140E47FE33A6D5D953F280E54BECE5B414071C02D567E60953F804E22DED45B4140BE3F43E26067953F38B9021ED95B41402D4032D18077953F1094B79DE25B414085BF6AA3448F953FF823817DE95B4140AA7F192A786A953F1845735DEB5B41407A3F7C8C1F4E953FE06A755DEB5B414043C03561E42D953F501B7A9DEA5B41408F00F88DB4F6943F8079899DE85B4140ABFF0C1BACD2943FA8559D3DE65B41406140F8B782A8943F6091BD1DE25B4140D0FFBA4B5E74943F10CDDDFDDD5B41408DC070F2C558943F30B50B5ED85B4140C0FFC076CD37943F5029393ED25B41407B3F017AB906943F50625F9ECD5B41407AC09939DBDE933F609F7CBEC95B414080801CF0C1B7933F00A48CDEC75B41403980F2060596933F10D1987EC65B41401180C0BC955F933F48A79FBEC55B414025C043F39631933F1059A13EC55B4140A4BFF3985D04933F40ADAC1EC45B4140020011B08BDF923F50E4BCDEC15B4140E87FE566F2AC923FE8EED95EBE5B41407F3F7381EC71923F2802FEBEB95B41400D00E035FC2F923F780F15BFB65B41408BBF51C98CF9913FF0F232FFB25B4140890075654DB5913F307E4E9FAF5B4140E67FC34BF16A913FF0B3611FAD5B414037C082341743913FC81074DFAA5B414046C0CF7E9A16913FC016813FA95B4140907F786876E2903F48EE84BFA85B4140BCFF1AA812B9903F681584FFA85B41405D80A8871274903FC00C7D1FAA5B4140CEFF55D7ED28903FC80670BFAB5B4140E87F6E8F85B88F3F38B774FFAA5B41400100342ACE238F3F80327F1FAA5B41409EFF2BCDF2E48E3F001090FFA75B4140F37F6DE494628E3F589995FFA65B414081FF33772F228E3F481DA7FFA45B4140D68044093FE08D3F902ABEFFA15B4140C180689B0EA98D3FA05DD7FF9E5B414063008BB7B46B8D3F0814E99F9C5B4140BF00CDF242288D3F001AF6FF9A5B4140C700D96373EC8C3F88F1F97F9A5B4140E1FF208E618D8C3FC8C1F35F9B5B414077001662190E8C3F30F0FC3F9A5B4140157FCE0FB99F8B3FC8FA19C0965B4140E2FFEE4EF5668B3F600F3B60925B41406BFF7D49B1438B3F009C53408F5B4140D27F0CDD611D8B3FA0AA67808C5B4140CE7F2FF907E08A3FD8806EC08B5B4140F87E5D34D6918A3F98286C208C5B4140B8FF0181C4328A3F685265E08C5B4140E980DC7A5FF2893FB01C52608F5B4140F2802688D1AB893FF0E63EE0915B4140C47F70A42C76893FD02D33C0935B41409C7F5D285E3A893FF0D62D60945B4140B47FE18718E9883FC0002720955B4140E4FF2E4F29A7883FF015FF3F9A5B4140350071653F41883F40CACDDFA05B41403C808583DBDF873F388DB0BFA45B4140CC0017E54196873F9888A09FA65B414034808EBE9360873F68B2995FA75B4140CBFFE0A68318873FD8528D1FA95B4140087FFF53CA9B863FF8FB87BFA95B4140170057D38D61863F38CC819FAA5B4140BA0072F1FC11863F50F380DFAA5B4140F6FE0B7F28C6853FF001951FA85B4140E9001201756D853F705DAA9FA55B414013015FAFBD0A853F9006A53FA65B4140BF7F93B2F1D2843FF040C8DFA15B4140F3802AC9448E843F88CDE0BF9E5B41402CFF1AA65863843FF83E1420985B41409D808C41092E843F404C2B20955B41401180EF85CC0C843FD85648A0915B414017808C2D92E3833F20645FA08E5B4140117F0844A1C8833FF0C67EC08A5B4140E98039532D91833F98D59200885B414031806D94E871833F500BA680855B41409380AD8DC03E833F60B6B6C0835B41402000A49B4B11833F7865BEC0825B4140897FC67E3FCA823F78EDC680815B4140407FEDDD388C823F38CA91A0885B41403B0007DA1028823F10EE7D008B5B41401D00F5D1ACE3813FC0E673608C5B414000002046E780813FA8B967C08D5B4140C27F8EB2B325813F00295820905B4140B27F60AC23D2803FC09D3C80935B41401880D47D2160803F605915C0985B41408F80714FF704803F9878F1FF9C5B4140F7FD2B70F1717F3F58DDC4DFA25B41407A0112F889247E3F184298BFA85B414092011F33D90A7D3F107D72DFAD5B41401600D0C6985B7C3FC8795FFFAF5B4140ACFF81AB9FAB7B3FD8A212FFB95B4140FDFE26B5826C7A3F201EBB3EC55B41401201A0508C82793F50F068DECF5B4140F6FD22CEE618783FD8063E3ED55B41406400EE02DC2E773F1806F87DDE5B414070FEFC29BB84763F282FAB7DE85B41402BFF59A1DB5A753FD8EE7A7DEE5B41409101D070B9B0743F1870301DF85B414030004B7F1DA2733F6097755A525C41401CFF07BBFAAE513F004FF5F9625C41406420C0805BDA2D3F80EC0CF8A15C4140E203381802975FBFA8D8E8D4095D4140DE01A91D358E77BF90258834165D4140D6FEC4C90C3A7ABF00E0F274085D414086011346DE327ABFF8BE5396DB5C4140D701D27DE7B47ABF70EBA8B6D05C414063FFD96611277BBF4891F256C75C414059017EE440897BBF50A30A98A35C4140660157AC9F067DBFA86F9CF8905C4140D6FEE89241537EBF2053BA388D5C4140D10148DCBEA27EBFE00A2BF97E5C4140E8013531B0D07FBF9893DB59685C4140017FFA0203D380BF0044427A5B5C4140C0801976A83E81BFF81EE81A465C41406D8057E61A5781BFE88705BC215C414005012AED5B4D81BF3099755C135C414094000CFF055C81BF28A9E8BC045C4140777FAB52BCC281BFF0991DFDFD5B4140078106421A6482BF20F2817DF15B4140BA00436D5D6283BF18CD271EDC5B4140F480A06D02FA83BF0018759ED25B41401BFF89C5494384BF58ABE09EC45B41400E01F51F04AA84BFB8282EBFBA5B41406680E6FFC2E384BFD0E19BBFAC5B41403F806225DCE785BFA07DE13FA45B41407300E6EE91D286BFB032F69FA15B41400580CAC47A9187BF389202E09F5B4140877FE5F1810B88BFC82031609A5B41403D7FCF2F3DA689BF48FE4140985B414096807294143C8BBF78137C40915B4140DB7F48480C518DBFC863BDC0885B41406980CC5EC00F8EBF58B166A1735B4140857F6D5294F58EBFE8D1A1016C5B41406B80CF27ED6B8FBF28E5C561675B41406A80A9AD48B48FBFC82C0002605B41402AC021E87C3990BF882342A2575B414039007212CE9790BF782F5C62545B41407880E0D39CBC90BFA00B7002525B41408900862F16FD90BFF094D7E2445B41401040EBE03AA891BFC8FB4FA3355B4140DC7FDBD37A6492BF080F7403315B4140947F1956DAAA92BF08D0A2232B5B41407B7FF97E650393BFF0E1C943265B41407E7FFD37314F93BF287D5844145B41408040B50AAC2D94BF98AB6124135B41409B3F02F9775594BF38B07144115B4140FC3F3AE4CE9B94BF28B67EA40F5B4140D3FF569D810395BFD03C8A240E5B4140EBBF9497ED2495BF8839D924045B41408A80B813668695BF78062205FB5A41408E801CB4F9AD95BF10A34B65F55A4140D33FEB92F7C595BFE009C425E65A4140F67F3CC416ED95BFB8703CE6D65A41405E00392D1F1996BF58830BA7BC5A4140D53F6777CC6996BF18845167B35A41401D00769BCD6996BF90EFD947A25A41401840654C244596BF40FC39C8955A4140A0BF2DD4762096BFE09611497A5A41406F00D4F77AF495BF30776FAA4D5A4140B33F287DB90096BF00B5D28A405A41400580C6A080DE95BF7871448C115A414024539A8886DE95BFA8D9B98C025A4140D9BF533712C695BF58A7482DF0594140AD7FBC7FC1A895BFA0C82B2ED35941407440D3A3FF9E95BFB0C6776EC9594140AE3F819D72B795BF80B5F8EEB8594140B37FC89986DE95BF50614FEFAD5941404CC0D19320C695BF98FAC74F9E59414082FF690C218495BF706140108F5941401400A7703C5395BF28EAF070785941406040CBB2C70E95BF600D8831655941401980721301C394BF48EAE1915959414075C0846D3DA394BF907F015255594140B57F0747549E94BFE0086932485941405940EDE2428D94BF1071DE3239594140A53FC8DF9A9494BFC02E5C53295941409FBFF7570BC394BF38A4E85317594140D27FA43E844995BF80F032140E59414082FFC43EA3A295BF00CE43F40B5941406A00059189B795BFB013CAD4FA5841409CFF03D5207B96BFF0AE58D5E85841400B808CE4F01E97BFC09DD955D8584140F3BFD39D2C5797BFD8564756CA5841408300C40FA06F97BF587D8F16C1584140D1FF1687058797BF4017BFF6BA58414065C0A855C19697BFE05EF996B3584140A23FED3E46C797BF70792797AD584140A1BFDFADC6EE97BF707DE217965841407D8035667CD998BF20370798915841402FC0FD11B63A99BF30EC1BF88E584140B53FC9BF827399BFF0ECC398795841401180AE0C1C639ABF48E815596F584140E43F15FC7D999ABFC0533C596A58414026805FA2CDB39ABFD012B7B95A584140DE3FAC09EBC49ABFC89A215A4D584140953FC908C6C69ABF60AF42FA485841408F40926E5DC79ABFD0A87E1A4158414011408D4328AF9ABF6041B1BA3A58414017809F3A609B9ABFF8985EBB2458414040400A90D39D9ABFB013507B265841405A407410256E9ABF60CD121B2E5841407B408ACA230B9ABF6806D79A3558414091FF663286B399BF58C9B97A3958414090BFB4241C8799BF286BAA7A3B584140F73F62B27E5499BF703F9B1A3D584140EB3F02AEA52C99BF100B85DA3F584140E87F83F914C898BF505D7A1A41584140E8FF06CA849798BF20FF6A1A4358414042C08538857E98BFB8C6FB39515841407C00756279D197BF70B3D7D9555841407EC072875C8F97BFB87DC4595858414001807940CC6A97BF409A4439685841402A804C9E36D396BF5002C91878584140F0BF61DF831496BF381035B88A584140638007A5EB6695BF586692779F58414051C0793438BE94BF28475457A758414038404202AE7A94BFB0A207F7B05841400BC032F7142994BF10D362B6C5584140E9BF800B297493BF48E22D76CC58414039006865B10393BF58D613B6CF584140BB3F5F30E0AE92BFC0D10396D15841400A403A2C3A7D92BF386CEAF5D4584140864082DDA6FB91BF708BC635D9584140130064D9663F91BFE82BBAF5DA584140AF3F260436DD90BF10D9AB55DC5841401400DAE8D19190BF7052A0D5DD5841407AC003CACC2390BF482D5555E7584140480031D6E3308FBF204B3455EB5841404480835D683C8EBF20C938F5EA584140E57F476E4DBA8DBF407C37B5EA58414066FF976344658DBFD0D59875DE5841400781B5810B178DBFF8C1BD95D95841401880AEA3F3DF8CBFB83AFB95D158414068FF3AFF5A848CBFF05D9256BE584140A50089855CD48BBF6047BDF6B85841403C7F6DF6D7908BBF88F41037AE584140537FF762E80B8BBF785366F7A2584140460080C1D8BC8ABF18A1ADF799584140FD00092B227E8ABFA87C0A188E58414006001C4B5A1C8ABFC0357818805841400600D3FB93E689BF080817D96B584140AA7F2EB9E77F89BF303D73D95F5841404A7F6C38DBC588BF4878DC395258414082803EE6E2F387BF380CFFB94D5841402EFF56FA6BDA86BF003C05DA4C5841406B7F0858BAA186BFD069573A425841407A80E0B56C2987BF984A7BFA3D584140C97FE18A056A87BFC0F7CE3A335841403F0017B2CCB887BFC0058EDB1A5841401480F0C4F03488BF10E2929CF9574140897F7639B5CB88BF787B5EFEBE574140A28078E5E2BE89BF089BD1614E574140547F52773A978BBFF06E736A3456414011C0EF9B375890BF08E90F8B205641407B7FAB1EC37290BF5829408B1A564140883F3FAFD85C90BFA8C2B8EB0A564140C53F73A72A2390BFA8EDD31CD953414078FF7A6473D580BF60E415BDD0534140AF80B62D8D0980BF48C77C7DC3534140EB005EE570B07EBFE8CFE53DB65341404C00B0ED5C347EBF40DB487EA95341401DFEAE6FCC577EBFE8AEE47E95534140F6FFD9C924467EBFC819B6DF7A534140A100D53153FF7DBFF80327406C534140E2FF898C50647CBF88DF836060534140E900AB4B86167BBFB08CD7A0555341402601602A72927ABFD07E09214F53414049FEE97CB2417ABFD03F3841495341403600281C741B7ABF90F7462147534140F8FFBE05419679BF887B582145534140680039463D3A79BFD00A6B8142534140CD006F4186F378BF7891760141534140EA01A804598978BFD00A6B814253414055014A6F61D877BF387E52A145534140C7FE18BF959177BFD0C7400148534140DA00E445772777BF30845F01445341409200B85F827676BF606A77C1405341401600CACF0B4C76BF304F92413D534140B2FFEB3530FE75BF78DAADE1395341408FFEC856A1C575BF003ABA213853414077FEBA5E745B75BF8811BEA137534140E0FFC3C3F5D474BF5831B341395341409AFE04EEDB7174BF682599813C5341403701496408C873BFD0A284C13E53414055006A26382573BFF03B6EE141534140CEFF3E8FA79E72BFC85F5A4144534140AFFE9939822672BF58315161455341407B016FCB2EB571BF9089530145534140FB003075B02E71BF705E5D01445341402602E6EF94C470BFF8BD694142534140E8FE06043F4C70BFA0C6702141534140EBFC3F11FAB56FBFA0C67021415341409D0162FB9DE16EBF50BF668142534140A0FFD38A850D6EBF980B4F6145534140FEFC3DDE71AB6CBF68E665C14253414014FC917586496BBF801D768140534140E100AECE4D756ABF68F6764140534140C0014042F2A069BF10344BE14553414052FD4F69C98568BF588033C148534140B50008B53C9567BF282224C14A534140E2FC192DC55D66BF10731CC14B5341408703BC6DC75065BF809B18414C5341409B02AEF787D263BF58BF04A14E5341400F0346B2078D62BF102AE5E052534140F20326A7392361BF0879C7405653414023FFDF3A386B5FBFA03AADE0595341404704A881A4575CBFF0FE8C005E534140A1044083F99D59BF70A3778060534140CB058CA36CA357BF789D6A2062534140C2FAAF055C0E56BF10E758806453414037F9FF1A754C54BF786444C0665341402BFF7B80FFF751BF78DC3B00685341401A0560D1674C50BF98FD2DE069534140260E8026FE324CBF18201D006C534140FF0AE850A49346BFB0730F806D534140EDF42F15836943BFF83DFCFF6F5341407FE47FD2892A3ABFC067F5BF7053414099ECBFE425A933BF0038EF9F7153414037BC3FC6A63228BF0832E23F7353414089D201142E3CF3BED0E3E3BF725341400B4C00C094C31F3F9091EE7F71534140A706D0395AAA323FE010F05F71534140D520305FB058393FA0BEFA1F70534140A1F5FF0A77D3423FD89E05806E534140B40CB02802F5463F80A70C606D534140ACFF87F6BD624A3FE8531AE06B534140CDFFB74FD28C4D3F38E32C406953414052FA139B283F523FD86938C067534140E3F947C2CE7F553FA0113620685341402900A09FEAA9583F58041F206B534140EA0068ED4FDF5B3FA05007006E534140D6FA531A02315D3F28E5E0FF725341401406FCFCDA415F3F78A9C01F775341404AFFD389F527603F80E2849F7E53414057FDFD2210CB603FD812423F8753414035FC276B798A613F885A1AFF8B5341402500C8CDBF49623FD818EDBE9153414043FEF9942706643F50B9E07E935341404EFE5F7652D6643FC8DBCF9E95534140FFFFBD4EDBA0653F082EC5DE965341400BFD65F14C7C663FD8CFB5DE9853414007FFDBAD3241673F209AA25E9B5341400E04E68B3F4F683FD014941E9D5341409D03B406800E693F38887B3EA053414057FFA50030226A3FF0FC5F9EA3534140D600384C9A2A6B3FA06D4D3EA653414057FCEDABF4D86B3FF0B9351EA9534140FCFDD50FADBF6C3F50B525FEAA534140D9009478A9736D3FF0F806FEAE53414026FCC58D93766E3FB067DEFDB353414095FF67B4B8736F3FA02AC1DDB7534140380346693FB76F3FB8189ABDBC534140B10096D7123E703F7805765DC153414016FFAA6CDE8C703FA8A2563DC5534140C500093FEDC7703F283D3D9DC8534140BAFFE2AA3BE1703FB8CB093DCF534140AAFFD169BAF7703FA88EEC1CD3534140F101C475480E713FB882D25CD6534140CC00ABB5B443713F7075BB5CD953414082FE6C9F9581713F10C3A07CDC534140B1FE6BD247C2713FE8E68CDCDE53414059008F6A6E0B723FF05877BCE15341409800063FAC62723F707B66DCE3534140E1FF5D6A08B7723F78ED50BCE65341403E005CA79907733FE0D82F1CEB53414084000EDF9281733F0049045CF05341406EFF463BC2F7733FE056D2DBF6534140CFFEDE276557743F10F4B2BBFA534140E8FFC4B2DB5F743F5836977BFE53414030FF7E224268743FD852793B025441400CFFFF95E66D743F8018569B0654414051002DCD7365743F205C379B0A5441403A019F6C2686743FE0CA0E9B0F54414073FEF19D9DAE743F08EC007B11544140E300EB7E6225753F788CF43A135441401D018E6637C3753F00A9D6FA165441407D00C961867F763F9874C0BA19544140B1FE37B39DBC763F403A9D1A1E544140CB01A6BA5AD0763F502E835A2154414040FE323E3EB4763F784968DA24544140AA002F8F3F95763F188D49DA2854414046019F5D26D9763FA0A92B9A2C544140B601C8A6DE18773F88FA239A2D54414042FEF25C0A08783FA8251A9A2E5441401400AA5F7F98783F78C70A9A30544140E001DEBC8AEF783F58DBE57935544140F4FED5488A49793FC0D0C8F938544140C500D7624832793F38E9B3F93B5441404FFFF24D4205793FD8AE9059405441404B00F227DE8C783FF09C693945544140DF0003BCF32E783F905842794A544140D6FEA665CF5E783F48D333394C54414051FE425477EB783F687C2ED94C5441402D02A0436280793F687C2ED94C544140ACFFC3C771F1793F882529794D544140D401C4F87DC07A3FE82019594F544140FDFF2A2A27497B3FC03A01995254414091FFB23DCEC27B3FB085EC3855544140C9FEBDEFD8027C3F187BCFB8585441403401F13B3C3A7C3F20EDB9985B544140A90084B915767C3F508A9A785F544140290226C1F8C27C3F78A57FF86254414023008708C82F7D3F00C261B86654414075FF3FBC1EB47D3FE88A51F8685441407D01B9F500017E3F508034786C54414010FF457234727E3F801D15587054414061FF7EDED8DC7E3F08B2EE57755441407600CF1828217F3F781FC9177A5441405A00E18FB7697F3F686AB4B77C54414043FE4FC42FB07F3F4006985780544140B800BAB7DE13803FD04F86B7825441407000059E3239803FE8BB6337875441404CFFAEEB2E88803F60A52CF78D544140F3FF50F862AB803F98B4F7B694544140FD7EB57AD0B1803FE878D7D698544140227FC68F70DB803FF86CBD169C54414020817C494C18813F1806A7369F54414017015BC4FE52813F105B96F6A05441407D805BCECB7F813F001E79D6A454414023FF1C5E61D8813F40E86556A75441404100F385D00E823FE0B34F16AA5441407A0091173254823FA8222716AF5441401780038932C3823FE8640BD6B2544140FA809B838B08833FC088F735B55441407E7F1965423B833F20FCDE55B8544140F77E3BCCD67B833FA818C115BC54414042FF3C45BDC9833F80B4A4B5BF5441401381F7DB5A03843FE8A98735C3544140BC00D4358645843FD86C6A15C75441401880F2998975843F60014415CC544140A17F6889B997843F40971A55D1544140EB7E230638BF843F885BFA74D5544140F87EFAAE3BEF843F8028E174D85441406280A675E128853F889ACB54DB5441404F806E680C6B853F78E5B6F4DD544140CE005B5D1ED0853FA088A434E0544140FFFE593BF910863F50819A94E154414028FF4291814B863FC8A99614E2544140997FC5F2CD87863F60FD8894E354414028FF535F3DBE863F484E8194E45441400B818D9E4905873FC8F26B14E7544140237F3392A26D873F48155B34E95441409FFF6C195CB2873F68AE4454EC54414065FF6BE172EF873FB07831D4EE54414003FF6E2FB51A883F809C1D34F1544140E1FF9B568648883F6032F473F65441407000A289408D883FD811B913FE544140E97EEAC7D0F8883FF0B65A130A55414006FFC156F279893FE040179312554140C1FF88C53DD0893FA02DF33217554140A200FB8F33EA893FA8E4BB521E554140C400483D2D078A3FF8A28E12245541409BFF69EA2BFE893F88315BB22A554140A100623D3CEB893F001B24723155414037FF84F14AC7893FE028F2F1375541405D8070EC4BC9893F5890BF513E5541403F7FB13441EB893F909F8A1145554140198018E81C348A3F50045EF14A5541407A80BEF20C598A3F90952411525541408F80141F07748A3FE098D5105C5541408B801ED8FE898A3FC0A6A390625541405A7FA2DB43A98A3FB0A857506C554140477FAE647BB88A3F502B0A3076554140B4FFEA6289BD8A3F287EB6EF80554140C90032D5363F8A3FC0C7A44F835541404380A32FEA7E893F204199CF845541400E01C46045E0883F509FA8CF82554140488030AD4B62883F8830D1CF7D55414054808820A6FB873F7042F8EF78554140B7001C04509E873F601945F06E554140A57F3F9F59F6863FE0FC62306B5541402C80F25422B1863F30FEC1505F554140EEFE5CBAB4A7853FF8271DF1535541403980A6AFF495843F98B435D1505541402B7FA019576B833F704008F15655414026801BB8911F823F00180C7156554140F900A21CC0B3813FE8A12AD15255414085FF7DF7B799803F88B03E115055414067FE6ECBD3FB7E3F8063107156554140F4FF5C1022FD7C3F00C92911535541402D02465D15EF7A3F38172891535541400AFE792529E6793F103B14F155554140530195A8B90A793FF0D0EA305B554140E7FDD09E98E3773FB82FB1B06255414037003225254C773F10E876106A5541407FFE7E87FBF8763F987C50106F55414064014CABCB70763FB0E220307555414020FEF58630BB753FC84EFEAF795541407200D3E2F9FD743F78BFEB4F7C55414086FE98C94204743F906EF34F7B55414026FF28D1FF63723F60490AB0785541407B0072960EAD703FB0D81C1076554140F7FB4F5763486F3F208376D06A55414049025C8FD2D7693FF0E595F06655414008FE819ED8D3663F009BAA5064554140B0000EB61DC2643F0019AFF063554140A8032444D673623FD03C9B5066554140D4FF07D9D843603FB8838F306855414055F7D398DC375D3FB05076306B5541402A07503C3F435A3F10BA59306F55414061FD4FE8CB5E583F1071225076554140C3FFAFAC836F593F18B4EAEF7C5541402EFD6389ACDA5A3F781DCEEF80554140E40334F7260C5E3F2865A6AF85554140E60286A3A772613F70B18E8F8855414069FC290225D0633F18675A6F8F5541401F046649AED2653F58F8208F965541400301A8E0A2F3673FD059E18E9E5541405EFD9DAEF4C8693FE8C5BE0EA35541405DFDA1731C176C3FD84F7B8EAB554140330230343A946F3F30CF1A8EB75541401AFE0EF7704D723F2814F9CDBB554140CD0168DFFB6C733F28CBC1EDC2554140EAFD9E83D6DF743FE82F95CDC8554140CCFE18C250D8743FD0BB050DDB554140F3FFA6EDF775743F1847BFCCE35541400C0208F19048743F282B948CE955414053FFB553EAC7733FC03B5C8CF05541409DFF3DE7E3E4723F60F734CCF55541400FFFAC141955723FD858F5CBFD55414023FF34251FDC713F08ECD18B025641400901D8E01572713F284C954B0A56414032FEE9A21972713F30035E6B11564140E000D41329DC713FE87742CB14564140DC00ACDA3320723F40AE0CCB1B564140DA01CF047473723FC842E6CA205641409BFECE5F9A82723F9823A8AA28564140040014767A73723F386789AA2C564140AE01CD7F36DC713FB08978CA2E5641409AFF7D394108713FE05F7F0A2E564140730318AF9D1B6F3FE85972AA2F5641408701989BE7096D3FD0E93B8A365641405AFF5717B0176C3FA8BAECE94056414033FC439418CC6B3F20D982694E564140D0FB112482806B3FF86A00095F564140E2004A2E37CC6B3F788389286E564140AE02C6BA65456C3F28BB50687556414079FF43BE74286D3F807316C87C5641403DFE75AE2DDE6D3FF0DAE32783564140F2FCCF1CC2936E3FE0E2A4478B56414006FD7919FB1B6F3F202589078F564140BD0108C353A46F3FD06C61C7935641409A018298D552703FA0904D279656414060007FF45AC4703FE85A3AA798564140D9FFB838F544713F90593D6798564140E90117120AF3713F8065572795564140A7FE985F12D6723F180281878F56414037019AE7656D733FB08E99678C564140A0FE0ACD31FD733FB849BB27885641406600644C39E0743F104BB867885641408F00FB5B8BE1753F203F9EA78B56414003FE787DC59E763FA8D377A7905641402E01D209852E773FB83F5527955641404300B9D25E89773F008C3D079856414086018EBB090A783F68872DE799564140C6FF887314ED783F188023479B564140C3FDB254D21B7A3FC88C83C78E564140D0FEABDE9D597B3FC0D5BAA787564140AA016FAA1ECB7B3FA075F7E77F564140D1FDDF34C44B7C3F28D503287E564140F30019C7CC2E7D3FB824FFE77E5641400C00560F684E7E3F7021EC078156414067FED0886CFC7E3FF83DCEC7845641400C016B975F9B7F3FF0FAA3478A5641400EFFBE44D311803FA86584878E5641403900671AB259803F20D7550794564140F9FF29D8F8AC803FE8F64AA7955641404380DC074EED803FE8F64AA7955641403500555D0E5B813F78CE4E27955641407C80B4E95927823FA07B4087965641401C00DE1C320E833FD00E1D479B564140F7FE3DCF329A833F60A7ED06A156414034FF38D95735843F002AA0E6AA564140CE00C05936B2843F58E26546B2564140E700BDF111D8843F30F2E785C25641406500083C6DE3843F981232C5D956414014FFA89A0294843FE04AB084EA564140F60000F9EF1A843F28CC6524F4564140CF004B6DAC3B833F08623C64F9564140727FB7D796C2823FA89F1004FF564140FB7E1DF8412B823FA062F3E302574140747F299382BD813FE89ECA430857414014017E253C13813FD8E9B5E30A57414047801CF575B8803F203245231957414046FF794B88A5803F309E22A31D5741402B00CAAB10E2803FC86F19C31E57414008FFB1A07244813F58B90723215741407D00A5D2C445823FF094026321574140418085D98F0A833FC8B8EEC2235741400980E046C55D833F301CC5622957414002800B1EF5C3833F68313BA23A574140ABFFADF040FA843F60807FE2315741400100A0DD0DE1853F982512031F57414061FF5E61BC44873F30016F2313574140087F4A1A0E11883FF82A68E31357414005819613F4E4883F58E32D431B574140EE80731A798B893F8841DB62255741400AFF6CC1ED318A3FA0EC89C22F574140077FF2521CCD8A3F203E39423A574140F1FF0A85D5468B3FB0CC05E24057414078FF846DA5868B3FE8A2AA414C5741406200152159E68B3F38617D0152574140CB7F9116AB298C3FD8E32FE15B57414055FFD2CEB7A58C3FD89AF80063574140E2FEB8E425F08C3F10B0D02068574140CD7F4C3726178D3F301094E06F574140ACFFFC94B1418D3F281C4CC078574140CB80019AEF7D8D3F380021807E5741404700F2372DBA8D3F3084D09F88574140A1FFBBFF252F8E3F506C9C1F8F574140CF7FB12032848E3FD800761F945741406C7F0E7E15F28E3F38F261DF965741403AFF08F9B24A8F3F58A5609F965741403DFF21D045B58F3FA86940BF9A5741404400C35D585F903FA86940BF9A574140E13F38F73681903F181A45FF99574140708043291A9E903F88C0451F9A5741400F803AD0C4ED903F90C43CDF9A574140088077824966913F006B3DFF9A574140957F0B9B0BA0913FB0F53F3F9A57414004804656D7D1913F58F442FF995741400E00802C9015923F58F442FF9957414071FFE59B6044923F00F345BF995741409EFF94F4356D923F7825465F99574140040081200B94923FE8D54A9F985741409DBF883EE5B9923F5004547F975741402980F9A9BADF923FE0DB57FF965741405800083999FF923F40106E3F945741407F00A7F0682F933F0840745F935741405A4068D0474E933F909F809F9157414003005FE41C77933FA844847F915741408D0093330093933F40207FBF9157414079C016D8D0BE933FD8EB687F94574140747F0D9DA6E8933FC8AE4B5F9857414061C0EDCB8509943F087F453F99574140EB3FCF776923943FD8A2319F9B574140727F5AF0305A943FD8A2319F9B574140D23F9C840F7B943F70FC307F9B574140F1BF8ED2E99C943F302C379F9A5741402480B935A2E1943F1001419F99574140A3FFBD8E720F953F589053FF96574140ED3F740A3E42953F30ED65BF9457414057C0CDB11765953F18C6667F9457414020009F6DF686953FE07768FF93574140D8FF4889D9A2953FE07768FF935741400EC02F29BDBD953FE07768FF935741408E001F1A9CDC953FE07768FF93574140EE3F0E0B7BFB953F009F673F945741408A8049C6462D963F20CA5D3F95574140BB7F40422A4B963FD83A4BDF97574140B27FAA3CFB76963FF85B3DBF99574140E07F5AC3D599963F98A922DF9C5741409E3F7DB9B4B9963F684B13DF9E5741407C00A0AF93D9963F1844093FA057414066C01EC872F9963F783FF91EA257414056C081DA4725973F1011F03EA357414009C05E441D4E973FC08BE1FEA457414024C0E316F373973F700CE01EA5574140BF7FF84BC3A4973F180BE3DEA457414046C0FB3B94CE973F30BAEADEA357414039C01DBB7BE8973F98E8F3BEA25741404380A8385F03983FE07D137F9E574140D63F6653342A983F788EDB7EA557414078C01712B13A983F60969C9EAD5741406080E1153556983F60D56D7EB35741407E7FCCABB471983F28BC3CBEB95741408E3FA12C9D8B983F28F1A79DCC5741408BC05B93DBE7983F782319FDDE57414033000EB80751993F480A865CF157414044400693BFD4993F98BA997B0F5841407500BAD9F4A79A3FC049BBBA2B584140ACBFE803A1739B3F406244DA3A5841406F40469B39DD9B3F786350F959584140AD3FA907A47B9C3F280F54F879584140F17F29FAD94E9D3F5863FDF7845841403A4077BDC7A89D3F28C2619798584140D67F9253E0099E3F989DCD96AB58414017C0DECF00499E3F481466B6B8584140500002BEBF679E3FF8C32436C15841408D80131D13739E3F70B3FA55C658414016C05AD205809E3FD09ED9B5CA5841402C4001E2BD899E3F8809BAF5CE58414068800D37C49E9E3FE8498815D5584140807F2EF03DA59E3F00B05835DB58414005402198B7AB9E3F506E2BF5E0584140947F59200FB79E3FE0840055E65841408CC016A201C49E3F80C8E154EA584140B5BFBFBCF3D09E3F200CC354EE584140D6BF5D5A81DF9E3F287EAD34F158414081804410B2EF9E3F40F48ED4F4584140C93FADB443FE9E3FF0E677D4F7584140D4FF6C41700E9F3F38B16454FA5841400B008413DB219F3F30F64294FE584140727FD724AF369F3F30351474045941401E80A8C176289F3F90A8FB9307594140E27F3CD63BC59E3FF011DF930B594140AD3F560BC1B19E3FB0FEBA331059414089FF15425AA59E3F", + "created_at": "2021-02-15T01:24:01.342635", + "total_males": 57, + "total_females": 90, + "server_version": 1599045641951, + "geographic_level": 3, + "effective_end_date": null, + "effective_start_date": null + } + }, + "jurisdiction_id": "3c63f48e-bb86-42e5-b3ff-bc539fbf5295", + "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada" + }, + { + "id": "9ec52632-7bfb-40f5-9ef7-8804627a65cb", + "geojson": { + "id": "9ec52632-7bfb-40f5-9ef7-8804627a65cb", + "type": "Feature", + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [34.6632981430001, 0.052326005000054], + [34.6635536970001, 0.052321393000057], + [34.663748223, 0.052328287000023], + [34.663919864, 0.052322228000037], + [34.664148719, 0.052310744000067], + [34.664327988, 0.052264878000074], + [34.6645187, 0.05219457000004], + [34.664682713, 0.052098942000043], + [34.6647780690001, 0.05202100300005], + [34.6649230100001, 0.051878748000036], + [34.6650069240001, 0.051728113000024], + [34.665121351, 0.051600419000067], + [34.665243407, 0.051527794000037], + [34.6653959760001, 0.051428417000068], + [34.6656057610001, 0.051263223000035], + [34.665804101, 0.051105721000056], + [34.6660634690001, 0.050901592000059], + [34.666200782, 0.050841219000063], + [34.666303767, 0.050817471000073], + [34.666490664, 0.050806048000027], + [34.666650863, 0.050815998000076], + [34.6668377610001, 0.050849637000056], + [34.6670399160001, 0.050898586000073], + [34.6672191850001, 0.050920038000072], + [34.667352683, 0.050906299000076], + [34.6674747390001, 0.050863800000059], + [34.667650194, 0.050778802000025], + [34.6677989500001, 0.050637105000021], + [34.667932448, 0.050527794000061], + [34.6681002760001, 0.050454420000051], + [34.6682490310001, 0.050414613000044], + [34.668401601, 0.050387057000023], + [34.6685846840001, 0.05036369000004], + [34.668783024, 0.050340326000025], + [34.6689584800001, 0.050328646000025], + [34.669141563, 0.050313095000035], + [34.669362789, 0.050309231000028], + [34.6696488580001, 0.050254748000043], + [34.6698052410001, 0.050223567000046], + [34.6699654400001, 0.050169070000038], + [34.6701942940001, 0.050137952000057], + [34.670331607, 0.050137960000029], + [34.6705146900001, 0.050184665000074], + [34.6706176750001, 0.050200238000059], + [34.6707778730001, 0.050243126000055], + [34.6709075580001, 0.050262571000076], + [34.6710257980001, 0.050297648000026], + [34.6711669250001, 0.050363847000028], + [34.6712889820001, 0.050433927000029], + [34.6713919650001, 0.050515693000023], + [34.671479693, 0.05060958100006], + [34.6716246340001, 0.050710038000034], + [34.6718725600001, 0.050910945000055], + [34.6720251290001, 0.05107534900003], + [34.672147185, 0.051230558000043], + [34.6722997540001, 0.051404086000048], + [34.6724942810001, 0.051531986000043], + [34.6726926210001, 0.051559378000036], + [34.672868076, 0.051498008000067], + [34.673039718, 0.051467139000067], + [34.6731617730001, 0.051382016000048], + [34.673280015, 0.051304823000066], + [34.673440213, 0.051212075000024], + [34.673688139, 0.05108838600006], + [34.673936064, 0.050941513000055], + [34.674138219, 0.05084101500006], + [34.6743823310001, 0.050732832000051], + [34.6746150010001, 0.05063233900006], + [34.674817155, 0.050547343000062], + [34.6749773540001, 0.050315385000033], + [34.6751871370001, 0.049890236000067], + [34.6754350630001, 0.049557839000045], + [34.6755037200001, 0.049279566000052], + [34.6756448470001, 0.048931723000067], + [34.6758584450001, 0.048359681000022], + [34.676232241, 0.047764394000069], + [34.676453468, 0.047424306000039], + [34.676693766, 0.04720011400002], + [34.6769798340001, 0.046952791000024], + [34.677265902, 0.046674531000065], + [34.6777083540001, 0.046226200000035], + [34.677906695, 0.046025193000048], + [34.678078337, 0.045847433000063], + [34.67838729, 0.04566193200003], + [34.6786809870001, 0.045576883000024], + [34.679096739, 0.04548415000005], + [34.679405692, 0.045422349000035], + [34.679886287, 0.045383684000058], + [34.680305854, 0.04536833700007], + [34.6807597490001, 0.04529098200004], + [34.6812098290001, 0.045190559000048], + [34.6814882690001, 0.045128695000074], + [34.6818429940001, 0.04502820600004], + [34.682136691, 0.044920027000046], + [34.682476158, 0.044850474000043], + [34.6828690250001, 0.044734548000065], + [34.6831627220001, 0.044641812000066], + [34.6835594030001, 0.044541325000068], + [34.6837806290001, 0.044487204000063], + [34.684074326, 0.044433095000045], + [34.6843680220001, 0.044379043000049], + [34.684654091, 0.044263114000046], + [34.6849325310001, 0.04420900100007], + [34.6853978680001, 0.04421677800002], + [34.685622908, 0.044317240000055], + [34.6860615460001, 0.044433217000062], + [34.686511626, 0.044518313000026], + [34.6868282080001, 0.044572466000034], + [34.68714479, 0.044510602000059], + [34.6876063130001, 0.044402430000048], + [34.6882585500001, 0.044317401000058], + [34.6886285300001, 0.044224665000058], + [34.6890671680001, 0.044177183000045], + [34.6890862400001, 0.04432864000006], + [34.689112939, 0.044526974000064], + [34.689193038, 0.044615926000063], + [34.6893379790001, 0.04477257700006], + [34.689471477, 0.044854408000049], + [34.6896049760001, 0.044906542000035], + [34.6897689890001, 0.044936309000036], + [34.6900283570001, 0.044844692000026], + [34.6902572120001, 0.044777573000033], + [34.690573794, 0.044793903000027], + [34.690741621, 0.044824729000027], + [34.690882747, 0.044906620000063], + [34.691020059, 0.044989829000031], + [34.6911154160001, 0.045047963000059], + [34.6913442700001, 0.045256370000061], + [34.6914129260001, 0.045331382000029], + [34.6915845670001, 0.045486538000034], + [34.6916455950001, 0.045309549000024], + [34.691679923, 0.045213575000048], + [34.6917638360001, 0.045084754000072], + [34.691813423, 0.044996440000034], + [34.691870636, 0.044889683000065], + [34.691931664, 0.04478292400006], + [34.6919926910001, 0.044683543000076], + [34.692061348, 0.044543659000055], + [34.6920994910001, 0.044444335000037], + [34.692152891, 0.044326454000043], + [34.692191033, 0.044227070000034], + [34.692263504, 0.044113062000065], + [34.69233216, 0.044006243000069], + [34.692419887, 0.043954682000049], + [34.692511429, 0.043870051000056], + [34.692602971, 0.043814868000027], + [34.692732656, 0.043693357000052], + [34.6928585260001, 0.043608736000067], + [34.6929805820001, 0.04352035900007], + [34.6930873800001, 0.043435729000066], + [34.6931789220001, 0.043358416000046], + [34.693262835, 0.043288416000053], + [34.693430662, 0.043152286000065], + [34.6935107620001, 0.043027060000043], + [34.6935679750001, 0.042942457000038], + [34.693613747, 0.04282469900005], + [34.6936518890001, 0.042681126000048], + [34.693682403, 0.042544865000025], + [34.6937167310001, 0.042397729000072], + [34.6937701300001, 0.042301971000029], + [34.6938120880001, 0.042132578000064], + [34.6938578580001, 0.04197437800002], + [34.693915073, 0.041786678000051], + [34.6939608430001, 0.041639413000041], + [34.6940295000001, 0.041403828000057], + [34.6941095990001, 0.041275011000039], + [34.6941935130001, 0.041050429000052], + [34.694468139, 0.040343753000059], + [34.69448721, 0.040218549000031], + [34.694529167, 0.040097102000061], + [34.694590195, 0.039946153000074], + [34.694616895, 0.039640624000072], + [34.694658852, 0.039346161000026], + [34.6947122510001, 0.039003816000047], + [34.694750394, 0.038782983000033], + [34.6948076080001, 0.038528958000029], + [34.6948762640001, 0.03824187400005], + [34.6949182210001, 0.038017289000038], + [34.694941107, 0.03773019800002], + [34.694983064, 0.037505681000027], + [34.695002135, 0.037325347000035], + [34.6950479070001, 0.03714489400005], + [34.6950974920001, 0.03699031900004], + [34.6951165630001, 0.036846744000059], + [34.6951203780001, 0.036669976000042], + [34.6951699630001, 0.036493398000061], + [34.695204291, 0.036298256000066], + [34.6952386200001, 0.036151053000026], + [34.695276762, 0.036000106000074], + [34.695295833, 0.035852906000059], + [34.6953492330001, 0.035690892000048], + [34.6954102610001, 0.035470056000065], + [34.695494174, 0.035260168000036], + [34.695185221, 0.035139198000024], + [34.6948343110001, 0.034997102000034], + [34.694609271, 0.034875449000026], + [34.6944223730001, 0.034706483000036], + [34.69425836, 0.034551023000063], + [34.694048578, 0.034253600000056], + [34.693968479, 0.033820989000048], + [34.694170634, 0.033570853000072], + [34.6946512280001, 0.033550625000032], + [34.6950021380001, 0.033665536000058], + [34.695337792, 0.033706125000037], + [34.6957535450001, 0.033753467000054], + [34.695967142, 0.033645346000071], + [34.696131155, 0.033388452000054], + [34.69608157, 0.033138364000024], + [34.6958260160001, 0.033009957000047], + [34.695448406, 0.032955867000055], + [34.695108938, 0.03292209600005], + [34.6948343130001, 0.032834128000047], + [34.6946855580001, 0.032678669000063], + [34.6945635020001, 0.032523144000038], + [34.694433819, 0.032313612000053], + [34.69439949, 0.032036461000075], + [34.694601645, 0.031975652000028], + [34.6949678120001, 0.031968923000022], + [34.695292022, 0.03201626200007], + [34.695703961, 0.032077109000056], + [34.6961769270001, 0.032124454000041], + [34.696421039, 0.032117714000037], + [34.696543094, 0.031921703000023], + [34.6965545370001, 0.031793250000021], + [34.696432482, 0.031644544000073], + [34.696352382, 0.03154315200004], + [34.696043429, 0.031482315000062], + [34.695772618, 0.031461987000057], + [34.695574277, 0.031421469000065], + [34.695272952, 0.031407886000068], + [34.6951013120001, 0.031333559000075], + [34.6949601850001, 0.031218594000052], + [34.694864828, 0.031137518000037], + [34.6947504010001, 0.030921180000064], + [34.6947771010001, 0.030772480000053], + [34.694895343, 0.030664349000062], + [34.6952691390001, 0.030482041000027], + [34.6951394550001, 0.030402587000026], + [34.69506317, 0.030328516000054], + [34.6949716280001, 0.03026681700004], + [34.6948610160001, 0.030211241000075], + [34.6947732880001, 0.030149480000034], + [34.6946512320001, 0.030093964000059], + [34.6945291760001, 0.030044580000038], + [34.694365164, 0.029995190000022], + [34.6941897090001, 0.029951924000045], + [34.6940028110001, 0.029927223000072], + [34.693815914, 0.029902521000054], + [34.693686229, 0.029822318000072], + [34.6935527300001, 0.029785243000049], + [34.693396347, 0.029735850000066], + [34.693136978, 0.029692646000058], + [34.692736483, 0.029575360000024], + [34.692156718, 0.029334550000044], + [34.691557883, 0.028964158000065], + [34.6912222300001, 0.028621107000049], + [34.6902457850001, 0.027815402000044], + [34.6892960390001, 0.027211094000052], + [34.688834516, 0.026808277000043], + [34.6879724980001, 0.026031328000045], + [34.6870532660001, 0.025225633000048], + [34.6864925740001, 0.024723168000037], + [34.6859318800001, 0.024321967000049], + [34.6853559300001, 0.02397008500003], + [34.6851652180001, 0.023871253000038], + [34.6849859490001, 0.023766355000021], + [34.6847380230001, 0.023661391000076], + [34.6845244260001, 0.023598497000023], + [34.684654111, 0.023450363000052], + [34.6846884390001, 0.023347791000049], + [34.6847189530001, 0.023248974000069], + [34.6847265810001, 0.023089458000072], + [34.684722767, 0.02290325000007], + [34.6846693680001, 0.022758920000058], + [34.68463504, 0.022603152000045], + [34.6845778270001, 0.022435945000041], + [34.68453587, 0.022314365000057], + [34.684474842, 0.022192787000051], + [34.6843794870001, 0.022071209000046], + [34.6843222730001, 0.02193825300003], + [34.684242173, 0.021771107000063], + [34.6842116600001, 0.021657091000066], + [34.684204031, 0.021467135000023], + [34.684204031, 0.021349372000032], + [34.684204031, 0.02123160900004], + [34.684204031, 0.021129035000058], + [34.6842192890001, 0.021022654000035], + [34.684226918, 0.020893450000074], + [34.684295574, 0.020760507000034], + [34.6843756740001, 0.020566740000049], + [34.684406187, 0.020391974000063], + [34.6844328870001, 0.020129827000062], + [34.684436702, 0.020000689000028], + [34.684436702, 0.019875302000059], + [34.6843642320001, 0.019666336000057], + [34.684337532, 0.019567576000043], + [34.68421929, 0.019442180000055], + [34.6841353770001, 0.019282592000025], + [34.6841277500001, 0.019115451000062], + [34.6841315630001, 0.01900906700007], + [34.6841849630001, 0.018853304000061], + [34.684211663, 0.018735542000059], + [34.6842955760001, 0.018553156000053], + [34.684310833, 0.018431584000041], + [34.6843451610001, 0.018287260000022], + [34.6843680470001, 0.018142866000062], + [34.6843794910001, 0.017994731000044], + [34.6843871190001, 0.01783896400002], + [34.6843871190001, 0.017660382000031], + [34.6843947470001, 0.017402043000061], + [34.6844176340001, 0.017212087000075], + [34.684413819, 0.016991757000028], + [34.6843909350001, 0.016532016000042], + [34.6843871200001, 0.016228112000022], + [34.6844100060001, 0.016117915000052], + [34.6844100060001, 0.01598871300007], + [34.684284136, 0.015482469000062], + [34.6842917660001, 0.015279196000051], + [34.684207852, 0.015110176000064], + [34.684055282, 0.014900581000063], + [34.683856942, 0.014738366000074], + [34.683547989, 0.014515260000053], + [34.6833725330001, 0.014400360000025], + [34.683101723, 0.014285457000028], + [34.6828652400001, 0.014204310000025], + [34.682708856, 0.014129921000062], + [34.682491444, 0.01398795700004], + [34.682190119, 0.013751351000053], + [34.6820146640001, 0.013622948000034], + [34.6816675690001, 0.013440411000033], + [34.6814654140001, 0.013318699000024], + [34.6811450170001, 0.013086530000066], + [34.680828435, 0.01279054400004], + [34.6805194830001, 0.012473055000044], + [34.680294443, 0.01215544400003], + [34.6802715580001, 0.011751280000055], + [34.680633911, 0.011361572000055], + [34.6812098620001, 0.010683163000067], + [34.681476859, 0.010242946000062], + [34.680950495, 0.009651103000067], + [34.680778853, 0.00945619700002], + [34.680706383, 0.009297489000062], + [34.680698756, 0.008922136000024], + [34.6806262850001, 0.008431335000068], + [34.680591957, 0.008243685000025], + [34.6804546440001, 0.008128228000032], + [34.680019821, 0.008164331000046], + [34.679939722, 0.008337469000026], + [34.6797757090001, 0.00866224300006], + [34.679657467, 0.008871570000053], + [34.6794858260001, 0.00916021200004], + [34.6793256280001, 0.009391162000043], + [34.6790319310001, 0.00981700400007], + [34.6785208220001, 0.01004793200002], + [34.6778113730001, 0.010199407000073], + [34.677315521, 0.010177746000068], + [34.6770904810001, 0.010105538000062], + [34.676789156, 0.009867369000062], + [34.6766137020001, 0.009571454000024], + [34.67646876, 0.009304420000035], + [34.6764268050001, 0.008864119000066], + [34.676442062, 0.008474457000034], + [34.676442062, 0.008265123000058], + [34.676392476, 0.008142418000034], + [34.676224651, 0.007983581000076], + [34.6760949660001, 0.007846499000038], + [34.6759271390001, 0.007716535000043], + [34.675812712, 0.007564949000027], + [34.6757478710001, 0.007398993000038], + [34.675724985, 0.007124710000028], + [34.6757783850001, 0.006908194000061], + [34.676014868, 0.006785507000075], + [34.6762322800001, 0.006677262000039], + [34.6766137050001, 0.006374189000041], + [34.6765717480001, 0.006085472000052], + [34.676514535, 0.005868948000057], + [34.676426808, 0.005746241000054], + [34.676289495, 0.005659599000069], + [34.676136925, 0.005522510000048], + [34.676037755, 0.005342049000035], + [34.676030127, 0.005096649000052], + [34.676159811, 0.004880137000043], + [34.6762551670001, 0.004743002000055], + [34.6764268090001, 0.004598686000065], + [34.6765259790001, 0.004382171000032], + [34.6765336070001, 0.004216154000062], + [34.676457322, 0.004093509000029], + [34.6763848520001, 0.00398524700006], + [34.676239912, 0.003862537000032], + [34.6761254840001, 0.00379752200007], + [34.675877558, 0.003732566000053], + [34.6756830320001, 0.003645982000023], + [34.6754579920001, 0.00355933000003], + [34.6752367660001, 0.003451060000032], + [34.6747752430001, 0.003393276000054], + [34.6742679490001, 0.003357176000065], + [34.6738560110001, 0.003393219000031], + [34.673539428, 0.003429264000033], + [34.673329645, 0.003544762000047], + [34.67328006, 0.003797348000035], + [34.673302945, 0.004158263000022], + [34.6732381030001, 0.004360402000032], + [34.6731160470001, 0.004504660000066], + [34.6728757500001, 0.004519084000037], + [34.67272318, 0.004504636000036], + [34.672509582, 0.004425242000025], + [34.6724065980001, 0.004360352000049], + [34.672189186, 0.004259205000039], + [34.671952703, 0.004259191000074], + [34.671807761, 0.004360315000042], + [34.6715636500001, 0.004475687000024], + [34.6714034510001, 0.004612818000055], + [34.671189854, 0.004829326000049], + [34.6710143980001, 0.004952017000051], + [34.6707474020001, 0.00499531600002], + [34.670190523, 0.00508910700006], + [34.670011253, 0.005096281000021], + [34.6697938410001, 0.004742607000026], + [34.6696641570001, 0.004468385000052], + [34.6692979910001, 0.003854860000047], + [34.6690386230001, 0.003428989000042], + [34.66890131, 0.003147581000064], + [34.6686571990001, 0.002923792000047], + [34.6684397880001, 0.002663937000023], + [34.6682300040001, 0.002418587000022], + [34.6681422770001, 0.002129867000065], + [34.667997337, 0.001833952000027], + [34.66787528, 0.001639050000051], + [34.6676731270001, 0.001552466000021], + [34.6674557150001, 0.001487445000066], + [34.6673336580001, 0.001602947000038], + [34.6672421170001, 0.001783338000052], + [34.667184902, 0.001985477000062], + [34.6671124320001, 0.002252501000044], + [34.667123874, 0.002533968000023], + [34.667203973, 0.002786563000029], + [34.667322214, 0.003154670000072], + [34.6676654950001, 0.003818697000042], + [34.667745595, 0.00407129000007], + [34.6678256930001, 0.004489898000031], + [34.6678562070001, 0.004886876000057], + [34.6677761070001, 0.005125023000062], + [34.667638794, 0.005305471000042], + [34.667451896, 0.005478664000066], + [34.667299326, 0.005608542000061], + [34.6670742860001, 0.005687852000051], + [34.6668454310001, 0.005832287000032], + [34.6666852330001, 0.006113744000061], + [34.666612763, 0.006323014000031], + [34.666597505, 0.006575664000025], + [34.66670049, 0.007077344000038], + [34.666505962, 0.007564380000019], + [34.666589876, 0.00810569500004], + [34.6667004880001, 0.008643628000073], + [34.666715745, 0.008849276000035], + [34.6665288460001, 0.009482079000065], + [34.666624202, 0.010051643000054], + [34.666971297, 0.010573780000072], + [34.6673336490001, 0.011080044000039], + [34.667448076, 0.011212063000073], + [34.6677532160001, 0.011532426000031], + [34.667901971, 0.011710451000056], + [34.6680545400001, 0.011906234000037], + [34.6681155680001, 0.012146513000062], + [34.668069797, 0.012449102000062], + [34.667997326, 0.01281588400002], + [34.667669301, 0.013056825000035], + [34.667367976, 0.013047184000072], + [34.6670704650001, 0.013018160000058], + [34.6668721240001, 0.012958518000062], + [34.666566985, 0.01291661800002], + [34.666349574, 0.012865163000072], + [34.666170304, 0.012794710000037], + [34.6659643350001, 0.012655744000028], + [34.665769809, 0.012590974000034], + [34.6655714680001, 0.012587152000037], + [34.6653655000001, 0.012655707000022], + [34.6651633450001, 0.012691825000047], + [34.6649878900001, 0.012709001000076], + [34.664770478, 0.012653735000072], + [34.664629351, 0.012604220000071], + [34.664369983, 0.012439626000059], + [34.664003816, 0.012193328000023], + [34.663771147, 0.011988167000027], + [34.663610949, 0.011857080000027], + [34.6635384790001, 0.01176969100004], + [34.663462194, 0.01168718100007], + [34.6633668370001, 0.011570663000043], + [34.663301995, 0.011439581000047], + [34.6632257110001, 0.01124055400004], + [34.6631951970001, 0.011105041000064], + [34.6631494270001, 0.011001214000032], + [34.66313417, 0.01088620400003], + [34.663092213, 0.010774562000051], + [34.663023557, 0.010650861000045], + [34.662943458, 0.010458085000039], + [34.66285573, 0.010331880000024], + [34.662764189, 0.010221926000042], + [34.6626383190001, 0.010130346000039], + [34.662478121, 0.01005501700007], + [34.662325551, 0.009989810000036], + [34.6622073090001, 0.009898232000069], + [34.6621005110001, 0.009772024000029], + [34.6619898980001, 0.009662131000027], + [34.661875471, 0.009513548000029], + [34.6617801150001, 0.009390372000041], + [34.661707645, 0.009293642000046], + [34.6615932170001, 0.009161372000051], + [34.6614406480001, 0.008949653000059], + [34.661356735, 0.008817319000059], + [34.66128045, 0.008713494000062], + [34.6611622080001, 0.00854453300002], + [34.66110881, 0.008459082000059], + [34.6610134530001, 0.008347126000047], + [34.6609142830001, 0.008231048000027], + [34.660788413, 0.008151654000073], + [34.6605824440001, 0.008139394000068], + [34.6603764760001, 0.008072249000065], + [34.660239163, 0.007921596000074], + [34.6601666920001, 0.007850399000063], + [34.6600560790001, 0.007736384000054], + [34.6599759800001, 0.007669179000061], + [34.659831039, 0.007599980000066], + [34.659678469, 0.007534835000058], + [34.659560228, 0.007433133000063], + [34.65945343, 0.007325176000052], + [34.6593847730001, 0.00725185400006], + [34.659270346, 0.00712564600002], + [34.659163547, 0.007021877000057], + [34.6590453060001, 0.00694855200004], + [34.6589575780001, 0.006891475000032], + [34.6588507800001, 0.006838653000045], + [34.6587706810001, 0.006777578000026], + [34.65867151, 0.006661561000044], + [34.658614297, 0.006531231000054], + [34.658595226, 0.00633377500003], + [34.658595226, 0.006225952000023], + [34.658576155, 0.00608393300007], + [34.658522756, 0.00594979300007], + [34.658362557, 0.005904152000028], + [34.658213802, 0.005993717000024], + [34.6580803040001, 0.006108531000052], + [34.6579887610001, 0.006151469000031], + [34.6578819630001, 0.006173649000061], + [34.657733207, 0.006087820000062], + [34.657672179, 0.006004808000057], + [34.6576416660001, 0.005867043000023], + [34.6576111520001, 0.005638952000027], + [34.657496725, 0.005578184000058], + [34.657374669, 0.005513428000029], + [34.6572678700001, 0.005542987000069], + [34.6571687000001, 0.005569796000032], + [34.657035202, 0.005550972000037], + [34.6569512890001, 0.005492711000045], + [34.656836862, 0.005313126000033], + [34.6567834620001, 0.005162606000056], + [34.656726248, 0.005049339000038], + [34.6565736790001, 0.005010748000075], + [34.6564516230001, 0.004979565000042], + [34.656318125, 0.004987622000044], + [34.6562036980001, 0.00498224100005], + [34.6560892700001, 0.004974230000073], + [34.6559710290001, 0.004966159000048], + [34.6557726880001, 0.004874953000069], + [34.6556124910001, 0.004762243000073], + [34.655478992, 0.00464592000003], + [34.6553912640001, 0.004569085000071], + [34.655326422, 0.004488633000051], + [34.655238694, 0.004405433000045], + [34.655166224, 0.004335671000035], + [34.655070869, 0.004273972000021], + [34.654979327, 0.00421496000007], + [34.654880157, 0.004164012000047], + [34.6547619150001, 0.004142502000036], + [34.65455976, 0.004121049000048], + [34.654456775, 0.004096915000048], + [34.654338534, 0.00404059300007], + [34.654197407, 0.003965448000031], + [34.654048652, 0.003871559000061], + [34.65393041, 0.003839360000029], + [34.6537778410001, 0.003718651000042], + [34.6536557850001, 0.003595191000045], + [34.6535985720001, 0.003509367000049], + [34.653510845, 0.003399351000041], + [34.653430745, 0.003316213000062], + [34.6533277610001, 0.003190130000064], + [34.653232405, 0.003058672000066], + [34.6531790060001, 0.002967476000038], + [34.653102721, 0.002838706000034], + [34.653041693, 0.002744818000053], + [34.653003551, 0.002640179000025], + [34.6529387090001, 0.002543603000049], + [34.6528853090001, 0.002444341000057], + [34.6527098540001, 0.002232432000028], + [34.652564914, 0.002141225000059], + [34.6523017310001, 0.002049953000039], + [34.6520728770001, 0.001972179000063], + [34.651947007, 0.001907791000065], + [34.651794437, 0.001781704000052], + [34.65170671, 0.001701191000052], + [34.651615168, 0.001505355000063], + [34.651603725, 0.001312210000037], + [34.6516494960001, 0.001113691000057], + [34.6517295960001, 0.00090179700004], + [34.651775366, 0.000805228000047], + [34.6518096950001, 0.000700594000023], + [34.651859281, 0.000574525000047], + [34.651897423, 0.000386756000069], + [34.6519012370001, 0.000284812000075], + [34.6519393790001, 0.000121170000057], + [34.6519546370001, -1.8343999955e-5], + [34.6519050520001, -0.000184614999966], + [34.651878352, -0.000299998999935], + [34.6518554670001, -0.000399263999952], + [34.651779182, -0.000592411999946], + [34.6517334120001, -0.000688986999933], + [34.65166857, -0.000860570999976], + [34.651611356, -0.000994778999939], + [34.6515732130001, -0.001096724999968], + [34.6515045580001, -0.001238931999978], + [34.651432087, -0.001346196999975], + [34.651382502, -0.001442771999962], + [34.6513062180001, -0.001563542999975], + [34.651180348, -0.001729879999971], + [34.651069734, -0.001917652999964], + [34.6509667510001, -0.002091991999976], + [34.6508370660001, -0.002264513999933], + [34.650764596, -0.002419724999925], + [34.6507493390001, -0.002601994999964], + [34.6507188250001, -0.002730259999964], + [34.6506577970001, -0.002878778999957], + [34.6505700700001, -0.002993481999965], + [34.6503984290001, -0.003128502999971], + [34.650406058, -0.003229762999979], + [34.650474715, -0.003330957999935], + [34.650554813, -0.003499719999979], + [34.650467086, -0.003668556999969], + [34.650425129, -0.003769691999935], + [34.650425129, -0.003870952999932], + [34.6504594580001, -0.003978963999941], + [34.6505128580001, -0.004093724999962], + [34.650543371, -0.00419491699995], + [34.650554814, -0.004323179999972], + [34.6505204860001, -0.004431255999975], + [34.650448016, -0.004545835999977], + [34.6503526590001, -0.004674166999962], + [34.6502840040001, -0.004829437999945], + [34.6501848340001, -0.004991396999969], + [34.650135248, -0.005085906999966], + [34.6501505050001, -0.005214170999977], + [34.6502039050001, -0.00531542799996], + [34.650306889, -0.005369365999968], + [34.6504136880001, -0.005443616999969], + [34.6505128590001, -0.005484112999966], + [34.6506349150001, -0.005652871999928], + [34.6505624440001, -0.00575407499997], + [34.650467088, -0.005821590999972], + [34.6504213170001, -0.005990359999942], + [34.650467088, -0.006091617999971], + [34.6505471880001, -0.006159056999934], + [34.650608215, -0.006246808999947], + [34.6506730580001, -0.006373837999945], + [34.6503335900001, -0.006303794999951], + [34.65010855, -0.0062582199999], + [34.6500131930001, -0.00617558099998], + [34.6497728960001, -0.005970740999942], + [34.649589813, -0.005912337999973], + [34.6493876580001, -0.005847031999963], + [34.649196945, -0.005784751999954], + [34.643799791, -0.003914040999973], + [34.643281055, -0.003803418999951], + [34.642808088, -0.00370209099998], + [34.6424724350001, -0.003630233999957], + [34.6422016240001, -0.00357164199994], + [34.6419117410001, -0.003458713999976], + [34.6414158900001, -0.003267193999932], + [34.641118378, -0.003091964999953], + [34.640897153, -0.002962749999938], + [34.6404737710001, -0.002673268999956], + [34.640199146, -0.002484314999947], + [34.639417226, -0.002049380999949], + [34.6391120860001, -0.001701422999929], + [34.6389824020001, -0.001266444999942], + [34.638806946, -0.000831472999948], + [34.6384598490001, -0.000483527999961], + [34.638353051, -0.000411304999943], + [34.6380707970001, -0.000222488999952], + [34.6375902020001, -0.000179089999961], + [34.637243106, -0.000222600999962], + [34.6369608520001, -0.000269299999957], + [34.6367205550001, -0.000309586999947], + [34.636415415, -9.2150999933e-5], + [34.6361980040001, 0.000255787000071], + [34.6358699790001, 0.000436193000041], + [34.6357212230001, 0.000516784000069], + [34.6352863990001, 0.000429804000021], + [34.6349393040001, 0.000125255000057], + [34.63450448, -0.000266247999946], + [34.6340696570001, -0.000440280999953], + [34.633634833, -0.000309811999955], + [34.6332419660001, 8.1646000069e-5], + [34.6331122820001, 0.000603616000035], + [34.632807142, 0.000951583000074], + [34.6322426340001, 0.001343030000044], + [34.6318078100001, 0.001430050000067], + [34.6313272150001, 0.001473526000041], + [34.6308504350001, 0.001516972000047], + [34.6301982000001, 0.001603989000046], + [34.629675648, 0.001864850000061], + [34.6291111400001, 0.00225629800002], + [34.6288327, 0.00237523900006], + [34.6285008620001, 0.002517247000071], + [34.627894397, 0.002473756000029], + [34.6275015300001, 0.002343205000045], + [34.6268912510001, 0.002082166000037], + [34.6266395110001, 0.001984517000039], + [34.6264335430001, 0.001905630000067], + [34.6266814680001, 0.002290099000049], + [34.6278867660001, 0.00431175600005], + [34.6286419850001, 0.005385845000035], + [34.629767186, 0.006411082000056], + [34.6307398170001, 0.007460812000033], + [34.6314263790001, 0.008046664000062], + [34.632303655, 0.00880341800007], + [34.6342565460001, 0.00951142200006], + [34.635450403, 0.010024110000074], + [34.6368197150001, 0.010805339000058], + [34.6384789100001, 0.011342434000028], + [34.640332631, 0.012221321000027], + [34.641846883, 0.013051309000048], + [34.6434107220001, 0.013949873000058], + [34.6456763800001, 0.015248454000073], + [34.6456763800001, 0.015565741000046], + [34.6456763790001, 0.015907460000051], + [34.6458251350001, 0.016517781000061], + [34.646191302, 0.016786272000047], + [34.64670241, 0.016981509000061], + [34.6490710510001, 0.020521140000028], + [34.6512337230001, 0.02335712200005], + [34.652084298, 0.025131419000047], + [34.652141511, 0.025258061000045], + [34.65343835, 0.027966416000027], + [34.6539303870001, 0.02873852700003], + [34.6551204290001, 0.030602785000042], + [34.656268513, 0.033092676000024], + [34.659476286, 0.037921740000058], + [34.6603573740001, 0.039863181000044], + [34.660830339, 0.040904065000063], + [34.663668129, 0.046841595000046], + [34.6635651450001, 0.046982225000022], + [34.663469789, 0.047076855000057], + [34.663340104, 0.047158171000035], + [34.6632333060001, 0.047320864000028], + [34.6631837200001, 0.047461941000051], + [34.6631837200001, 0.047566509000035], + [34.663149392, 0.047712587000035], + [34.663095992, 0.047820468000054], + [34.6630311500001, 0.047933355000055], + [34.662928165, 0.048054486000069], + [34.6628061100001, 0.048192243000074], + [34.662737453, 0.048273622000067], + [34.6626611680001, 0.048351621000052], + [34.6625848830001, 0.04842962500004], + [34.662489527, 0.048600575000023], + [34.662409428, 0.048758274000022], + [34.6623560290001, 0.048902663000035], + [34.662287372, 0.049052047000032], + [34.662230159, 0.049183184000071], + [34.662184387, 0.04931100500005], + [34.6621233590001, 0.049438825000038], + [34.6620737740001, 0.049553338000067], + [34.6620318170001, 0.049666219000073], + [34.6619822320001, 0.049782353000069], + [34.6619288320001, 0.049905237000075], + [34.6618601760001, 0.05004131000004], + [34.6617877050001, 0.050235450000059], + [34.6617381200001, 0.050326830000074], + [34.6616618350001, 0.050481154000067], + [34.6616313210001, 0.050580788000048], + [34.6615817360001, 0.050718549000067], + [34.6615283360001, 0.050876186000039], + [34.6614787510001, 0.05097581900003], + [34.6613795800001, 0.051151772000026], + [34.661326181, 0.051249714000051], + [34.6612689670001, 0.051350910000053], + [34.6611659820001, 0.051498667000033], + [34.661104955, 0.05158166800004], + [34.6610095980001, 0.051757622000025], + [34.660933313, 0.05184556100005], + [34.6608455850001, 0.051993257000049], + [34.6607387870001, 0.052129389000072], + [34.6606663160001, 0.05221221100004], + [34.660792186, 0.052286974000026], + [34.6609294990001, 0.052309609000019], + [34.6612384520001, 0.05232350600005], + [34.661852545, 0.052348606000066], + [34.662291183, 0.052348633000065], + [34.662600136, 0.052412222000044], + [34.6630158890001, 0.052338174000056], + [34.6632981430001, 0.052326005000054] + ] + ] + ] + }, + "properties": { + "id": "9ec52632-7bfb-40f5-9ef7-8804627a65cb", + "uid": "9ec52632-7bfb-40f5-9ef7-8804627a65cb", + "code": "9ec52632-7bfb-40f5-9ef7-8804627a65cb", + "name": "mungoma", + "type": "Feature", + "status": "Active", + "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada", + "version": 0, + "geometry": "0106000020E6100000010000000103000000010000002003000068D71BF4E6544140BD3F696079CAAA3FA8E0D953EF5441403F00A29FDEC9AA3F1848A7B3F5544140FE3FA4F2C5CAAA3FC0857B53FB54414018603AA4FAC9AA3F88E441D302554140E55F6B4D79C8AA3F882313B30855414036C07A4B76C2AA3F500AE2F20E554140ED9F5B263FB9AA3FA046B95214554140D8BF1768B6ACAA3F08BAA0721755414014402E357FA2AA3F70277B321C554140400009ECD98FAA3FD01867F21E554140E0DF3C731B7CAA3F503549B222554140E65F21C05E6BAA3FF0782AB226554140CA5F21DCD961AA3FB8E701B22B55414017603352D354AA3F20C3CF913255414009A08B542C3FAA3F40AB9B113955414017E0AA70872AAA3F3035589141554140D7BFE801C60FAA3F40A135114655414030C0C939DC07AA3FC03B1C7149554140F87F0560BF04AA3F187CEA904F55414024C032154003AA3FB837C3D05455414045400CF38D04AA3FD89D93F05A5541402680DBAFF608AA3F682C609061554140BDDF9024610FAA3F686B317067554140F8BFD7F33012AA3F08310ED06B5541402A40BBF26310AA3FA874EFCF6F55414025E019EBD10AAA3FF832C28F755541401920D7DBADFFA93FD8469D6F7A554140E8DFE04B1BEDA93F780C7ACF7E554140FDDF896DC7DEA93F38EF514F845541400680AD6729D5A93F50DD2A2F895541403DC026B4F1CFA93FD071042F8E554140F1DFE91355CCA93F8031D42E94554140EA7FE90245C9A93FA019A0AE9A554140BC1FAE0B35C6A93FB8FD746EA0554140C67F3E21ADC4A93F60BD446EA6554140C0DF2B53A3C2A93F10F50BAEAD554140CAFFA9AB21C2A93F0075C40DB7554140FBFF4186FDBAA93F70649A2DBC5541400AE08143E7B6A93F1020736DC1554140EF7FD7A5C2AFA93F185937EDC855414011E04180AEABA93F28C5146DCD554140EEFFF9C4AEABA93FD884E46CD3554140CE3FDFEDCDB1A93F581FCBCCD6554140FE5FEC78D8B3A93F38B5A10CDC55414012C0098E77B9A93FF01F824CE05541402C00510504BCA93F6097602CE45541402FA073029DC0A93F20843CCCE8554140D91F88474AC9A93F80ED1FCCEC5541402DE025C679D2A93F783C022CF05541403F60BD6231DDA93F80AEEC0BF3554140E5DF84BE7FE9A93FF01BC7CBF75541401A009485AAF6A93FD82388EBFF554140F03F91D7FF10AA3FA0925FEB0456414025802C538C26AA3F38D640EB0856414008005546E43AAA3F004518EB0D564140238080E8A251AA3F38D2E74A14564140E9DF22856662AA3F58BAB3CA1A56414016E09FA4FD65AA3FA878868A2056414012C05668F25DAA3F10DC5C2A26564140E8DFA59DE659AA3FF0F93B2A2A5641402140A55CBE4EAA3FE0BC1E0A2E564140D01FD331A044AA3FC052F549335641403F2092167838AA3FA85AB6693B564140C9BF26C64128AA3FD03C7589435641401F20B0880115AA3F60CB41294A56414000007161D507AA3FA052042952564140F51F8C5CA7F9A93FD857CBC859564140DB1F40607BECA93FA0C0956860564140FC7F2B6257E1A93F487C6EA865564140F51F1F2AF0C2A93F300C38886C564140FB1F0588368BA93F1814F9A77456414036008823A55FA93F00DDE8E776564140BE9FA9D82B3BA93FC0C9C4877B56414042600B2C940DA93F18008F8782564140E41FAEA099C2A83F48CC2FC78E5641400A80491C9374A83FB829F9069656414001809CA6FF47A83F4830BDE69D564140E0BFFE039D2AA83F788A7346A75641401C209A3B320AA83FA0E429A6B05641402D206760B9E5A73F0054B825BF564140F5DF6FE2F5AAA73FE06186A5C5564140EB5F74359D90A73F48C55C45CB5641403080AE925079A73F40490C65D5564140018039310061A73F88CAC104DF56414019A0E06BDA55A73FA86956A4EC5641401E2079D1B249A73FA0ED05C4F656414048E0EC1E9941A73F00D58B830657414032C01ABD873CA73F901A214314574140CBDF60C7843AA73FB831AD222357414000E0FC2C6130A73F70A238E2315741401380FC893723A73F40FBF1013B57414041E045BA1B1BA73F581E98A146574140C2DF55E0EF0DA73F989F4D4150574140F91FCDFDC1FFA63F7874F5605B574140F99F142EA4F6A63FD0E99040685741400AC0525972E7A63F186B46E0715741401F2026A54ADBA63F1861E0DF7E574140CD3F64DC1ECEA63FC898A71F86574140DF9F8ADC06C7A63F081A5DBF8F5741401040C543EFBFA63F9075105F99574140FD3FA094D9B8A63F78F5C8BEA25741401E4019A6A7A9A63F504E82DEAB57414024E0F7EA8FA2A63F78E7091EBB574140C19FE3DE94A3A63FD09FCF7DC25741401100E6D0BFB0A63F888E5FDDD0574140F41FBE5BF3BFA63F38FFEA9CDF5741400600D1B41ACBA63F50AA99FCE957414027608BC733D2A63F6055485CF4574140C5BFD4F717CAA63FE06DD17B0358414017206D51EABBA63FA8B82DDB1858414042C0E037C5B0A63FB0B8CBFA24584140C71FB4839DA4A63F60A75B5A335841401CE06D48649EA63F407658FA33584140E31F27563EB2A63FB82050DA3458414000803D523DCCA63FA86B3B7A375841402B201A0EE6D7A63F18D9153A3C584140E21FF2636EECA63FB89EF299405841401C20E22E28F7A63F208AD1F944584140E57F8882FDFDA63F70C6A8594A584140F3BF1D53E401A73F605065D952584140B81F142BE2F5A63F28AF2B595A584140FA3F420716EDA63F385ADAB864584140F8FFE3F839EFA63F3017B0386A58414022E0365244F3A63F30DE89D86E58414006608C2000FEA63F80246558735841403E606A28E808A73FA8BD4E78765841403360ACCF8610A73FB0F612F87D58414000002CCAD72BA73FD899003880584140076058C6AC35A73F80D7D4D785584140E19F3CF2024AA73F5079C5D7875841402AA04D2ED032A73FE04ABCF78858414005C0EBD33B26A73F8016A6B78B584140D8FFF44F5915A73F085C9D578D584140002079FCC509A73F68578D378F5841400E80D3D0C7FBA63F38F97D3791584140EFBFFF93C9EDA63F48756C3793584140FA9FB5E7C2E0A63F303E5C7795584140C47F4C2D6DCEA63F38B653B79658414004A0A26A68C1A63FA85647779858414023408EFCF4B1A63FE8A83CB7995841403F007F36EEA4A63F80F22A179C5841400AC03BBDFC95A63FA89518579E584140C89F027DFC87A63FF0E10037A15841402A8064633A81A63FA8D4E936A45841401B60A3A42276A63F60C7D236A758414022004702E76EA63F1832B376AB5841400840BCC6F95EA63F68F69296AF5841400260E15DE253A63F083A7496B35841402F203BED4C48A63F702F5716B7584140E3FF1037353DA63F28224016BA584140C4FF73051333A63FC0ED29D6BC58414037200836E629A63FB8AAFF55C2584140BA5F3C720E18A63F701BEDF5C45841403420168FA407A63FD016DDD5C658414016A0D9C08DFCA53FE8B5D355C8584140DB1F55731EEDA53F3008C995C95841402C40A7F04CDAA53F1059C195CA584140156093C770C8A53FA82AB8B5CB584140F1BFF5B627B5A53F60A5A975CD58414004C0009C9AA8A53FD0C3A1D5CE584140D37F36B96692A53F68179455D0584140CD5F8F69AA7DA53F485E8835D25841401360D63E1065A53FE8B17AB5D3584140DB9F1EDAC251A53FD07A6AF5D55841401A0061EEE132A53FC0C55595D85841401840C68CFF21A53F20B74155DB584140268015D48F04A53F408FFC54E4584140216077B7EFA7A43F6038F7F4E458414035A04B918697A43F1031ED54E6584140F05F827B9B87A43FE0D2DD54E858414043007979D273A43F18A3D734E958414046C0589FC64BA43FC89BCD94EA58414014C06F152E25A43F8016BF54EC584140E25F47E44EF8A33F808EB694ED5841401DC040F75CDBA33FA8AFA874EF58414003401E4D11BAA33FD05296B4F1584140D4FF555C7094A33F804B8C14F3584140F31FE0890077A33F089B87D4F358414023A0F65C5F51A33FB8937D34F5584140C95F9ED2F133A33FD83C78D4F558414003A05AD14E1CA33FF8DB6E54F7584140B81FE3D1A704A33F00D661F4F8584140FE5FBF2465F0A23F207F5C94F95841403980E39093DDA23F90255DB4F958414046A0543768C6A23F981F5054FB584140BE3FDC3D43AFA23F28F14674FC5841400320D85CAF95A23F80E83F94FD58414005C0B30C6482A23FC03A35D4FE584140F47FD81B9B6EA23FE0E32F74FF584140E43F79E54F5BA23F58842334015941401980CF9B1346A23F2826143403594140ECDF03952129A23FC0F1FDF305594140E7BFD2E89E0DA23FC86D4ED4FB584140C57F6FD4C3FDA13F28F1A854F05841400C0017E123EBA13FC838E3F4E8584140FBDFC6E131DBA13FB0D212D5E2584140D37FE3520CC5A13F60963B75DD5841402540A8F3ABB0A13F382C7495D6584140C77F8A17B089A13F48E188F5D3584140BADF5813FC50A13FD86F5595DA5841403FE077E73230A13F7831D954EA584140EC5F452A8C2DA13F20AE7ED4F558414027C03EF09B3CA13F10282AD400594140C09F19E1ED41A13FF8ECC0730E59414031A0C8692248A13F88FD887315594140E53F7779F639A13FD83960D31A5941401C00CF8A4A18A13FD03F6D3319594140FEFF3EFB82F7A03F9036AFD310594140F8DF835BAEE6A03FA8E90F7404594140EAFFF36597DFA03F08EF6554F95841401CA0453B2ADBA03FA83CAD54F0584140DBDFE783A2CFA03F904ED474EB584140F09F432D42BBA03FF00AF374E758414004C0AF9FDFA6A03FB8EB1635E35841402F0083E5688BA03F60F41D15E2584140E6BF8C401567A03FF082EAB4E8584140D87F37D71C5FA03F10288CB4F4584140E5FF8B0D3B5EA03F78D43754FF584140EEFF757C6F64A03FB018D0D30C594140E0FF352C696CA03FF8D856531C5941402900AACE9D72A03F3060195324594140D93F81A6BB71A03F107EF85228594140E7DFD59C0A58A03FD825F6B228594140F39FF7713447A03FF80717B324594140C17F27B3B633A03F4897291322594140E27F818C6C26A03F50137AF317594140FABFA732731EA03F98E1BF130F5941400300771AC91BA03FB8D3F19308594140CABF7E8B7916A03F18513FB4FE58414028E069C6B114A03F38396D14F9584140276058C6F30AA03F784C9174F45841403F800761C4F79F3F50B3A754F15841403080F47583E29F3FD096C594ED58414011806A43CDA99F3F0867BF74EE5841402F40DE2CD2829F3FF829A254F258414084FF6EA079669F3F30F64294FE584140727FD724AF369F3F38B16454FA5841400B008413DB219F3FF0E677D4F7584140D4FF6C41700E9F3F40F48ED4F4584140C93FADB443FE9E3F287EAD34F158414081804410B2EF9E3F200CC354EE584140D6BF5D5A81DF9E3F80C8E154EA584140B5BFBFBCF3D09E3FE0840055E65841408CC016A201C49E3F506E2BF5E0584140947F59200FB79E3F00B05835DB58414005402198B7AB9E3FE8498815D5584140807F2EF03DA59E3F8809BAF5CE58414068800D37C49E9E3FD09ED9B5CA5841402C4001E2BD899E3F70B3FA55C658414016C05AD205809E3FF8C32436C15841408D80131D13739E3F481466B6B8584140500002BEBF679E3F989DCD96AB58414017C0DECF00499E3F28C2619798584140D67F9253E0099E3F5863FDF7845841403A4077BDC7A89D3F280F54F879584140F17F29FAD94E9D3F786350F959584140AD3FA907A47B9C3F406244DA3A5841406F40469B39DD9B3FC049BBBA2B584140ACBFE803A1739B3F98BA997B0F5841407500BAD9F4A79A3F480A865CF157414044400693BFD4993F782319FDDE57414033000EB80751993F28F1A79DCC5741408BC05B93DBE7983F28BC3CBEB95741408E3FA12C9D8B983F60D56D7EB35741407E7FCCABB471983F60969C9EAD5741406080E1153556983F788EDB7EA557414078C01712B13A983FE07D137F9E574140D63F6653342A983F98E8F3BEA25741404380A8385F03983F30BAEADEA357414039C01DBB7BE8973F180BE3DEA457414046C0FB3B94CE973F700CE01EA5574140BF7FF84BC3A4973FC08BE1FEA457414024C0E316F373973F1011F03EA357414009C05E441D4E973F783FF91EA257414056C081DA4725973F1844093FA057414066C01EC872F9963F684B13DF9E5741407C00A0AF93D9963F98A922DF9C5741409E3F7DB9B4B9963FF85B3DBF99574140E07F5AC3D599963FD83A4BDF97574140B27FAA3CFB76963F20CA5D3F95574140BB7F40422A4B963F009F673F945741408A8049C6462D963FE07768FF93574140EE3F0E0B7BFB953FE07768FF935741408E001F1A9CDC953FE07768FF935741400EC02F29BDBD953FE07768FF93574140D8FF4889D9A2953F18C6667F9457414020009F6DF686953F30ED65BF9457414057C0CDB11765953F589053FF96574140ED3F740A3E42953F1001419F99574140A3FFBD8E720F953F302C379F9A5741402480B935A2E1943F70FC307F9B574140F1BF8ED2E99C943FD8A2319F9B574140D23F9C840F7B943FD8A2319F9B574140727F5AF0305A943F087F453F99574140EB3FCF776923943FC8AE4B5F9857414061C0EDCB8509943FD8EB687F94574140747F0D9DA6E8933F40207FBF9157414079C016D8D0BE933FA844847F915741408D0093330093933F909F809F9157414003005FE41C77933F0840745F935741405A4068D0474E933F40106E3F945741407F00A7F0682F933FE0DB57FF965741405800083999FF923F5004547F975741402980F9A9BADF923FE8D54A9F985741409DBF883EE5B9923F7825465F99574140040081200B94923F00F345BF995741409EFF94F4356D923F58F442FF9957414071FFE59B6044923F58F442FF995741400E00802C9015923FB0F53F3F9A57414004804656D7D1913F006B3DFF9A574140957F0B9B0BA0913F90C43CDF9A574140088077824966913F88C0451F9A5741400F803AD0C4ED903F181A45FF99574140708043291A9E903FA86940BF9A574140E13F38F73681903FA86940BF9A5741404400C35D585F903F58A5609F965741403DFF21D045B58F3F38F261DF965741403AFF08F9B24A8F3FD800761F945741406C7F0E7E15F28E3F506C9C1F8F574140CF7FB12032848E3F3084D09F88574140A1FFBBFF252F8E3F380021807E5741404700F2372DBA8D3F281C4CC078574140CB80019AEF7D8D3F301094E06F574140ACFFFC94B1418D3F10B0D02068574140CD7F4C3726178D3FD89AF80063574140E2FEB8E425F08C3FD8E32FE15B57414055FFD2CEB7A58C3F38617D0152574140CB7F9116AB298C3FE8A2AA414C5741406200152159E68B3FB0CC05E24057414078FF846DA5868B3F203E39423A574140F1FF0A85D5468B3FA0EC89C22F574140077FF2521CCD8A3F8841DB62255741400AFF6CC1ED318A3F58E32D431B574140EE80731A798B893FF82A68E31357414005819613F4E4883F30016F2313574140087F4A1A0E11883F982512031F57414061FF5E61BC44873F60807FE2315741400100A0DD0DE1853F68313BA23A574140ABFFADF040FA843F301CC5622957414002800B1EF5C3833FC8B8EEC2235741400980E046C55D833FF094026321574140418085D98F0A833F58B90723215741407D00A5D2C445823FC86F19C31E57414008FFB1A07244813F309E22A31D5741402B00CAAB10E2803F203245231957414046FF794B88A5803FD8E9B5E30A57414047801CF575B8803FE89ECA430857414014017E253C13813FA062F3E302574140747F299382BD813FA89F1004FF564140FB7E1DF8412B823F08623C64F9564140727FB7D796C2823F28CC6524F4564140CF004B6DAC3B833FE04AB084EA564140F60000F9EF1A843F981232C5D956414014FFA89A0294843F30F2E785C25641406500083C6DE3843F58E26546B2564140E700BDF111D8843F002AA0E6AA564140CE00C05936B2843F60A7ED06A156414034FF38D95735843FD00E1D479B564140F7FE3DCF329A833FA07B4087965641401C00DE1C320E833F78CE4E27955641407C80B4E95927823FE8F64AA7955641403500555D0E5B813FE8F64AA7955641404380DC074EED803F20D7550794564140F9FF29D8F8AC803FA86584878E5641403900671AB259803FF0FAA3478A5641400EFFBE44D311803FF83DCEC7845641400C016B975F9B7F3F7021EC078156414067FED0886CFC7E3FB824FFE77E5641400C00560F684E7E3F28D503287E564140F30019C7CC2E7D3FA075F7E77F564140D1FDDF34C44B7C3FC0D5BAA787564140AA016FAA1ECB7B3FC88C83C78E564140D0FEABDE9D597B3F188023479B564140C3FDB254D21B7A3F68872DE799564140C6FF887314ED783F008C3D079856414086018EBB090A783FB83F5527955641404300B9D25E89773FA8D377A7905641402E01D209852E773F203F9EA78B56414003FE787DC59E763F104BB867885641408F00FB5B8BE1753FB849BB27885641406600644C39E0743FB08E99678C564140A0FE0ACD31FD733F180281878F56414037019AE7656D733F8065572795564140A7FE985F12D6723F90593D6798564140E90117120AF3713FE85A3AA798564140D9FFB838F544713FA0904D279656414060007FF45AC4703FD06C61C7935641409A018298D552703F202589078F564140BD0108C353A46F3FE0E2A4478B56414006FD7919FB1B6F3FF0DAE32783564140F2FCCF1CC2936E3F807316C87C5641403DFE75AE2DDE6D3F28BB50687556414079FF43BE74286D3F788389286E564140AE02C6BA65456C3FF86A00095F564140E2004A2E37CC6B3F20D982694E564140D0FB112482806B3FA8BAECE94056414033FC439418CC6B3FD0E93B8A365641405AFF5717B0176C3FE85972AA2F5641408701989BE7096D3FE05F7F0A2E564140730318AF9D1B6F3FB08978CA2E5641409AFF7D394108713F386789AA2C564140AE01CD7F36DC713F9823A8AA28564140040014767A73723FC842E6CA205641409BFECE5F9A82723F40AE0CCB1B564140DA01CF047473723FE87742CB14564140DC00ACDA3320723F30035E6B11564140E000D41329DC713F284C954B0A56414032FEE9A21972713F08ECD18B025641400901D8E01572713FD858F5CBFD55414023FF34251FDC713F60F734CCF55541400FFFAC141955723FC03B5C8CF05541409DFF3DE7E3E4723F282B948CE955414053FFB553EAC7733F1847BFCCE35541400C0208F19048743FD0BB050DDB554140F3FFA6EDF775743FE82F95CDC8554140CCFE18C250D8743F28CBC1EDC2554140EAFD9E83D6DF743F2814F9CDBB554140CD0168DFFB6C733F30CF1A8EB75541401AFE0EF7704D723FD84F7B8EAB554140330230343A946F3FE8C5BE0EA35541405DFDA1731C176C3FD059E18E9E5541405EFD9DAEF4C8693F58F8208F965541400301A8E0A2F3673F18675A6F8F5541401F046649AED2653F70B18E8F8855414069FC290225D0633F2865A6AF85554140E60286A3A772613F781DCEEF80554140E40334F7260C5E3F18B4EAEF7C5541402EFD6389ACDA5A3F1071225076554140C3FFAFAC836F593F10BA59306F55414061FD4FE8CB5E583FB05076306B5541402A07503C3F435A3FB8838F306855414055F7D398DC375D3FD03C9B5066554140D4FF07D9D843603F0019AFF063554140A8032444D673623F009BAA5064554140B0000EB61DC2643FF0E595F06655414008FE819ED8D3663F208376D06A55414049025C8FD2D7693FB0D81C1076554140F7FB4F5763486F3F60490AB0785541407B0072960EAD703F906EF34F7B55414026FF28D1FF63723F78BFEB4F7C55414086FE98C94204743FC84EFEAF795541407200D3E2F9FD743FB0E220307555414020FEF58630BB753F987C50106F55414064014CABCB70763F10E876106A5541407FFE7E87FBF8763FB82FB1B06255414037003225254C773FF0D0EA305B554140E7FDD09E98E3773F103B14F155554140530195A8B90A793F38172891535541400AFE792529E6793F00C92911535541402D02465D15EF7A3F8063107156554140F4FF5C1022FD7C3F88B03E115055414067FE6ECBD3FB7E3FE8A12AD15255414085FF7DF7B799803F00180C7156554140F900A21CC0B3813F704008F15655414026801BB8911F823F98B435D1505541402B7FA019576B833FF8271DF1535541403980A6AFF495843F30FEC1505F554140EEFE5CBAB4A7853FE0FC62306B5541402C80F25422B1863F601945F06E554140A57F3F9F59F6863F7042F8EF78554140B7001C04509E873F8830D1CF7D55414054808820A6FB873F509FA8CF82554140488030AD4B62883F204199CF845541400E01C46045E0883FC0C7A44F835541404380A32FEA7E893F287EB6EF80554140C90032D5363F8A3F502B0A3076554140B4FFEA6289BD8A3FB0A857506C554140477FAE647BB88A3FC0A6A390625541405A7FA2DB43A98A3FE098D5105C5541408B801ED8FE898A3F90952411525541408F80141F07748A3F50045EF14A5541407A80BEF20C598A3F909F8A1145554140198018E81C348A3F5890BF513E5541403F7FB13441EB893FE028F2F1375541405D8070EC4BC9893F001B24723155414037FF84F14AC7893F88315BB22A554140A100623D3CEB893FF8A28E12245541409BFF69EA2BFE893FA8E4BB521E554140C400483D2D078A3FA02DF33217554140A200FB8F33EA893FE040179312554140C1FF88C53DD0893FF0B65A130A55414006FFC156F279893FD811B913FE544140E97EEAC7D0F8883F6032F473F65441407000A289408D883F809C1D34F1544140E1FF9B568648883FB07831D4EE54414003FF6E2FB51A883F68AE4454EC54414065FF6BE172EF873F48155B34E95441409FFF6C195CB2873FC8F26B14E7544140237F3392A26D873F484E8194E45441400B818D9E4905873F60FD8894E354414028FF535F3DBE863FC8A99614E2544140997FC5F2CD87863F50819A94E154414028FF4291814B863FA088A434E0544140FFFE593BF910863F78E5B6F4DD544140CE005B5D1ED0853F889ACB54DB5441404F806E680C6B853F8028E174D85441406280A675E128853F885BFA74D5544140F87EFAAE3BEF843F40971A55D1544140EB7E230638BF843F60014415CC544140A17F6889B997843FD86C6A15C75441401880F2998975843FE8A98735C3544140BC00D4358645843F80B4A4B5BF5441401381F7DB5A03843FA818C115BC54414042FF3C45BDC9833F20FCDE55B8544140F77E3BCCD67B833FC088F735B55441407E7F1965423B833FE8640BD6B2544140FA809B838B08833FA8222716AF5441401780038932C3823FE0B34F16AA5441407A0091173254823F40E86556A75441404100F385D00E823F001E79D6A454414023FF1C5E61D8813F105B96F6A05441407D805BCECB7F813F1806A7369F54414017015BC4FE52813FF86CBD169C54414020817C494C18813FE878D7D698544140227FC68F70DB803F98B4F7B694544140FD7EB57AD0B1803F60A52CF78D544140F3FF50F862AB803FE8BB6337875441404CFFAEEB2E88803FD04F86B7825441407000059E3239803F4006985780544140B800BAB7DE13803F686AB4B77C54414043FE4FC42FB07F3F781FC9177A5441405A00E18FB7697F3F08B2EE57755441407600CF1828217F3F801D15587054414061FF7EDED8DC7E3F508034786C54414010FF457234727E3FE88A51F8685441407D01B9F500017E3F00C261B86654414075FF3FBC1EB47D3F78A57FF86254414023008708C82F7D3F508A9A785F544140290226C1F8C27C3F20EDB9985B544140A90084B915767C3F187BCFB8585441403401F13B3C3A7C3FB085EC3855544140C9FEBDEFD8027C3FC03A01995254414091FFB23DCEC27B3FE82019594F544140FDFF2A2A27497B3F882529794D544140D401C4F87DC07A3F687C2ED94C544140ACFFC3C771F1793F687C2ED94C5441402D02A0436280793F48D333394C54414051FE425477EB783F905842794A544140D6FEA665CF5E783FF09C693945544140DF0003BCF32E783FD8AE9059405441404B00F227DE8C783F38E9B3F93B5441404FFFF24D4205793FC0D0C8F938544140C500D7624832793F58DBE57935544140F4FED5488A49793F78C70A9A30544140E001DEBC8AEF783FA8251A9A2E5441401400AA5F7F98783F88FA239A2D54414042FEF25C0A08783FA0A92B9A2C544140B601C8A6DE18773F188D49DA2854414046019F5D26D9763F784968DA24544140AA002F8F3F95763F502E835A2154414040FE323E3EB4763F403A9D1A1E544140CB01A6BA5AD0763F9874C0BA19544140B1FE37B39DBC763F00A9D6FA165441407D00C961867F763F788CF43A135441401D018E6637C3753F08EC007B11544140E300EB7E6225753FE0CA0E9B0F54414073FEF19D9DAE743F205C379B0A5441403A019F6C2686743F8018569B0654414051002DCD7365743FD852793B025441400CFFFF95E66D743F5836977BFE53414030FF7E224268743F10F4B2BBFA534140E8FFC4B2DB5F743FE056D2DBF6534140CFFEDE276557743F0049045CF05341406EFF463BC2F7733FE0D82F1CEB53414084000EDF9281733F78ED50BCE65341403E005CA79907733F707B66DCE3534140E1FF5D6A08B7723FF05877BCE15341409800063FAC62723FE8E68CDCDE53414059008F6A6E0B723F10C3A07CDC534140B1FE6BD247C2713F7075BB5CD953414082FE6C9F9581713FB882D25CD6534140CC00ABB5B443713FA88EEC1CD3534140F101C475480E713FB8CB093DCF534140AAFFD169BAF7703F283D3D9DC8534140BAFFE2AA3BE1703FA8A2563DC5534140C500093FEDC7703F7805765DC153414016FFAA6CDE8C703FB8189ABDBC534140B10096D7123E703FA02AC1DDB7534140380346693FB76F3FB067DEFDB353414095FF67B4B8736F3FF0F806FEAE53414026FCC58D93766E3F50B525FEAA534140D9009478A9736D3FF0B9351EA9534140FCFDD50FADBF6C3FA06D4D3EA653414057FCEDABF4D86B3FF0FC5F9EA3534140D600384C9A2A6B3F38887B3EA053414057FFA50030226A3FD014941E9D5341409D03B406800E693F209AA25E9B5341400E04E68B3F4F683FD8CFB5DE9853414007FFDBAD3241673F082EC5DE965341400BFD65F14C7C663FC8DBCF9E95534140FFFFBD4EDBA0653F50B9E07E935341404EFE5F7652D6643FD818EDBE9153414043FEF9942706643F885A1AFF8B5341402500C8CDBF49623FD812423F8753414035FC276B798A613F80E2849F7E53414057FDFD2210CB603F78A9C01F775341404AFFD389F527603F28E5E0FF725341401406FCFCDA415F3FA05007006E534140D6FA531A02315D3F58041F206B534140EA0068ED4FDF5B3FA0113620685341402900A09FEAA9583FD86938C067534140E3F947C2CE7F553F38E32C406953414052FA139B283F523FE8531AE06B534140CDFFB74FD28C4D3F80A70C606D534140ACFF87F6BD624A3FD89E05806E534140B40CB02802F5463FA0BEFA1F70534140A1F5FF0A77D3423FE010F05F71534140D520305FB058393F9091EE7F71534140A706D0395AAA323FD0E3E3BF725341400B4C00C094C31F3F0832E23F7353414089D201142E3CF3BE0038EF9F7153414037BC3FC6A63228BFC067F5BF7053414099ECBFE425A933BFF83DFCFF6F5341407FE47FD2892A3ABFB0730F806D534140EDF42F15836943BF18201D006C534140FF0AE850A49346BF98FD2DE069534140260E8026FE324CBF78DC3B00685341401A0560D1674C50BF786444C0665341402BFF7B80FFF751BF10E758806453414037F9FF1A754C54BF789D6A2062534140C2FAAF055C0E56BF70A3778060534140CB058CA36CA357BFF0FE8C005E534140A1044083F99D59BFA03AADE0595341404704A881A4575CBF0879C7405653414023FFDF3A386B5FBF102AE5E052534140F20326A7392361BF58BF04A14E5341400F0346B2078D62BF809B18414C5341409B02AEF787D263BF10731CC14B5341408703BC6DC75065BF282224C14A534140E2FC192DC55D66BF588033C148534140B50008B53C9567BF10344BE14553414052FD4F69C98568BF68F6764140534140C0014042F2A069BF801D768140534140E100AECE4D756ABF68E665C14253414014FC917586496BBF980B4F6145534140FEFC3DDE71AB6CBF50BF668142534140A0FFD38A850D6EBFA0C67021415341409D0162FB9DE16EBFA0C6702141534140EBFC3F11FAB56FBFF8BD694142534140E8FE06043F4C70BF705E5D01445341402602E6EF94C470BF9089530145534140FB003075B02E71BF58315161455341407B016FCB2EB571BFC85F5A4144534140AFFE9939822672BFF03B6EE141534140CEFF3E8FA79E72BFD0A284C13E53414055006A26382573BF682599813C5341403701496408C873BF5831B341395341409AFE04EEDB7174BF8811BEA137534140E0FFC3C3F5D474BF003ABA213853414077FEBA5E745B75BF78DAADE1395341408FFEC856A1C575BF304F92413D534140B2FFEB3530FE75BF606A77C1405341401600CACF0B4C76BF30845F01445341409200B85F827676BFD0C7400148534140DA00E445772777BF387E52A145534140C7FE18BF959177BFD00A6B814253414055014A6F61D877BF7891760141534140EA01A804598978BFD00A6B8142534140CD006F4186F378BF887B582145534140680039463D3A79BF90F7462147534140F8FFBE05419679BFD03F3841495341403600281C741B7ABF30458E213E53414052FFD81502D279BFD08CC8C1365341403A20B12338A279BFB0F3DEA1335341403E02DCE6904B79BFE0121DC22B53414089003E95C67478BF30534DC225534140D4FEA425893778BFA8C480221F534140BC007FB30EF377BF18B8AFE21853414091FF7B8AC0B177BF28C21308685241403FFF70612B0870BF48AE9A08575241406002F80659286FBF40C81189475241403103B2F8D8536EBF107468893C5241401A04D00927BD6DBF5842AEA93352414032FDA5B246426DBFC041F7292A524140100284F072556CBFB05777EA19524140C001246CCDC36ABFF82FC12A10524140E5FDC311525469BF081EFCEA085241406D01644B564568BF1032660BFB514140E1FDB35D40E665BFA87FAD0BF25141407C00B075FC5964BFA815756CD8514140FBFCE50BDDC960BFA0ECC16CCE51414058FF0B0949E05BBFA8A7E32CCA5141401300D8F6DABF54BF90C30E6DC451414088F3CFABE63E4BBFD8A1650DB9514140F9F84FF240B03FBF68AC828DB5514140ABEEFF858DF43ABFF0D2CA4DAC51414091BBFFF47D292DBF90EB448E9C5141408944C062437927BF90EF9D2E915141403725A007402D2DBF1816E6EE87514140841350B11AA631BF4835240F80514140F200400A024A34BF380C710F76514140F404C01F262818BFF87AAAEF6E51414090DFCFCC64C3303F2028FE2F6451414043E47FAB1A963C3F481423505F51414043EE8F3019EF403F40A6911051514140CA0EB01FEA2A3C3F08D0ECB045514140E5DFFF41DC6A203F00625B7137514140210FD073E67231BFC019CC31295141403EEAEF7EB0DA3CBFB8AB3AF21A514140F0036068C84D34BF68369F120E5141408EC2BF992B67153F70F1C0D209514140F603607D7FC7433F60C80DD3FF504140EC0AB0EE742E4F3F68159E53ED5041403906607B1301563F60A70C14DF504140ADFBD77E106E573F00C08654CF5041408A05B87E6A24583F107F01B5BF50414095FC4348A4DA583FC87FA955AA504140290618139E475A3FB89F2D36995041405B02C870BF8D5E3FC0ECBDB686504140BCFDD7C3CC7B623FE89304977D5041402C046ABA3C75633F28E65BB77250414082FE51B10C9F643F783AF6D75E5041404400CAA3D743643F28C55AF851504140B1FEF99A0E32633FD098F6F83D5041404C04005C9E0E613F381037B9355041401CFCA173D541603FC0266EF92E5041401EFFD3A1CA385F3FE8082D193750414072FCE989AFC2623FE0C7F2975E504140AE01233034A9713FE03B2F5777504140E0002FC2770F763F68FB0D369C504140E5FD5AB881427A3F70261315BC504140F2FDAA783A8F7E3F88D15F94D250414067FFC6F5C47A803FE8AE7F53EF504140FCFE39C38607823F102C89512F514140E0006E73B97A833FC08E557056514140117FF9448587843FC8AFF44E835141408C00050D1C21863F68D14AADB95141404680B2B8B33A873F785A6E6BF6514140688012F07D07893F28C3E50928524140B0009A0AA5BA8A3F687154485B5241407A7F8C42C0918C3F30F30B86A55241407580F5D9943A8F3F30F30B86A552414069004464EEE08F3F70CD0986A552414030C0D9910B4A903F48E1E465AA5241408B7FCA8409EA903F60868665B6524140DD3F0CA56B30913FE8980225C7524140DCFF2AC79963913FB0699CC214534140F8FFB4647E03953F382B6BA05B53414019C079ECEDEA973F98128F7F77534140DE3FD4FA0CBC993FF80D7F5F79534140FB7FD2C73FDD993FE8992BDEA353414078006D683AA39C3F5003ADFDB353414003C066E6A16D9D3F98BF78FCDA5341402480F72256569F3F685D4C9B00544140158050F285F1A03FC86D0CB869544140C11F37727A6AA33F588026978654414019606B65F268A43FD81AAB1696544140C9BFE5AA60F1A43FF0B9C613F3544140DB3F3C1D9FFBA73F3845E2B3EF544140FC9FBCDF0D0EA83FD0D1FA93EC544140F25F3F21751AA83F18671A54E8544140F85F5EA41D25A83FB07137D4E454414001E098B6703AA83FE8514234E3544140C5BFCC78EE4CA83FE8514234E35441401F801431A35AA83F50804B14E254414000A08BC1C86DA83FD8DF5754E0544140BE7F47A4EC7BA83F60BD6834DE5441402DC03980B88AA83FE02282D4DA544140EFBF97FB989AA83F0805A3D4D654414035603657A7ACA83F183CB394D4544140BDDF7FF751B7A83FD871C614D254414034C0CE2D8BC1A83F98A7D994CF54414020C0108FC4CBA83F3034F274CC544140EE3F62B02CE2A83F40E906D5C9544140F49F7A30D8F6A83F906E1515C8544140D27F8B14C509A93FA0A525D5C554414005805593591DA93F40AA35F5C3544140C93F96CD892EA93F200B3F75C25441403BC09DC34A3FA93F58694E75C0544140CA3F0EB10B50A93F506F5BD5BE5441403F603C1C0E5FA93FA0766575BD544140C77FA4C4D96DA93F987C72D5BB54414028401B94127DA93F20DC7E15BA544140C2FFA0E12D8DA93FF83891D5B7544140F45FCCBB039FA93F60EFA275B5544140DD3FB3FD75B8A93F58F5AFD5B3544140F25FEC3170C4A93F182BC355B1544140CC3FFD72AAD8A93F30DACA55B05441404740889CB9E5A93F28E0D7B5AE5441403F00831AC8F7A93FB03FE4F5AC544140F6DF0786710CAA3FA845F155AB5441401FE0FBA68019AA3FD82B0916A854414035C0BEA79030AA3F20B11756A654414046801E0B673DAA3F00902576A4544140D2DF239EAA4AAA3F80F53E16A15441403C001B85085EAA3F707950169F54414019404492E968AA3F50E066F69B544140F21F9E9BF97FAA3F08167A7699544140F03FE059808BAA3F00A48F9696544140E3FFDA34DC9EAA3F98AEAC1693544140FDDFD409B4B0AA3F0065BEB6905441403BE064158FBBAA3F48299ED694544140FD7FACB65BC5AA3F60957B5699544140BDDFD73753C8AA3F58192B76A3544140E31F2A8625CAAA3F58C68D95B7544140C5DF85BD6FCDAA3F08B51DF5C5544140F37F73A570CDAA3F0039CD14D05441403C40CD56C6D5AA3FE8FD63B4DD5441400C4053B311CCAA3F68D71BF4E6544140BD3F696079CAAA3F", + "created_at": "2021-02-15T01:23:31.727587", + "total_males": 50, + "total_females": 100, + "server_version": 1599045641945, + "geographic_level": 3, + "effective_end_date": null, + "effective_start_date": null + } + }, + "jurisdiction_id": "3c63f48e-bb86-42e5-b3ff-bc539fbf5295", + "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada" + }, + { + "id": "6cb96ec5-a89f-4eb6-bb5e-83692687095e", + "geojson": { + "id": "9ec52632-7bfb-40f5-9ef7-8804627a65cb", + "type": "Feature", + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [34.6632981430001, 0.052326005000054], + [34.6635536970001, 0.052321393000057], + [34.663748223, 0.052328287000023], + [34.663919864, 0.052322228000037], + [34.664148719, 0.052310744000067], + [34.664327988, 0.052264878000074], + [34.6645187, 0.05219457000004], + [34.664682713, 0.052098942000043], + [34.6647780690001, 0.05202100300005], + [34.6649230100001, 0.051878748000036], + [34.6650069240001, 0.051728113000024], + [34.665121351, 0.051600419000067], + [34.665243407, 0.051527794000037], + [34.6653959760001, 0.051428417000068], + [34.6656057610001, 0.051263223000035], + [34.665804101, 0.051105721000056], + [34.6660634690001, 0.050901592000059], + [34.666200782, 0.050841219000063], + [34.666303767, 0.050817471000073], + [34.666490664, 0.050806048000027], + [34.666650863, 0.050815998000076], + [34.6668377610001, 0.050849637000056], + [34.6670399160001, 0.050898586000073], + [34.6672191850001, 0.050920038000072], + [34.667352683, 0.050906299000076], + [34.6674747390001, 0.050863800000059], + [34.667650194, 0.050778802000025], + [34.6677989500001, 0.050637105000021], + [34.667932448, 0.050527794000061], + [34.6681002760001, 0.050454420000051], + [34.6682490310001, 0.050414613000044], + [34.668401601, 0.050387057000023], + [34.6685846840001, 0.05036369000004], + [34.668783024, 0.050340326000025], + [34.6689584800001, 0.050328646000025], + [34.669141563, 0.050313095000035], + [34.669362789, 0.050309231000028], + [34.6696488580001, 0.050254748000043], + [34.6698052410001, 0.050223567000046], + [34.6699654400001, 0.050169070000038], + [34.6701942940001, 0.050137952000057], + [34.670331607, 0.050137960000029], + [34.6705146900001, 0.050184665000074], + [34.6706176750001, 0.050200238000059], + [34.6707778730001, 0.050243126000055], + [34.6709075580001, 0.050262571000076], + [34.6710257980001, 0.050297648000026], + [34.6711669250001, 0.050363847000028], + [34.6712889820001, 0.050433927000029], + [34.6713919650001, 0.050515693000023], + [34.671479693, 0.05060958100006], + [34.6716246340001, 0.050710038000034], + [34.6718725600001, 0.050910945000055], + [34.6720251290001, 0.05107534900003], + [34.672147185, 0.051230558000043], + [34.6722997540001, 0.051404086000048], + [34.6724942810001, 0.051531986000043], + [34.6726926210001, 0.051559378000036], + [34.672868076, 0.051498008000067], + [34.673039718, 0.051467139000067], + [34.6731617730001, 0.051382016000048], + [34.673280015, 0.051304823000066], + [34.673440213, 0.051212075000024], + [34.673688139, 0.05108838600006], + [34.673936064, 0.050941513000055], + [34.674138219, 0.05084101500006], + [34.6743823310001, 0.050732832000051], + [34.6746150010001, 0.05063233900006], + [34.674817155, 0.050547343000062], + [34.6749773540001, 0.050315385000033], + [34.6751871370001, 0.049890236000067], + [34.6754350630001, 0.049557839000045], + [34.6755037200001, 0.049279566000052], + [34.6756448470001, 0.048931723000067], + [34.6758584450001, 0.048359681000022], + [34.676232241, 0.047764394000069], + [34.676453468, 0.047424306000039], + [34.676693766, 0.04720011400002], + [34.6769798340001, 0.046952791000024], + [34.677265902, 0.046674531000065], + [34.6777083540001, 0.046226200000035], + [34.677906695, 0.046025193000048], + [34.678078337, 0.045847433000063], + [34.67838729, 0.04566193200003], + [34.6786809870001, 0.045576883000024], + [34.679096739, 0.04548415000005], + [34.679405692, 0.045422349000035], + [34.679886287, 0.045383684000058], + [34.680305854, 0.04536833700007], + [34.6807597490001, 0.04529098200004], + [34.6812098290001, 0.045190559000048], + [34.6814882690001, 0.045128695000074], + [34.6818429940001, 0.04502820600004], + [34.682136691, 0.044920027000046], + [34.682476158, 0.044850474000043], + [34.6828690250001, 0.044734548000065], + [34.6831627220001, 0.044641812000066], + [34.6835594030001, 0.044541325000068], + [34.6837806290001, 0.044487204000063], + [34.684074326, 0.044433095000045], + [34.6843680220001, 0.044379043000049], + [34.684654091, 0.044263114000046], + [34.6849325310001, 0.04420900100007], + [34.6853978680001, 0.04421677800002], + [34.685622908, 0.044317240000055], + [34.6860615460001, 0.044433217000062], + [34.686511626, 0.044518313000026], + [34.6868282080001, 0.044572466000034], + [34.68714479, 0.044510602000059], + [34.6876063130001, 0.044402430000048], + [34.6882585500001, 0.044317401000058], + [34.6886285300001, 0.044224665000058], + [34.6890671680001, 0.044177183000045], + [34.6890862400001, 0.04432864000006], + [34.689112939, 0.044526974000064], + [34.689193038, 0.044615926000063], + [34.6893379790001, 0.04477257700006], + [34.689471477, 0.044854408000049], + [34.6896049760001, 0.044906542000035], + [34.6897689890001, 0.044936309000036], + [34.6900283570001, 0.044844692000026], + [34.6902572120001, 0.044777573000033], + [34.690573794, 0.044793903000027], + [34.690741621, 0.044824729000027], + [34.690882747, 0.044906620000063], + [34.691020059, 0.044989829000031], + [34.6911154160001, 0.045047963000059], + [34.6913442700001, 0.045256370000061], + [34.6914129260001, 0.045331382000029], + [34.6915845670001, 0.045486538000034], + [34.6916455950001, 0.045309549000024], + [34.691679923, 0.045213575000048], + [34.6917638360001, 0.045084754000072], + [34.691813423, 0.044996440000034], + [34.691870636, 0.044889683000065], + [34.691931664, 0.04478292400006], + [34.6919926910001, 0.044683543000076], + [34.692061348, 0.044543659000055], + [34.6920994910001, 0.044444335000037], + [34.692152891, 0.044326454000043], + [34.692191033, 0.044227070000034], + [34.692263504, 0.044113062000065], + [34.69233216, 0.044006243000069], + [34.692419887, 0.043954682000049], + [34.692511429, 0.043870051000056], + [34.692602971, 0.043814868000027], + [34.692732656, 0.043693357000052], + [34.6928585260001, 0.043608736000067], + [34.6929805820001, 0.04352035900007], + [34.6930873800001, 0.043435729000066], + [34.6931789220001, 0.043358416000046], + [34.693262835, 0.043288416000053], + [34.693430662, 0.043152286000065], + [34.6935107620001, 0.043027060000043], + [34.6935679750001, 0.042942457000038], + [34.693613747, 0.04282469900005], + [34.6936518890001, 0.042681126000048], + [34.693682403, 0.042544865000025], + [34.6937167310001, 0.042397729000072], + [34.6937701300001, 0.042301971000029], + [34.6938120880001, 0.042132578000064], + [34.6938578580001, 0.04197437800002], + [34.693915073, 0.041786678000051], + [34.6939608430001, 0.041639413000041], + [34.6940295000001, 0.041403828000057], + [34.6941095990001, 0.041275011000039], + [34.6941935130001, 0.041050429000052], + [34.694468139, 0.040343753000059], + [34.69448721, 0.040218549000031], + [34.694529167, 0.040097102000061], + [34.694590195, 0.039946153000074], + [34.694616895, 0.039640624000072], + [34.694658852, 0.039346161000026], + [34.6947122510001, 0.039003816000047], + [34.694750394, 0.038782983000033], + [34.6948076080001, 0.038528958000029], + [34.6948762640001, 0.03824187400005], + [34.6949182210001, 0.038017289000038], + [34.694941107, 0.03773019800002], + [34.694983064, 0.037505681000027], + [34.695002135, 0.037325347000035], + [34.6950479070001, 0.03714489400005], + [34.6950974920001, 0.03699031900004], + [34.6951165630001, 0.036846744000059], + [34.6951203780001, 0.036669976000042], + [34.6951699630001, 0.036493398000061], + [34.695204291, 0.036298256000066], + [34.6952386200001, 0.036151053000026], + [34.695276762, 0.036000106000074], + [34.695295833, 0.035852906000059], + [34.6953492330001, 0.035690892000048], + [34.6954102610001, 0.035470056000065], + [34.695494174, 0.035260168000036], + [34.695185221, 0.035139198000024], + [34.6948343110001, 0.034997102000034], + [34.694609271, 0.034875449000026], + [34.6944223730001, 0.034706483000036], + [34.69425836, 0.034551023000063], + [34.694048578, 0.034253600000056], + [34.693968479, 0.033820989000048], + [34.694170634, 0.033570853000072], + [34.6946512280001, 0.033550625000032], + [34.6950021380001, 0.033665536000058], + [34.695337792, 0.033706125000037], + [34.6957535450001, 0.033753467000054], + [34.695967142, 0.033645346000071], + [34.696131155, 0.033388452000054], + [34.69608157, 0.033138364000024], + [34.6958260160001, 0.033009957000047], + [34.695448406, 0.032955867000055], + [34.695108938, 0.03292209600005], + [34.6948343130001, 0.032834128000047], + [34.6946855580001, 0.032678669000063], + [34.6945635020001, 0.032523144000038], + [34.694433819, 0.032313612000053], + [34.69439949, 0.032036461000075], + [34.694601645, 0.031975652000028], + [34.6949678120001, 0.031968923000022], + [34.695292022, 0.03201626200007], + [34.695703961, 0.032077109000056], + [34.6961769270001, 0.032124454000041], + [34.696421039, 0.032117714000037], + [34.696543094, 0.031921703000023], + [34.6965545370001, 0.031793250000021], + [34.696432482, 0.031644544000073], + [34.696352382, 0.03154315200004], + [34.696043429, 0.031482315000062], + [34.695772618, 0.031461987000057], + [34.695574277, 0.031421469000065], + [34.695272952, 0.031407886000068], + [34.6951013120001, 0.031333559000075], + [34.6949601850001, 0.031218594000052], + [34.694864828, 0.031137518000037], + [34.6947504010001, 0.030921180000064], + [34.6947771010001, 0.030772480000053], + [34.694895343, 0.030664349000062], + [34.6952691390001, 0.030482041000027], + [34.6951394550001, 0.030402587000026], + [34.69506317, 0.030328516000054], + [34.6949716280001, 0.03026681700004], + [34.6948610160001, 0.030211241000075], + [34.6947732880001, 0.030149480000034], + [34.6946512320001, 0.030093964000059], + [34.6945291760001, 0.030044580000038], + [34.694365164, 0.029995190000022], + [34.6941897090001, 0.029951924000045], + [34.6940028110001, 0.029927223000072], + [34.693815914, 0.029902521000054], + [34.693686229, 0.029822318000072], + [34.6935527300001, 0.029785243000049], + [34.693396347, 0.029735850000066], + [34.693136978, 0.029692646000058], + [34.692736483, 0.029575360000024], + [34.692156718, 0.029334550000044], + [34.691557883, 0.028964158000065], + [34.6912222300001, 0.028621107000049], + [34.6902457850001, 0.027815402000044], + [34.6892960390001, 0.027211094000052], + [34.688834516, 0.026808277000043], + [34.6879724980001, 0.026031328000045], + [34.6870532660001, 0.025225633000048], + [34.6864925740001, 0.024723168000037], + [34.6859318800001, 0.024321967000049], + [34.6853559300001, 0.02397008500003], + [34.6851652180001, 0.023871253000038], + [34.6849859490001, 0.023766355000021], + [34.6847380230001, 0.023661391000076], + [34.6845244260001, 0.023598497000023], + [34.684654111, 0.023450363000052], + [34.6846884390001, 0.023347791000049], + [34.6847189530001, 0.023248974000069], + [34.6847265810001, 0.023089458000072], + [34.684722767, 0.02290325000007], + [34.6846693680001, 0.022758920000058], + [34.68463504, 0.022603152000045], + [34.6845778270001, 0.022435945000041], + [34.68453587, 0.022314365000057], + [34.684474842, 0.022192787000051], + [34.6843794870001, 0.022071209000046], + [34.6843222730001, 0.02193825300003], + [34.684242173, 0.021771107000063], + [34.6842116600001, 0.021657091000066], + [34.684204031, 0.021467135000023], + [34.684204031, 0.021349372000032], + [34.684204031, 0.02123160900004], + [34.684204031, 0.021129035000058], + [34.6842192890001, 0.021022654000035], + [34.684226918, 0.020893450000074], + [34.684295574, 0.020760507000034], + [34.6843756740001, 0.020566740000049], + [34.684406187, 0.020391974000063], + [34.6844328870001, 0.020129827000062], + [34.684436702, 0.020000689000028], + [34.684436702, 0.019875302000059], + [34.6843642320001, 0.019666336000057], + [34.684337532, 0.019567576000043], + [34.68421929, 0.019442180000055], + [34.6841353770001, 0.019282592000025], + [34.6841277500001, 0.019115451000062], + [34.6841315630001, 0.01900906700007], + [34.6841849630001, 0.018853304000061], + [34.684211663, 0.018735542000059], + [34.6842955760001, 0.018553156000053], + [34.684310833, 0.018431584000041], + [34.6843451610001, 0.018287260000022], + [34.6843680470001, 0.018142866000062], + [34.6843794910001, 0.017994731000044], + [34.6843871190001, 0.01783896400002], + [34.6843871190001, 0.017660382000031], + [34.6843947470001, 0.017402043000061], + [34.6844176340001, 0.017212087000075], + [34.684413819, 0.016991757000028], + [34.6843909350001, 0.016532016000042], + [34.6843871200001, 0.016228112000022], + [34.6844100060001, 0.016117915000052], + [34.6844100060001, 0.01598871300007], + [34.684284136, 0.015482469000062], + [34.6842917660001, 0.015279196000051], + [34.684207852, 0.015110176000064], + [34.684055282, 0.014900581000063], + [34.683856942, 0.014738366000074], + [34.683547989, 0.014515260000053], + [34.6833725330001, 0.014400360000025], + [34.683101723, 0.014285457000028], + [34.6828652400001, 0.014204310000025], + [34.682708856, 0.014129921000062], + [34.682491444, 0.01398795700004], + [34.682190119, 0.013751351000053], + [34.6820146640001, 0.013622948000034], + [34.6816675690001, 0.013440411000033], + [34.6814654140001, 0.013318699000024], + [34.6811450170001, 0.013086530000066], + [34.680828435, 0.01279054400004], + [34.6805194830001, 0.012473055000044], + [34.680294443, 0.01215544400003], + [34.6802715580001, 0.011751280000055], + [34.680633911, 0.011361572000055], + [34.6812098620001, 0.010683163000067], + [34.681476859, 0.010242946000062], + [34.680950495, 0.009651103000067], + [34.680778853, 0.00945619700002], + [34.680706383, 0.009297489000062], + [34.680698756, 0.008922136000024], + [34.6806262850001, 0.008431335000068], + [34.680591957, 0.008243685000025], + [34.6804546440001, 0.008128228000032], + [34.680019821, 0.008164331000046], + [34.679939722, 0.008337469000026], + [34.6797757090001, 0.00866224300006], + [34.679657467, 0.008871570000053], + [34.6794858260001, 0.00916021200004], + [34.6793256280001, 0.009391162000043], + [34.6790319310001, 0.00981700400007], + [34.6785208220001, 0.01004793200002], + [34.6778113730001, 0.010199407000073], + [34.677315521, 0.010177746000068], + [34.6770904810001, 0.010105538000062], + [34.676789156, 0.009867369000062], + [34.6766137020001, 0.009571454000024], + [34.67646876, 0.009304420000035], + [34.6764268050001, 0.008864119000066], + [34.676442062, 0.008474457000034], + [34.676442062, 0.008265123000058], + [34.676392476, 0.008142418000034], + [34.676224651, 0.007983581000076], + [34.6760949660001, 0.007846499000038], + [34.6759271390001, 0.007716535000043], + [34.675812712, 0.007564949000027], + [34.6757478710001, 0.007398993000038], + [34.675724985, 0.007124710000028], + [34.6757783850001, 0.006908194000061], + [34.676014868, 0.006785507000075], + [34.6762322800001, 0.006677262000039], + [34.6766137050001, 0.006374189000041], + [34.6765717480001, 0.006085472000052], + [34.676514535, 0.005868948000057], + [34.676426808, 0.005746241000054], + [34.676289495, 0.005659599000069], + [34.676136925, 0.005522510000048], + [34.676037755, 0.005342049000035], + [34.676030127, 0.005096649000052], + [34.676159811, 0.004880137000043], + [34.6762551670001, 0.004743002000055], + [34.6764268090001, 0.004598686000065], + [34.6765259790001, 0.004382171000032], + [34.6765336070001, 0.004216154000062], + [34.676457322, 0.004093509000029], + [34.6763848520001, 0.00398524700006], + [34.676239912, 0.003862537000032], + [34.6761254840001, 0.00379752200007], + [34.675877558, 0.003732566000053], + [34.6756830320001, 0.003645982000023], + [34.6754579920001, 0.00355933000003], + [34.6752367660001, 0.003451060000032], + [34.6747752430001, 0.003393276000054], + [34.6742679490001, 0.003357176000065], + [34.6738560110001, 0.003393219000031], + [34.673539428, 0.003429264000033], + [34.673329645, 0.003544762000047], + [34.67328006, 0.003797348000035], + [34.673302945, 0.004158263000022], + [34.6732381030001, 0.004360402000032], + [34.6731160470001, 0.004504660000066], + [34.6728757500001, 0.004519084000037], + [34.67272318, 0.004504636000036], + [34.672509582, 0.004425242000025], + [34.6724065980001, 0.004360352000049], + [34.672189186, 0.004259205000039], + [34.671952703, 0.004259191000074], + [34.671807761, 0.004360315000042], + [34.6715636500001, 0.004475687000024], + [34.6714034510001, 0.004612818000055], + [34.671189854, 0.004829326000049], + [34.6710143980001, 0.004952017000051], + [34.6707474020001, 0.00499531600002], + [34.670190523, 0.00508910700006], + [34.670011253, 0.005096281000021], + [34.6697938410001, 0.004742607000026], + [34.6696641570001, 0.004468385000052], + [34.6692979910001, 0.003854860000047], + [34.6690386230001, 0.003428989000042], + [34.66890131, 0.003147581000064], + [34.6686571990001, 0.002923792000047], + [34.6684397880001, 0.002663937000023], + [34.6682300040001, 0.002418587000022], + [34.6681422770001, 0.002129867000065], + [34.667997337, 0.001833952000027], + [34.66787528, 0.001639050000051], + [34.6676731270001, 0.001552466000021], + [34.6674557150001, 0.001487445000066], + [34.6673336580001, 0.001602947000038], + [34.6672421170001, 0.001783338000052], + [34.667184902, 0.001985477000062], + [34.6671124320001, 0.002252501000044], + [34.667123874, 0.002533968000023], + [34.667203973, 0.002786563000029], + [34.667322214, 0.003154670000072], + [34.6676654950001, 0.003818697000042], + [34.667745595, 0.00407129000007], + [34.6678256930001, 0.004489898000031], + [34.6678562070001, 0.004886876000057], + [34.6677761070001, 0.005125023000062], + [34.667638794, 0.005305471000042], + [34.667451896, 0.005478664000066], + [34.667299326, 0.005608542000061], + [34.6670742860001, 0.005687852000051], + [34.6668454310001, 0.005832287000032], + [34.6666852330001, 0.006113744000061], + [34.666612763, 0.006323014000031], + [34.666597505, 0.006575664000025], + [34.66670049, 0.007077344000038], + [34.666505962, 0.007564380000019], + [34.666589876, 0.00810569500004], + [34.6667004880001, 0.008643628000073], + [34.666715745, 0.008849276000035], + [34.6665288460001, 0.009482079000065], + [34.666624202, 0.010051643000054], + [34.666971297, 0.010573780000072], + [34.6673336490001, 0.011080044000039], + [34.667448076, 0.011212063000073], + [34.6677532160001, 0.011532426000031], + [34.667901971, 0.011710451000056], + [34.6680545400001, 0.011906234000037], + [34.6681155680001, 0.012146513000062], + [34.668069797, 0.012449102000062], + [34.667997326, 0.01281588400002], + [34.667669301, 0.013056825000035], + [34.667367976, 0.013047184000072], + [34.6670704650001, 0.013018160000058], + [34.6668721240001, 0.012958518000062], + [34.666566985, 0.01291661800002], + [34.666349574, 0.012865163000072], + [34.666170304, 0.012794710000037], + [34.6659643350001, 0.012655744000028], + [34.665769809, 0.012590974000034], + [34.6655714680001, 0.012587152000037], + [34.6653655000001, 0.012655707000022], + [34.6651633450001, 0.012691825000047], + [34.6649878900001, 0.012709001000076], + [34.664770478, 0.012653735000072], + [34.664629351, 0.012604220000071], + [34.664369983, 0.012439626000059], + [34.664003816, 0.012193328000023], + [34.663771147, 0.011988167000027], + [34.663610949, 0.011857080000027], + [34.6635384790001, 0.01176969100004], + [34.663462194, 0.01168718100007], + [34.6633668370001, 0.011570663000043], + [34.663301995, 0.011439581000047], + [34.6632257110001, 0.01124055400004], + [34.6631951970001, 0.011105041000064], + [34.6631494270001, 0.011001214000032], + [34.66313417, 0.01088620400003], + [34.663092213, 0.010774562000051], + [34.663023557, 0.010650861000045], + [34.662943458, 0.010458085000039], + [34.66285573, 0.010331880000024], + [34.662764189, 0.010221926000042], + [34.6626383190001, 0.010130346000039], + [34.662478121, 0.01005501700007], + [34.662325551, 0.009989810000036], + [34.6622073090001, 0.009898232000069], + [34.6621005110001, 0.009772024000029], + [34.6619898980001, 0.009662131000027], + [34.661875471, 0.009513548000029], + [34.6617801150001, 0.009390372000041], + [34.661707645, 0.009293642000046], + [34.6615932170001, 0.009161372000051], + [34.6614406480001, 0.008949653000059], + [34.661356735, 0.008817319000059], + [34.66128045, 0.008713494000062], + [34.6611622080001, 0.00854453300002], + [34.66110881, 0.008459082000059], + [34.6610134530001, 0.008347126000047], + [34.6609142830001, 0.008231048000027], + [34.660788413, 0.008151654000073], + [34.6605824440001, 0.008139394000068], + [34.6603764760001, 0.008072249000065], + [34.660239163, 0.007921596000074], + [34.6601666920001, 0.007850399000063], + [34.6600560790001, 0.007736384000054], + [34.6599759800001, 0.007669179000061], + [34.659831039, 0.007599980000066], + [34.659678469, 0.007534835000058], + [34.659560228, 0.007433133000063], + [34.65945343, 0.007325176000052], + [34.6593847730001, 0.00725185400006], + [34.659270346, 0.00712564600002], + [34.659163547, 0.007021877000057], + [34.6590453060001, 0.00694855200004], + [34.6589575780001, 0.006891475000032], + [34.6588507800001, 0.006838653000045], + [34.6587706810001, 0.006777578000026], + [34.65867151, 0.006661561000044], + [34.658614297, 0.006531231000054], + [34.658595226, 0.00633377500003], + [34.658595226, 0.006225952000023], + [34.658576155, 0.00608393300007], + [34.658522756, 0.00594979300007], + [34.658362557, 0.005904152000028], + [34.658213802, 0.005993717000024], + [34.6580803040001, 0.006108531000052], + [34.6579887610001, 0.006151469000031], + [34.6578819630001, 0.006173649000061], + [34.657733207, 0.006087820000062], + [34.657672179, 0.006004808000057], + [34.6576416660001, 0.005867043000023], + [34.6576111520001, 0.005638952000027], + [34.657496725, 0.005578184000058], + [34.657374669, 0.005513428000029], + [34.6572678700001, 0.005542987000069], + [34.6571687000001, 0.005569796000032], + [34.657035202, 0.005550972000037], + [34.6569512890001, 0.005492711000045], + [34.656836862, 0.005313126000033], + [34.6567834620001, 0.005162606000056], + [34.656726248, 0.005049339000038], + [34.6565736790001, 0.005010748000075], + [34.6564516230001, 0.004979565000042], + [34.656318125, 0.004987622000044], + [34.6562036980001, 0.00498224100005], + [34.6560892700001, 0.004974230000073], + [34.6559710290001, 0.004966159000048], + [34.6557726880001, 0.004874953000069], + [34.6556124910001, 0.004762243000073], + [34.655478992, 0.00464592000003], + [34.6553912640001, 0.004569085000071], + [34.655326422, 0.004488633000051], + [34.655238694, 0.004405433000045], + [34.655166224, 0.004335671000035], + [34.655070869, 0.004273972000021], + [34.654979327, 0.00421496000007], + [34.654880157, 0.004164012000047], + [34.6547619150001, 0.004142502000036], + [34.65455976, 0.004121049000048], + [34.654456775, 0.004096915000048], + [34.654338534, 0.00404059300007], + [34.654197407, 0.003965448000031], + [34.654048652, 0.003871559000061], + [34.65393041, 0.003839360000029], + [34.6537778410001, 0.003718651000042], + [34.6536557850001, 0.003595191000045], + [34.6535985720001, 0.003509367000049], + [34.653510845, 0.003399351000041], + [34.653430745, 0.003316213000062], + [34.6533277610001, 0.003190130000064], + [34.653232405, 0.003058672000066], + [34.6531790060001, 0.002967476000038], + [34.653102721, 0.002838706000034], + [34.653041693, 0.002744818000053], + [34.653003551, 0.002640179000025], + [34.6529387090001, 0.002543603000049], + [34.6528853090001, 0.002444341000057], + [34.6527098540001, 0.002232432000028], + [34.652564914, 0.002141225000059], + [34.6523017310001, 0.002049953000039], + [34.6520728770001, 0.001972179000063], + [34.651947007, 0.001907791000065], + [34.651794437, 0.001781704000052], + [34.65170671, 0.001701191000052], + [34.651615168, 0.001505355000063], + [34.651603725, 0.001312210000037], + [34.6516494960001, 0.001113691000057], + [34.6517295960001, 0.00090179700004], + [34.651775366, 0.000805228000047], + [34.6518096950001, 0.000700594000023], + [34.651859281, 0.000574525000047], + [34.651897423, 0.000386756000069], + [34.6519012370001, 0.000284812000075], + [34.6519393790001, 0.000121170000057], + [34.6519546370001, -1.8343999955e-5], + [34.6519050520001, -0.000184614999966], + [34.651878352, -0.000299998999935], + [34.6518554670001, -0.000399263999952], + [34.651779182, -0.000592411999946], + [34.6517334120001, -0.000688986999933], + [34.65166857, -0.000860570999976], + [34.651611356, -0.000994778999939], + [34.6515732130001, -0.001096724999968], + [34.6515045580001, -0.001238931999978], + [34.651432087, -0.001346196999975], + [34.651382502, -0.001442771999962], + [34.6513062180001, -0.001563542999975], + [34.651180348, -0.001729879999971], + [34.651069734, -0.001917652999964], + [34.6509667510001, -0.002091991999976], + [34.6508370660001, -0.002264513999933], + [34.650764596, -0.002419724999925], + [34.6507493390001, -0.002601994999964], + [34.6507188250001, -0.002730259999964], + [34.6506577970001, -0.002878778999957], + [34.6505700700001, -0.002993481999965], + [34.6503984290001, -0.003128502999971], + [34.650406058, -0.003229762999979], + [34.650474715, -0.003330957999935], + [34.650554813, -0.003499719999979], + [34.650467086, -0.003668556999969], + [34.650425129, -0.003769691999935], + [34.650425129, -0.003870952999932], + [34.6504594580001, -0.003978963999941], + [34.6505128580001, -0.004093724999962], + [34.650543371, -0.00419491699995], + [34.650554814, -0.004323179999972], + [34.6505204860001, -0.004431255999975], + [34.650448016, -0.004545835999977], + [34.6503526590001, -0.004674166999962], + [34.6502840040001, -0.004829437999945], + [34.6501848340001, -0.004991396999969], + [34.650135248, -0.005085906999966], + [34.6501505050001, -0.005214170999977], + [34.6502039050001, -0.00531542799996], + [34.650306889, -0.005369365999968], + [34.6504136880001, -0.005443616999969], + [34.6505128590001, -0.005484112999966], + [34.6506349150001, -0.005652871999928], + [34.6505624440001, -0.00575407499997], + [34.650467088, -0.005821590999972], + [34.6504213170001, -0.005990359999942], + [34.650467088, -0.006091617999971], + [34.6505471880001, -0.006159056999934], + [34.650608215, -0.006246808999947], + [34.6506730580001, -0.006373837999945], + [34.6503335900001, -0.006303794999951], + [34.65010855, -0.0062582199999], + [34.6500131930001, -0.00617558099998], + [34.6497728960001, -0.005970740999942], + [34.649589813, -0.005912337999973], + [34.6493876580001, -0.005847031999963], + [34.649196945, -0.005784751999954], + [34.643799791, -0.003914040999973], + [34.643281055, -0.003803418999951], + [34.642808088, -0.00370209099998], + [34.6424724350001, -0.003630233999957], + [34.6422016240001, -0.00357164199994], + [34.6419117410001, -0.003458713999976], + [34.6414158900001, -0.003267193999932], + [34.641118378, -0.003091964999953], + [34.640897153, -0.002962749999938], + [34.6404737710001, -0.002673268999956], + [34.640199146, -0.002484314999947], + [34.639417226, -0.002049380999949], + [34.6391120860001, -0.001701422999929], + [34.6389824020001, -0.001266444999942], + [34.638806946, -0.000831472999948], + [34.6384598490001, -0.000483527999961], + [34.638353051, -0.000411304999943], + [34.6380707970001, -0.000222488999952], + [34.6375902020001, -0.000179089999961], + [34.637243106, -0.000222600999962], + [34.6369608520001, -0.000269299999957], + [34.6367205550001, -0.000309586999947], + [34.636415415, -9.2150999933e-5], + [34.6361980040001, 0.000255787000071], + [34.6358699790001, 0.000436193000041], + [34.6357212230001, 0.000516784000069], + [34.6352863990001, 0.000429804000021], + [34.6349393040001, 0.000125255000057], + [34.63450448, -0.000266247999946], + [34.6340696570001, -0.000440280999953], + [34.633634833, -0.000309811999955], + [34.6332419660001, 8.1646000069e-5], + [34.6331122820001, 0.000603616000035], + [34.632807142, 0.000951583000074], + [34.6322426340001, 0.001343030000044], + [34.6318078100001, 0.001430050000067], + [34.6313272150001, 0.001473526000041], + [34.6308504350001, 0.001516972000047], + [34.6301982000001, 0.001603989000046], + [34.629675648, 0.001864850000061], + [34.6291111400001, 0.00225629800002], + [34.6288327, 0.00237523900006], + [34.6285008620001, 0.002517247000071], + [34.627894397, 0.002473756000029], + [34.6275015300001, 0.002343205000045], + [34.6268912510001, 0.002082166000037], + [34.6266395110001, 0.001984517000039], + [34.6264335430001, 0.001905630000067], + [34.6266814680001, 0.002290099000049], + [34.6278867660001, 0.00431175600005], + [34.6286419850001, 0.005385845000035], + [34.629767186, 0.006411082000056], + [34.6307398170001, 0.007460812000033], + [34.6314263790001, 0.008046664000062], + [34.632303655, 0.00880341800007], + [34.6342565460001, 0.00951142200006], + [34.635450403, 0.010024110000074], + [34.6368197150001, 0.010805339000058], + [34.6384789100001, 0.011342434000028], + [34.640332631, 0.012221321000027], + [34.641846883, 0.013051309000048], + [34.6434107220001, 0.013949873000058], + [34.6456763800001, 0.015248454000073], + [34.6456763800001, 0.015565741000046], + [34.6456763790001, 0.015907460000051], + [34.6458251350001, 0.016517781000061], + [34.646191302, 0.016786272000047], + [34.64670241, 0.016981509000061], + [34.6490710510001, 0.020521140000028], + [34.6512337230001, 0.02335712200005], + [34.652084298, 0.025131419000047], + [34.652141511, 0.025258061000045], + [34.65343835, 0.027966416000027], + [34.6539303870001, 0.02873852700003], + [34.6551204290001, 0.030602785000042], + [34.656268513, 0.033092676000024], + [34.659476286, 0.037921740000058], + [34.6603573740001, 0.039863181000044], + [34.660830339, 0.040904065000063], + [34.663668129, 0.046841595000046], + [34.6635651450001, 0.046982225000022], + [34.663469789, 0.047076855000057], + [34.663340104, 0.047158171000035], + [34.6632333060001, 0.047320864000028], + [34.6631837200001, 0.047461941000051], + [34.6631837200001, 0.047566509000035], + [34.663149392, 0.047712587000035], + [34.663095992, 0.047820468000054], + [34.6630311500001, 0.047933355000055], + [34.662928165, 0.048054486000069], + [34.6628061100001, 0.048192243000074], + [34.662737453, 0.048273622000067], + [34.6626611680001, 0.048351621000052], + [34.6625848830001, 0.04842962500004], + [34.662489527, 0.048600575000023], + [34.662409428, 0.048758274000022], + [34.6623560290001, 0.048902663000035], + [34.662287372, 0.049052047000032], + [34.662230159, 0.049183184000071], + [34.662184387, 0.04931100500005], + [34.6621233590001, 0.049438825000038], + [34.6620737740001, 0.049553338000067], + [34.6620318170001, 0.049666219000073], + [34.6619822320001, 0.049782353000069], + [34.6619288320001, 0.049905237000075], + [34.6618601760001, 0.05004131000004], + [34.6617877050001, 0.050235450000059], + [34.6617381200001, 0.050326830000074], + [34.6616618350001, 0.050481154000067], + [34.6616313210001, 0.050580788000048], + [34.6615817360001, 0.050718549000067], + [34.6615283360001, 0.050876186000039], + [34.6614787510001, 0.05097581900003], + [34.6613795800001, 0.051151772000026], + [34.661326181, 0.051249714000051], + [34.6612689670001, 0.051350910000053], + [34.6611659820001, 0.051498667000033], + [34.661104955, 0.05158166800004], + [34.6610095980001, 0.051757622000025], + [34.660933313, 0.05184556100005], + [34.6608455850001, 0.051993257000049], + [34.6607387870001, 0.052129389000072], + [34.6606663160001, 0.05221221100004], + [34.660792186, 0.052286974000026], + [34.6609294990001, 0.052309609000019], + [34.6612384520001, 0.05232350600005], + [34.661852545, 0.052348606000066], + [34.662291183, 0.052348633000065], + [34.662600136, 0.052412222000044], + [34.6630158890001, 0.052338174000056], + [34.6632981430001, 0.052326005000054] + ] + ] + ] + }, + "properties": { + "id": "9ec52632-7bfb-40f5-9ef7-8804627a65cb", + "uid": "9ec52632-7bfb-40f5-9ef7-8804627a65cb", + "code": "9ec52632-7bfb-40f5-9ef7-8804627a65cb", + "name": "mungoma", + "type": "Feature", + "status": "Active", + "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada", + "version": 0, + "geometry": "0106000020E6100000010000000103000000010000002003000068D71BF4E6544140BD3F696079CAAA3FA8E0D953EF5441403F00A29FDEC9AA3F1848A7B3F5544140FE3FA4F2C5CAAA3FC0857B53FB54414018603AA4FAC9AA3F88E441D302554140E55F6B4D79C8AA3F882313B30855414036C07A4B76C2AA3F500AE2F20E554140ED9F5B263FB9AA3FA046B95214554140D8BF1768B6ACAA3F08BAA0721755414014402E357FA2AA3F70277B321C554140400009ECD98FAA3FD01867F21E554140E0DF3C731B7CAA3F503549B222554140E65F21C05E6BAA3FF0782AB226554140CA5F21DCD961AA3FB8E701B22B55414017603352D354AA3F20C3CF913255414009A08B542C3FAA3F40AB9B113955414017E0AA70872AAA3F3035589141554140D7BFE801C60FAA3F40A135114655414030C0C939DC07AA3FC03B1C7149554140F87F0560BF04AA3F187CEA904F55414024C032154003AA3FB837C3D05455414045400CF38D04AA3FD89D93F05A5541402680DBAFF608AA3F682C609061554140BDDF9024610FAA3F686B317067554140F8BFD7F33012AA3F08310ED06B5541402A40BBF26310AA3FA874EFCF6F55414025E019EBD10AAA3FF832C28F755541401920D7DBADFFA93FD8469D6F7A554140E8DFE04B1BEDA93F780C7ACF7E554140FDDF896DC7DEA93F38EF514F845541400680AD6729D5A93F50DD2A2F895541403DC026B4F1CFA93FD071042F8E554140F1DFE91355CCA93F8031D42E94554140EA7FE90245C9A93FA019A0AE9A554140BC1FAE0B35C6A93FB8FD746EA0554140C67F3E21ADC4A93F60BD446EA6554140C0DF2B53A3C2A93F10F50BAEAD554140CAFFA9AB21C2A93F0075C40DB7554140FBFF4186FDBAA93F70649A2DBC5541400AE08143E7B6A93F1020736DC1554140EF7FD7A5C2AFA93F185937EDC855414011E04180AEABA93F28C5146DCD554140EEFFF9C4AEABA93FD884E46CD3554140CE3FDFEDCDB1A93F581FCBCCD6554140FE5FEC78D8B3A93F38B5A10CDC55414012C0098E77B9A93FF01F824CE05541402C00510504BCA93F6097602CE45541402FA073029DC0A93F20843CCCE8554140D91F88474AC9A93F80ED1FCCEC5541402DE025C679D2A93F783C022CF05541403F60BD6231DDA93F80AEEC0BF3554140E5DF84BE7FE9A93FF01BC7CBF75541401A009485AAF6A93FD82388EBFF554140F03F91D7FF10AA3FA0925FEB0456414025802C538C26AA3F38D640EB0856414008005546E43AAA3F004518EB0D564140238080E8A251AA3F38D2E74A14564140E9DF22856662AA3F58BAB3CA1A56414016E09FA4FD65AA3FA878868A2056414012C05668F25DAA3F10DC5C2A26564140E8DFA59DE659AA3FF0F93B2A2A5641402140A55CBE4EAA3FE0BC1E0A2E564140D01FD331A044AA3FC052F549335641403F2092167838AA3FA85AB6693B564140C9BF26C64128AA3FD03C7589435641401F20B0880115AA3F60CB41294A56414000007161D507AA3FA052042952564140F51F8C5CA7F9A93FD857CBC859564140DB1F40607BECA93FA0C0956860564140FC7F2B6257E1A93F487C6EA865564140F51F1F2AF0C2A93F300C38886C564140FB1F0588368BA93F1814F9A77456414036008823A55FA93F00DDE8E776564140BE9FA9D82B3BA93FC0C9C4877B56414042600B2C940DA93F18008F8782564140E41FAEA099C2A83F48CC2FC78E5641400A80491C9374A83FB829F9069656414001809CA6FF47A83F4830BDE69D564140E0BFFE039D2AA83F788A7346A75641401C209A3B320AA83FA0E429A6B05641402D206760B9E5A73F0054B825BF564140F5DF6FE2F5AAA73FE06186A5C5564140EB5F74359D90A73F48C55C45CB5641403080AE925079A73F40490C65D5564140018039310061A73F88CAC104DF56414019A0E06BDA55A73FA86956A4EC5641401E2079D1B249A73FA0ED05C4F656414048E0EC1E9941A73F00D58B830657414032C01ABD873CA73F901A214314574140CBDF60C7843AA73FB831AD222357414000E0FC2C6130A73F70A238E2315741401380FC893723A73F40FBF1013B57414041E045BA1B1BA73F581E98A146574140C2DF55E0EF0DA73F989F4D4150574140F91FCDFDC1FFA63F7874F5605B574140F99F142EA4F6A63FD0E99040685741400AC0525972E7A63F186B46E0715741401F2026A54ADBA63F1861E0DF7E574140CD3F64DC1ECEA63FC898A71F86574140DF9F8ADC06C7A63F081A5DBF8F5741401040C543EFBFA63F9075105F99574140FD3FA094D9B8A63F78F5C8BEA25741401E4019A6A7A9A63F504E82DEAB57414024E0F7EA8FA2A63F78E7091EBB574140C19FE3DE94A3A63FD09FCF7DC25741401100E6D0BFB0A63F888E5FDDD0574140F41FBE5BF3BFA63F38FFEA9CDF5741400600D1B41ACBA63F50AA99FCE957414027608BC733D2A63F6055485CF4574140C5BFD4F717CAA63FE06DD17B0358414017206D51EABBA63FA8B82DDB1858414042C0E037C5B0A63FB0B8CBFA24584140C71FB4839DA4A63F60A75B5A335841401CE06D48649EA63F407658FA33584140E31F27563EB2A63FB82050DA3458414000803D523DCCA63FA86B3B7A375841402B201A0EE6D7A63F18D9153A3C584140E21FF2636EECA63FB89EF299405841401C20E22E28F7A63F208AD1F944584140E57F8882FDFDA63F70C6A8594A584140F3BF1D53E401A73F605065D952584140B81F142BE2F5A63F28AF2B595A584140FA3F420716EDA63F385ADAB864584140F8FFE3F839EFA63F3017B0386A58414022E0365244F3A63F30DE89D86E58414006608C2000FEA63F80246558735841403E606A28E808A73FA8BD4E78765841403360ACCF8610A73FB0F612F87D58414000002CCAD72BA73FD899003880584140076058C6AC35A73F80D7D4D785584140E19F3CF2024AA73F5079C5D7875841402AA04D2ED032A73FE04ABCF78858414005C0EBD33B26A73F8016A6B78B584140D8FFF44F5915A73F085C9D578D584140002079FCC509A73F68578D378F5841400E80D3D0C7FBA63F38F97D3791584140EFBFFF93C9EDA63F48756C3793584140FA9FB5E7C2E0A63F303E5C7795584140C47F4C2D6DCEA63F38B653B79658414004A0A26A68C1A63FA85647779858414023408EFCF4B1A63FE8A83CB7995841403F007F36EEA4A63F80F22A179C5841400AC03BBDFC95A63FA89518579E584140C89F027DFC87A63FF0E10037A15841402A8064633A81A63FA8D4E936A45841401B60A3A42276A63F60C7D236A758414022004702E76EA63F1832B376AB5841400840BCC6F95EA63F68F69296AF5841400260E15DE253A63F083A7496B35841402F203BED4C48A63F702F5716B7584140E3FF1037353DA63F28224016BA584140C4FF73051333A63FC0ED29D6BC58414037200836E629A63FB8AAFF55C2584140BA5F3C720E18A63F701BEDF5C45841403420168FA407A63FD016DDD5C658414016A0D9C08DFCA53FE8B5D355C8584140DB1F55731EEDA53F3008C995C95841402C40A7F04CDAA53F1059C195CA584140156093C770C8A53FA82AB8B5CB584140F1BFF5B627B5A53F60A5A975CD58414004C0009C9AA8A53FD0C3A1D5CE584140D37F36B96692A53F68179455D0584140CD5F8F69AA7DA53F485E8835D25841401360D63E1065A53FE8B17AB5D3584140DB9F1EDAC251A53FD07A6AF5D55841401A0061EEE132A53FC0C55595D85841401840C68CFF21A53F20B74155DB584140268015D48F04A53F408FFC54E4584140216077B7EFA7A43F6038F7F4E458414035A04B918697A43F1031ED54E6584140F05F827B9B87A43FE0D2DD54E858414043007979D273A43F18A3D734E958414046C0589FC64BA43FC89BCD94EA58414014C06F152E25A43F8016BF54EC584140E25F47E44EF8A33F808EB694ED5841401DC040F75CDBA33FA8AFA874EF58414003401E4D11BAA33FD05296B4F1584140D4FF555C7094A33F804B8C14F3584140F31FE0890077A33F089B87D4F358414023A0F65C5F51A33FB8937D34F5584140C95F9ED2F133A33FD83C78D4F558414003A05AD14E1CA33FF8DB6E54F7584140B81FE3D1A704A33F00D661F4F8584140FE5FBF2465F0A23F207F5C94F95841403980E39093DDA23F90255DB4F958414046A0543768C6A23F981F5054FB584140BE3FDC3D43AFA23F28F14674FC5841400320D85CAF95A23F80E83F94FD58414005C0B30C6482A23FC03A35D4FE584140F47FD81B9B6EA23FE0E32F74FF584140E43F79E54F5BA23F58842334015941401980CF9B1346A23F2826143403594140ECDF03952129A23FC0F1FDF305594140E7BFD2E89E0DA23FC86D4ED4FB584140C57F6FD4C3FDA13F28F1A854F05841400C0017E123EBA13FC838E3F4E8584140FBDFC6E131DBA13FB0D212D5E2584140D37FE3520CC5A13F60963B75DD5841402540A8F3ABB0A13F382C7495D6584140C77F8A17B089A13F48E188F5D3584140BADF5813FC50A13FD86F5595DA5841403FE077E73230A13F7831D954EA584140EC5F452A8C2DA13F20AE7ED4F558414027C03EF09B3CA13F10282AD400594140C09F19E1ED41A13FF8ECC0730E59414031A0C8692248A13F88FD887315594140E53F7779F639A13FD83960D31A5941401C00CF8A4A18A13FD03F6D3319594140FEFF3EFB82F7A03F9036AFD310594140F8DF835BAEE6A03FA8E90F7404594140EAFFF36597DFA03F08EF6554F95841401CA0453B2ADBA03FA83CAD54F0584140DBDFE783A2CFA03F904ED474EB584140F09F432D42BBA03FF00AF374E758414004C0AF9FDFA6A03FB8EB1635E35841402F0083E5688BA03F60F41D15E2584140E6BF8C401567A03FF082EAB4E8584140D87F37D71C5FA03F10288CB4F4584140E5FF8B0D3B5EA03F78D43754FF584140EEFF757C6F64A03FB018D0D30C594140E0FF352C696CA03FF8D856531C5941402900AACE9D72A03F3060195324594140D93F81A6BB71A03F107EF85228594140E7DFD59C0A58A03FD825F6B228594140F39FF7713447A03FF80717B324594140C17F27B3B633A03F4897291322594140E27F818C6C26A03F50137AF317594140FABFA732731EA03F98E1BF130F5941400300771AC91BA03FB8D3F19308594140CABF7E8B7916A03F18513FB4FE58414028E069C6B114A03F38396D14F9584140276058C6F30AA03F784C9174F45841403F800761C4F79F3F50B3A754F15841403080F47583E29F3FD096C594ED58414011806A43CDA99F3F0867BF74EE5841402F40DE2CD2829F3FF829A254F258414084FF6EA079669F3F30F64294FE584140727FD724AF369F3F38B16454FA5841400B008413DB219F3FF0E677D4F7584140D4FF6C41700E9F3F40F48ED4F4584140C93FADB443FE9E3F287EAD34F158414081804410B2EF9E3F200CC354EE584140D6BF5D5A81DF9E3F80C8E154EA584140B5BFBFBCF3D09E3FE0840055E65841408CC016A201C49E3F506E2BF5E0584140947F59200FB79E3F00B05835DB58414005402198B7AB9E3FE8498815D5584140807F2EF03DA59E3F8809BAF5CE58414068800D37C49E9E3FD09ED9B5CA5841402C4001E2BD899E3F70B3FA55C658414016C05AD205809E3FF8C32436C15841408D80131D13739E3F481466B6B8584140500002BEBF679E3F989DCD96AB58414017C0DECF00499E3F28C2619798584140D67F9253E0099E3F5863FDF7845841403A4077BDC7A89D3F280F54F879584140F17F29FAD94E9D3F786350F959584140AD3FA907A47B9C3F406244DA3A5841406F40469B39DD9B3FC049BBBA2B584140ACBFE803A1739B3F98BA997B0F5841407500BAD9F4A79A3F480A865CF157414044400693BFD4993F782319FDDE57414033000EB80751993F28F1A79DCC5741408BC05B93DBE7983F28BC3CBEB95741408E3FA12C9D8B983F60D56D7EB35741407E7FCCABB471983F60969C9EAD5741406080E1153556983F788EDB7EA557414078C01712B13A983FE07D137F9E574140D63F6653342A983F98E8F3BEA25741404380A8385F03983F30BAEADEA357414039C01DBB7BE8973F180BE3DEA457414046C0FB3B94CE973F700CE01EA5574140BF7FF84BC3A4973FC08BE1FEA457414024C0E316F373973F1011F03EA357414009C05E441D4E973F783FF91EA257414056C081DA4725973F1844093FA057414066C01EC872F9963F684B13DF9E5741407C00A0AF93D9963F98A922DF9C5741409E3F7DB9B4B9963FF85B3DBF99574140E07F5AC3D599963FD83A4BDF97574140B27FAA3CFB76963F20CA5D3F95574140BB7F40422A4B963F009F673F945741408A8049C6462D963FE07768FF93574140EE3F0E0B7BFB953FE07768FF935741408E001F1A9CDC953FE07768FF935741400EC02F29BDBD953FE07768FF93574140D8FF4889D9A2953F18C6667F9457414020009F6DF686953F30ED65BF9457414057C0CDB11765953F589053FF96574140ED3F740A3E42953F1001419F99574140A3FFBD8E720F953F302C379F9A5741402480B935A2E1943F70FC307F9B574140F1BF8ED2E99C943FD8A2319F9B574140D23F9C840F7B943FD8A2319F9B574140727F5AF0305A943F087F453F99574140EB3FCF776923943FC8AE4B5F9857414061C0EDCB8509943FD8EB687F94574140747F0D9DA6E8933F40207FBF9157414079C016D8D0BE933FA844847F915741408D0093330093933F909F809F9157414003005FE41C77933F0840745F935741405A4068D0474E933F40106E3F945741407F00A7F0682F933FE0DB57FF965741405800083999FF923F5004547F975741402980F9A9BADF923FE8D54A9F985741409DBF883EE5B9923F7825465F99574140040081200B94923F00F345BF995741409EFF94F4356D923F58F442FF9957414071FFE59B6044923F58F442FF995741400E00802C9015923FB0F53F3F9A57414004804656D7D1913F006B3DFF9A574140957F0B9B0BA0913F90C43CDF9A574140088077824966913F88C0451F9A5741400F803AD0C4ED903F181A45FF99574140708043291A9E903FA86940BF9A574140E13F38F73681903FA86940BF9A5741404400C35D585F903F58A5609F965741403DFF21D045B58F3F38F261DF965741403AFF08F9B24A8F3FD800761F945741406C7F0E7E15F28E3F506C9C1F8F574140CF7FB12032848E3F3084D09F88574140A1FFBBFF252F8E3F380021807E5741404700F2372DBA8D3F281C4CC078574140CB80019AEF7D8D3F301094E06F574140ACFFFC94B1418D3F10B0D02068574140CD7F4C3726178D3FD89AF80063574140E2FEB8E425F08C3FD8E32FE15B57414055FFD2CEB7A58C3F38617D0152574140CB7F9116AB298C3FE8A2AA414C5741406200152159E68B3FB0CC05E24057414078FF846DA5868B3F203E39423A574140F1FF0A85D5468B3FA0EC89C22F574140077FF2521CCD8A3F8841DB62255741400AFF6CC1ED318A3F58E32D431B574140EE80731A798B893FF82A68E31357414005819613F4E4883F30016F2313574140087F4A1A0E11883F982512031F57414061FF5E61BC44873F60807FE2315741400100A0DD0DE1853F68313BA23A574140ABFFADF040FA843F301CC5622957414002800B1EF5C3833FC8B8EEC2235741400980E046C55D833FF094026321574140418085D98F0A833F58B90723215741407D00A5D2C445823FC86F19C31E57414008FFB1A07244813F309E22A31D5741402B00CAAB10E2803F203245231957414046FF794B88A5803FD8E9B5E30A57414047801CF575B8803FE89ECA430857414014017E253C13813FA062F3E302574140747F299382BD813FA89F1004FF564140FB7E1DF8412B823F08623C64F9564140727FB7D796C2823F28CC6524F4564140CF004B6DAC3B833FE04AB084EA564140F60000F9EF1A843F981232C5D956414014FFA89A0294843F30F2E785C25641406500083C6DE3843F58E26546B2564140E700BDF111D8843F002AA0E6AA564140CE00C05936B2843F60A7ED06A156414034FF38D95735843FD00E1D479B564140F7FE3DCF329A833FA07B4087965641401C00DE1C320E833F78CE4E27955641407C80B4E95927823FE8F64AA7955641403500555D0E5B813FE8F64AA7955641404380DC074EED803F20D7550794564140F9FF29D8F8AC803FA86584878E5641403900671AB259803FF0FAA3478A5641400EFFBE44D311803FF83DCEC7845641400C016B975F9B7F3F7021EC078156414067FED0886CFC7E3FB824FFE77E5641400C00560F684E7E3F28D503287E564140F30019C7CC2E7D3FA075F7E77F564140D1FDDF34C44B7C3FC0D5BAA787564140AA016FAA1ECB7B3FC88C83C78E564140D0FEABDE9D597B3F188023479B564140C3FDB254D21B7A3F68872DE799564140C6FF887314ED783F008C3D079856414086018EBB090A783FB83F5527955641404300B9D25E89773FA8D377A7905641402E01D209852E773F203F9EA78B56414003FE787DC59E763F104BB867885641408F00FB5B8BE1753FB849BB27885641406600644C39E0743FB08E99678C564140A0FE0ACD31FD733F180281878F56414037019AE7656D733F8065572795564140A7FE985F12D6723F90593D6798564140E90117120AF3713FE85A3AA798564140D9FFB838F544713FA0904D279656414060007FF45AC4703FD06C61C7935641409A018298D552703F202589078F564140BD0108C353A46F3FE0E2A4478B56414006FD7919FB1B6F3FF0DAE32783564140F2FCCF1CC2936E3F807316C87C5641403DFE75AE2DDE6D3F28BB50687556414079FF43BE74286D3F788389286E564140AE02C6BA65456C3FF86A00095F564140E2004A2E37CC6B3F20D982694E564140D0FB112482806B3FA8BAECE94056414033FC439418CC6B3FD0E93B8A365641405AFF5717B0176C3FE85972AA2F5641408701989BE7096D3FE05F7F0A2E564140730318AF9D1B6F3FB08978CA2E5641409AFF7D394108713F386789AA2C564140AE01CD7F36DC713F9823A8AA28564140040014767A73723FC842E6CA205641409BFECE5F9A82723F40AE0CCB1B564140DA01CF047473723FE87742CB14564140DC00ACDA3320723F30035E6B11564140E000D41329DC713F284C954B0A56414032FEE9A21972713F08ECD18B025641400901D8E01572713FD858F5CBFD55414023FF34251FDC713F60F734CCF55541400FFFAC141955723FC03B5C8CF05541409DFF3DE7E3E4723F282B948CE955414053FFB553EAC7733F1847BFCCE35541400C0208F19048743FD0BB050DDB554140F3FFA6EDF775743FE82F95CDC8554140CCFE18C250D8743F28CBC1EDC2554140EAFD9E83D6DF743F2814F9CDBB554140CD0168DFFB6C733F30CF1A8EB75541401AFE0EF7704D723FD84F7B8EAB554140330230343A946F3FE8C5BE0EA35541405DFDA1731C176C3FD059E18E9E5541405EFD9DAEF4C8693F58F8208F965541400301A8E0A2F3673F18675A6F8F5541401F046649AED2653F70B18E8F8855414069FC290225D0633F2865A6AF85554140E60286A3A772613F781DCEEF80554140E40334F7260C5E3F18B4EAEF7C5541402EFD6389ACDA5A3F1071225076554140C3FFAFAC836F593F10BA59306F55414061FD4FE8CB5E583FB05076306B5541402A07503C3F435A3FB8838F306855414055F7D398DC375D3FD03C9B5066554140D4FF07D9D843603F0019AFF063554140A8032444D673623F009BAA5064554140B0000EB61DC2643FF0E595F06655414008FE819ED8D3663F208376D06A55414049025C8FD2D7693FB0D81C1076554140F7FB4F5763486F3F60490AB0785541407B0072960EAD703F906EF34F7B55414026FF28D1FF63723F78BFEB4F7C55414086FE98C94204743FC84EFEAF795541407200D3E2F9FD743FB0E220307555414020FEF58630BB753F987C50106F55414064014CABCB70763F10E876106A5541407FFE7E87FBF8763FB82FB1B06255414037003225254C773FF0D0EA305B554140E7FDD09E98E3773F103B14F155554140530195A8B90A793F38172891535541400AFE792529E6793F00C92911535541402D02465D15EF7A3F8063107156554140F4FF5C1022FD7C3F88B03E115055414067FE6ECBD3FB7E3FE8A12AD15255414085FF7DF7B799803F00180C7156554140F900A21CC0B3813F704008F15655414026801BB8911F823F98B435D1505541402B7FA019576B833FF8271DF1535541403980A6AFF495843F30FEC1505F554140EEFE5CBAB4A7853FE0FC62306B5541402C80F25422B1863F601945F06E554140A57F3F9F59F6863F7042F8EF78554140B7001C04509E873F8830D1CF7D55414054808820A6FB873F509FA8CF82554140488030AD4B62883F204199CF845541400E01C46045E0883FC0C7A44F835541404380A32FEA7E893F287EB6EF80554140C90032D5363F8A3F502B0A3076554140B4FFEA6289BD8A3FB0A857506C554140477FAE647BB88A3FC0A6A390625541405A7FA2DB43A98A3FE098D5105C5541408B801ED8FE898A3F90952411525541408F80141F07748A3F50045EF14A5541407A80BEF20C598A3F909F8A1145554140198018E81C348A3F5890BF513E5541403F7FB13441EB893FE028F2F1375541405D8070EC4BC9893F001B24723155414037FF84F14AC7893F88315BB22A554140A100623D3CEB893FF8A28E12245541409BFF69EA2BFE893FA8E4BB521E554140C400483D2D078A3FA02DF33217554140A200FB8F33EA893FE040179312554140C1FF88C53DD0893FF0B65A130A55414006FFC156F279893FD811B913FE544140E97EEAC7D0F8883F6032F473F65441407000A289408D883F809C1D34F1544140E1FF9B568648883FB07831D4EE54414003FF6E2FB51A883F68AE4454EC54414065FF6BE172EF873F48155B34E95441409FFF6C195CB2873FC8F26B14E7544140237F3392A26D873F484E8194E45441400B818D9E4905873F60FD8894E354414028FF535F3DBE863FC8A99614E2544140997FC5F2CD87863F50819A94E154414028FF4291814B863FA088A434E0544140FFFE593BF910863F78E5B6F4DD544140CE005B5D1ED0853F889ACB54DB5441404F806E680C6B853F8028E174D85441406280A675E128853F885BFA74D5544140F87EFAAE3BEF843F40971A55D1544140EB7E230638BF843F60014415CC544140A17F6889B997843FD86C6A15C75441401880F2998975843FE8A98735C3544140BC00D4358645843F80B4A4B5BF5441401381F7DB5A03843FA818C115BC54414042FF3C45BDC9833F20FCDE55B8544140F77E3BCCD67B833FC088F735B55441407E7F1965423B833FE8640BD6B2544140FA809B838B08833FA8222716AF5441401780038932C3823FE0B34F16AA5441407A0091173254823F40E86556A75441404100F385D00E823F001E79D6A454414023FF1C5E61D8813F105B96F6A05441407D805BCECB7F813F1806A7369F54414017015BC4FE52813FF86CBD169C54414020817C494C18813FE878D7D698544140227FC68F70DB803F98B4F7B694544140FD7EB57AD0B1803F60A52CF78D544140F3FF50F862AB803FE8BB6337875441404CFFAEEB2E88803FD04F86B7825441407000059E3239803F4006985780544140B800BAB7DE13803F686AB4B77C54414043FE4FC42FB07F3F781FC9177A5441405A00E18FB7697F3F08B2EE57755441407600CF1828217F3F801D15587054414061FF7EDED8DC7E3F508034786C54414010FF457234727E3FE88A51F8685441407D01B9F500017E3F00C261B86654414075FF3FBC1EB47D3F78A57FF86254414023008708C82F7D3F508A9A785F544140290226C1F8C27C3F20EDB9985B544140A90084B915767C3F187BCFB8585441403401F13B3C3A7C3FB085EC3855544140C9FEBDEFD8027C3FC03A01995254414091FFB23DCEC27B3FE82019594F544140FDFF2A2A27497B3F882529794D544140D401C4F87DC07A3F687C2ED94C544140ACFFC3C771F1793F687C2ED94C5441402D02A0436280793F48D333394C54414051FE425477EB783F905842794A544140D6FEA665CF5E783FF09C693945544140DF0003BCF32E783FD8AE9059405441404B00F227DE8C783F38E9B3F93B5441404FFFF24D4205793FC0D0C8F938544140C500D7624832793F58DBE57935544140F4FED5488A49793F78C70A9A30544140E001DEBC8AEF783FA8251A9A2E5441401400AA5F7F98783F88FA239A2D54414042FEF25C0A08783FA0A92B9A2C544140B601C8A6DE18773F188D49DA2854414046019F5D26D9763F784968DA24544140AA002F8F3F95763F502E835A2154414040FE323E3EB4763F403A9D1A1E544140CB01A6BA5AD0763F9874C0BA19544140B1FE37B39DBC763F00A9D6FA165441407D00C961867F763F788CF43A135441401D018E6637C3753F08EC007B11544140E300EB7E6225753FE0CA0E9B0F54414073FEF19D9DAE743F205C379B0A5441403A019F6C2686743F8018569B0654414051002DCD7365743FD852793B025441400CFFFF95E66D743F5836977BFE53414030FF7E224268743F10F4B2BBFA534140E8FFC4B2DB5F743FE056D2DBF6534140CFFEDE276557743F0049045CF05341406EFF463BC2F7733FE0D82F1CEB53414084000EDF9281733F78ED50BCE65341403E005CA79907733F707B66DCE3534140E1FF5D6A08B7723FF05877BCE15341409800063FAC62723FE8E68CDCDE53414059008F6A6E0B723F10C3A07CDC534140B1FE6BD247C2713F7075BB5CD953414082FE6C9F9581713FB882D25CD6534140CC00ABB5B443713FA88EEC1CD3534140F101C475480E713FB8CB093DCF534140AAFFD169BAF7703F283D3D9DC8534140BAFFE2AA3BE1703FA8A2563DC5534140C500093FEDC7703F7805765DC153414016FFAA6CDE8C703FB8189ABDBC534140B10096D7123E703FA02AC1DDB7534140380346693FB76F3FB067DEFDB353414095FF67B4B8736F3FF0F806FEAE53414026FCC58D93766E3F50B525FEAA534140D9009478A9736D3FF0B9351EA9534140FCFDD50FADBF6C3FA06D4D3EA653414057FCEDABF4D86B3FF0FC5F9EA3534140D600384C9A2A6B3F38887B3EA053414057FFA50030226A3FD014941E9D5341409D03B406800E693F209AA25E9B5341400E04E68B3F4F683FD8CFB5DE9853414007FFDBAD3241673F082EC5DE965341400BFD65F14C7C663FC8DBCF9E95534140FFFFBD4EDBA0653F50B9E07E935341404EFE5F7652D6643FD818EDBE9153414043FEF9942706643F885A1AFF8B5341402500C8CDBF49623FD812423F8753414035FC276B798A613F80E2849F7E53414057FDFD2210CB603F78A9C01F775341404AFFD389F527603F28E5E0FF725341401406FCFCDA415F3FA05007006E534140D6FA531A02315D3F58041F206B534140EA0068ED4FDF5B3FA0113620685341402900A09FEAA9583FD86938C067534140E3F947C2CE7F553F38E32C406953414052FA139B283F523FE8531AE06B534140CDFFB74FD28C4D3F80A70C606D534140ACFF87F6BD624A3FD89E05806E534140B40CB02802F5463FA0BEFA1F70534140A1F5FF0A77D3423FE010F05F71534140D520305FB058393F9091EE7F71534140A706D0395AAA323FD0E3E3BF725341400B4C00C094C31F3F0832E23F7353414089D201142E3CF3BE0038EF9F7153414037BC3FC6A63228BFC067F5BF7053414099ECBFE425A933BFF83DFCFF6F5341407FE47FD2892A3ABFB0730F806D534140EDF42F15836943BF18201D006C534140FF0AE850A49346BF98FD2DE069534140260E8026FE324CBF78DC3B00685341401A0560D1674C50BF786444C0665341402BFF7B80FFF751BF10E758806453414037F9FF1A754C54BF789D6A2062534140C2FAAF055C0E56BF70A3778060534140CB058CA36CA357BFF0FE8C005E534140A1044083F99D59BFA03AADE0595341404704A881A4575CBF0879C7405653414023FFDF3A386B5FBF102AE5E052534140F20326A7392361BF58BF04A14E5341400F0346B2078D62BF809B18414C5341409B02AEF787D263BF10731CC14B5341408703BC6DC75065BF282224C14A534140E2FC192DC55D66BF588033C148534140B50008B53C9567BF10344BE14553414052FD4F69C98568BF68F6764140534140C0014042F2A069BF801D768140534140E100AECE4D756ABF68E665C14253414014FC917586496BBF980B4F6145534140FEFC3DDE71AB6CBF50BF668142534140A0FFD38A850D6EBFA0C67021415341409D0162FB9DE16EBFA0C6702141534140EBFC3F11FAB56FBFF8BD694142534140E8FE06043F4C70BF705E5D01445341402602E6EF94C470BF9089530145534140FB003075B02E71BF58315161455341407B016FCB2EB571BFC85F5A4144534140AFFE9939822672BFF03B6EE141534140CEFF3E8FA79E72BFD0A284C13E53414055006A26382573BF682599813C5341403701496408C873BF5831B341395341409AFE04EEDB7174BF8811BEA137534140E0FFC3C3F5D474BF003ABA213853414077FEBA5E745B75BF78DAADE1395341408FFEC856A1C575BF304F92413D534140B2FFEB3530FE75BF606A77C1405341401600CACF0B4C76BF30845F01445341409200B85F827676BFD0C7400148534140DA00E445772777BF387E52A145534140C7FE18BF959177BFD00A6B814253414055014A6F61D877BF7891760141534140EA01A804598978BFD00A6B8142534140CD006F4186F378BF887B582145534140680039463D3A79BF90F7462147534140F8FFBE05419679BFD03F3841495341403600281C741B7ABF30458E213E53414052FFD81502D279BFD08CC8C1365341403A20B12338A279BFB0F3DEA1335341403E02DCE6904B79BFE0121DC22B53414089003E95C67478BF30534DC225534140D4FEA425893778BFA8C480221F534140BC007FB30EF377BF18B8AFE21853414091FF7B8AC0B177BF28C21308685241403FFF70612B0870BF48AE9A08575241406002F80659286FBF40C81189475241403103B2F8D8536EBF107468893C5241401A04D00927BD6DBF5842AEA93352414032FDA5B246426DBFC041F7292A524140100284F072556CBFB05777EA19524140C001246CCDC36ABFF82FC12A10524140E5FDC311525469BF081EFCEA085241406D01644B564568BF1032660BFB514140E1FDB35D40E665BFA87FAD0BF25141407C00B075FC5964BFA815756CD8514140FBFCE50BDDC960BFA0ECC16CCE51414058FF0B0949E05BBFA8A7E32CCA5141401300D8F6DABF54BF90C30E6DC451414088F3CFABE63E4BBFD8A1650DB9514140F9F84FF240B03FBF68AC828DB5514140ABEEFF858DF43ABFF0D2CA4DAC51414091BBFFF47D292DBF90EB448E9C5141408944C062437927BF90EF9D2E915141403725A007402D2DBF1816E6EE87514140841350B11AA631BF4835240F80514140F200400A024A34BF380C710F76514140F404C01F262818BFF87AAAEF6E51414090DFCFCC64C3303F2028FE2F6451414043E47FAB1A963C3F481423505F51414043EE8F3019EF403F40A6911051514140CA0EB01FEA2A3C3F08D0ECB045514140E5DFFF41DC6A203F00625B7137514140210FD073E67231BFC019CC31295141403EEAEF7EB0DA3CBFB8AB3AF21A514140F0036068C84D34BF68369F120E5141408EC2BF992B67153F70F1C0D209514140F603607D7FC7433F60C80DD3FF504140EC0AB0EE742E4F3F68159E53ED5041403906607B1301563F60A70C14DF504140ADFBD77E106E573F00C08654CF5041408A05B87E6A24583F107F01B5BF50414095FC4348A4DA583FC87FA955AA504140290618139E475A3FB89F2D36995041405B02C870BF8D5E3FC0ECBDB686504140BCFDD7C3CC7B623FE89304977D5041402C046ABA3C75633F28E65BB77250414082FE51B10C9F643F783AF6D75E5041404400CAA3D743643F28C55AF851504140B1FEF99A0E32633FD098F6F83D5041404C04005C9E0E613F381037B9355041401CFCA173D541603FC0266EF92E5041401EFFD3A1CA385F3FE8082D193750414072FCE989AFC2623FE0C7F2975E504140AE01233034A9713FE03B2F5777504140E0002FC2770F763F68FB0D369C504140E5FD5AB881427A3F70261315BC504140F2FDAA783A8F7E3F88D15F94D250414067FFC6F5C47A803FE8AE7F53EF504140FCFE39C38607823F102C89512F514140E0006E73B97A833FC08E557056514140117FF9448587843FC8AFF44E835141408C00050D1C21863F68D14AADB95141404680B2B8B33A873F785A6E6BF6514140688012F07D07893F28C3E50928524140B0009A0AA5BA8A3F687154485B5241407A7F8C42C0918C3F30F30B86A55241407580F5D9943A8F3F30F30B86A552414069004464EEE08F3F70CD0986A552414030C0D9910B4A903F48E1E465AA5241408B7FCA8409EA903F60868665B6524140DD3F0CA56B30913FE8980225C7524140DCFF2AC79963913FB0699CC214534140F8FFB4647E03953F382B6BA05B53414019C079ECEDEA973F98128F7F77534140DE3FD4FA0CBC993FF80D7F5F79534140FB7FD2C73FDD993FE8992BDEA353414078006D683AA39C3F5003ADFDB353414003C066E6A16D9D3F98BF78FCDA5341402480F72256569F3F685D4C9B00544140158050F285F1A03FC86D0CB869544140C11F37727A6AA33F588026978654414019606B65F268A43FD81AAB1696544140C9BFE5AA60F1A43FF0B9C613F3544140DB3F3C1D9FFBA73F3845E2B3EF544140FC9FBCDF0D0EA83FD0D1FA93EC544140F25F3F21751AA83F18671A54E8544140F85F5EA41D25A83FB07137D4E454414001E098B6703AA83FE8514234E3544140C5BFCC78EE4CA83FE8514234E35441401F801431A35AA83F50804B14E254414000A08BC1C86DA83FD8DF5754E0544140BE7F47A4EC7BA83F60BD6834DE5441402DC03980B88AA83FE02282D4DA544140EFBF97FB989AA83F0805A3D4D654414035603657A7ACA83F183CB394D4544140BDDF7FF751B7A83FD871C614D254414034C0CE2D8BC1A83F98A7D994CF54414020C0108FC4CBA83F3034F274CC544140EE3F62B02CE2A83F40E906D5C9544140F49F7A30D8F6A83F906E1515C8544140D27F8B14C509A93FA0A525D5C554414005805593591DA93F40AA35F5C3544140C93F96CD892EA93F200B3F75C25441403BC09DC34A3FA93F58694E75C0544140CA3F0EB10B50A93F506F5BD5BE5441403F603C1C0E5FA93FA0766575BD544140C77FA4C4D96DA93F987C72D5BB54414028401B94127DA93F20DC7E15BA544140C2FFA0E12D8DA93FF83891D5B7544140F45FCCBB039FA93F60EFA275B5544140DD3FB3FD75B8A93F58F5AFD5B3544140F25FEC3170C4A93F182BC355B1544140CC3FFD72AAD8A93F30DACA55B05441404740889CB9E5A93F28E0D7B5AE5441403F00831AC8F7A93FB03FE4F5AC544140F6DF0786710CAA3FA845F155AB5441401FE0FBA68019AA3FD82B0916A854414035C0BEA79030AA3F20B11756A654414046801E0B673DAA3F00902576A4544140D2DF239EAA4AAA3F80F53E16A15441403C001B85085EAA3F707950169F54414019404492E968AA3F50E066F69B544140F21F9E9BF97FAA3F08167A7699544140F03FE059808BAA3F00A48F9696544140E3FFDA34DC9EAA3F98AEAC1693544140FDDFD409B4B0AA3F0065BEB6905441403BE064158FBBAA3F48299ED694544140FD7FACB65BC5AA3F60957B5699544140BDDFD73753C8AA3F58192B76A3544140E31F2A8625CAAA3F58C68D95B7544140C5DF85BD6FCDAA3F08B51DF5C5544140F37F73A570CDAA3F0039CD14D05441403C40CD56C6D5AA3FE8FD63B4DD5441400C4053B311CCAA3F68D71BF4E6544140BD3F696079CAAA3F", + "created_at": "2021-02-15T01:23:31.727587", + "total_males": 50, + "total_females": 100, + "server_version": 1599045641945, + "geographic_level": 3, + "effective_end_date": null, + "effective_start_date": null + } + }, + "jurisdiction_id": "17de7da3-217f-4e5d-b016-4be97dd49e77", + "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada" + } +] From 5285f769477ca591c64038165578268e81cde56a Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Thu, 8 Apr 2021 16:40:16 +0300 Subject: [PATCH 30/40] Test MDA Lite supervisors Reducer --- .../ducks/superset/MDALite/tests/fixtures.ts | 69 ++++++++++++++++ .../MDALite/tests/supervisors.test.ts | 80 +++++++++++++++++++ .../superset/MDALite/tests/wards.test.ts | 2 +- 3 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 src/store/ducks/superset/MDALite/tests/supervisors.test.ts diff --git a/src/store/ducks/superset/MDALite/tests/fixtures.ts b/src/store/ducks/superset/MDALite/tests/fixtures.ts index ac041e9614..9e05fd0f5b 100644 --- a/src/store/ducks/superset/MDALite/tests/fixtures.ts +++ b/src/store/ducks/superset/MDALite/tests/fixtures.ts @@ -193,3 +193,72 @@ export const wardsData = [ plan_id: '5e396185-6094-4817-9dd4-24bcbbc698b0', }, ]; + +export const supervisorData = [ + { + supervisor_name: 'emuhayaSupervisor1:emuhaya Supervisor 1', + base_entity_id: '9ec52632-7bfb-40f5-9ef7-8804627a65cb', + treated_male_1_4: 0, + treated_male_5_14: 25, + treated_male_above_15: 0, + treated_female_1_4: 0, + treated_female_5_14: 25, + treated_female_above_15: 25, + total_males: 25, + total_females: 50, + total_all_genders: 75, + supervisor_distributed: 0, + received_number: 288, + adminstered: 900, + damaged: 3, + adverse: 5, + remaining_with_cdd: -615, + returned_to_supervisor: 0, + id: '13890722-db5d-53a6-a930-a9fb04c7bcc3', + plan_id: '5e396185-6094-4817-9dd4-24bcbbc698b0', + }, + { + supervisor_name: 'UHS3:UpperHillWard Supervisor 3', + base_entity_id: '9ec52632-7bfb-40f5-9ef7-8804627a65cb', + treated_male_1_4: 0, + treated_male_5_14: 35, + treated_male_above_15: 0, + treated_female_1_4: 0, + treated_female_5_14: 135, + treated_female_above_15: 79, + total_males: 35, + total_females: 214, + total_all_genders: 249, + supervisor_distributed: 679, + received_number: 0, + adminstered: 135, + damaged: 4, + adverse: 10, + remaining_with_cdd: -139, + returned_to_supervisor: 57, + id: 'b26bbce2-75b0-5d5f-8e3d-4eec512f24d3', + plan_id: '5e396185-6094-4817-9dd4-24bcbbc698b0', + }, + { + supervisor_name: 'emuhayaSupervisor2:emuhaya Supervisor 2', + base_entity_id: '6cb96ec5-a89f-4eb6-bb5e-83692687095e', + treated_male_1_4: 0, + treated_male_5_14: 25, + treated_male_above_15: 0, + treated_female_1_4: 0, + treated_female_5_14: 25, + treated_female_above_15: 25, + total_males: 25, + total_females: 50, + total_all_genders: 75, + supervisor_distributed: 0, + received_number: 288, + adminstered: 900, + damaged: 3, + adverse: 5, + remaining_with_cdd: -615, + returned_to_supervisor: 0, + id: '805f58fa-0137-52a3-9577-7ff6180e6b69', + plan_id: '28713d21-d4f9-49b7-aab7-b07838fb086f', + }, +]; diff --git a/src/store/ducks/superset/MDALite/tests/supervisors.test.ts b/src/store/ducks/superset/MDALite/tests/supervisors.test.ts new file mode 100644 index 0000000000..be9dde54ce --- /dev/null +++ b/src/store/ducks/superset/MDALite/tests/supervisors.test.ts @@ -0,0 +1,80 @@ +import reducerRegistry from '@onaio/redux-reducer-registry'; +import { FlushThunks } from 'redux-testkit'; +import store from '../../../../'; +import reducer, { + fetchMDALiteSupervisors, + getMDALiteSupervisorById, + getMDALiteSupervisorsArrayByName, + getMDALiteSupervisorsArrayByPlanId, + getMDALiteSupervisorsArrayByWardId, + makeMDALiteSupervisorsArraySelector, + MDALiteSupervisor, + reducerName, + removeMDALiteSupervisors, +} from '../supervisors'; +import { supervisorData } from './fixtures'; + +reducerRegistry.register(reducerName, reducer); + +const MDALiteSupervisorsSelector = makeMDALiteSupervisorsArraySelector(); + +describe('reducers/MDA-Lite/supervisors', () => { + let flushThunks; + + beforeEach(() => { + flushThunks = FlushThunks.createMiddleware(); + jest.resetAllMocks(); + }); + + it('should have initial state', () => { + expect(MDALiteSupervisorsSelector(store.getState(), {})).toEqual([]); + expect(getMDALiteSupervisorById(store.getState(), 'test-id')).toEqual(null); + }); + + it('Fetches supervisor data correctly', () => { + // action creators dispatch + store.dispatch(fetchMDALiteSupervisors(supervisorData as MDALiteSupervisor[])); + + expect( + getMDALiteSupervisorById(store.getState(), '13890722-db5d-53a6-a930-a9fb04c7bcc3') + ).toEqual(supervisorData[0]); + + // RESELECT TESTS + expect( + getMDALiteSupervisorsArrayByName()(store.getState(), { + supervisor_name: 'UHS3:UpperHillWard', + }) + ).toEqual([supervisorData[1]]); + expect( + getMDALiteSupervisorsArrayByPlanId()(store.getState(), { + plan_id: '5e396185-6094-4817-9dd4-24bcbbc698b0', + }) + ).toEqual([supervisorData[0], supervisorData[1]]); + expect( + getMDALiteSupervisorsArrayByWardId()(store.getState(), { + base_entity_id: '6cb96ec5-a89f-4eb6-bb5e-83692687095e', + }) + ).toEqual([supervisorData[2]]); + + expect( + MDALiteSupervisorsSelector(store.getState(), { + plan_id: '28713d21-d4f9-49b7-aab7-b07838fb086f', + }) + ).toEqual([supervisorData[2]]); + expect( + MDALiteSupervisorsSelector(store.getState(), { + supervisor_name: 'onyx', + }) + ).toEqual([]); + expect( + MDALiteSupervisorsSelector(store.getState(), { + base_entity_id: '9ec52632-7bfb-40f5-9ef7-8804627a65cb', + supervisor_name: 'UHS3:UpperHillWard', + }) + ).toEqual([supervisorData[1]]); + + // reset + store.dispatch(removeMDALiteSupervisors()); + expect(MDALiteSupervisorsSelector(store.getState(), {})).toEqual([]); + }); +}); diff --git a/src/store/ducks/superset/MDALite/tests/wards.test.ts b/src/store/ducks/superset/MDALite/tests/wards.test.ts index 792b2fded1..f3771c0284 100644 --- a/src/store/ducks/superset/MDALite/tests/wards.test.ts +++ b/src/store/ducks/superset/MDALite/tests/wards.test.ts @@ -20,7 +20,7 @@ reducerRegistry.register(reducerName, reducer); const makeMDALiteWardsSelector = makeMDALiteWardsArraySelector(); const defaultProps = {}; -describe('reducers/MDA/Dynami-MDAPlan', () => { +describe('reducers/MDA-Lite/wards', () => { let flushThunks; beforeEach(() => { From c81e430b83922696f4e5cd00a21c94b2a84f39ec Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Thu, 8 Apr 2021 18:12:48 +0300 Subject: [PATCH 31/40] Add MDA Lite cdd supervisor tests --- src/configs/__mocks__/env.ts | 3 +- .../__snapshots__/supervisors.test.tsx.snap | 32 +++++ .../cddReports/tests/supervisors.test.tsx | 131 ++++++++++++++++++ 3 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 src/containers/pages/MDALite/cddReports/tests/__snapshots__/supervisors.test.tsx.snap create mode 100644 src/containers/pages/MDALite/cddReports/tests/supervisors.test.tsx diff --git a/src/configs/__mocks__/env.ts b/src/configs/__mocks__/env.ts index 00af3768ca..63e24d3e2b 100644 --- a/src/configs/__mocks__/env.ts +++ b/src/configs/__mocks__/env.ts @@ -230,5 +230,6 @@ export const CHECK_SESSION_EXPIRY_STATUS = false; export const OPENSRP_GENERATED_TASKS_INTERVENTIONS = []; export const SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES = '1,2'; export const SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE = '1'; - +export const SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE = '1'; +export const SUPERSET_MDA_LITE_REPORTING_WARD_SLICE = '1'; export const SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_COLUMNS = 'mdaLiteJurisdictionsColumns'; diff --git a/src/containers/pages/MDALite/cddReports/tests/__snapshots__/supervisors.test.tsx.snap b/src/containers/pages/MDALite/cddReports/tests/__snapshots__/supervisors.test.tsx.snap new file mode 100644 index 0000000000..6df5aee01a --- /dev/null +++ b/src/containers/pages/MDALite/cddReports/tests/__snapshots__/supervisors.test.tsx.snap @@ -0,0 +1,32 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: breadcrumb item href-1 1`] = ` + + ... + +`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: breadcrumb item href-2 1`] = `null`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: breadcrumb item-1 1`] = `"..."`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: breadcrumb item-2 1`] = `"mungoma"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-1 1`] = `"Name"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-2 1`] = `"Supervisor Distributed"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-3 1`] = `"Received by CDD"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-4 1`] = `"Administered"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-5 1`] = `"Damaged"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-6 1`] = `"Remaining with CDD"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-7 1`] = `"Returned to Supervisor"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-8 1`] = `"Adverse Reaction"`; diff --git a/src/containers/pages/MDALite/cddReports/tests/supervisors.test.tsx b/src/containers/pages/MDALite/cddReports/tests/supervisors.test.tsx new file mode 100644 index 0000000000..4c973bc378 --- /dev/null +++ b/src/containers/pages/MDALite/cddReports/tests/supervisors.test.tsx @@ -0,0 +1,131 @@ +import reducerRegistry from '@onaio/redux-reducer-registry'; +import { mount, shallow } from 'enzyme'; +import toJson from 'enzyme-to-json'; +import flushPromises from 'flush-promises'; +import { createBrowserHistory } from 'history'; +import React from 'react'; +import { act } from 'react-dom/test-utils'; +import Helmet from 'react-helmet'; +import { Provider } from 'react-redux'; +import { Router } from 'react-router'; +import { REPORT_MDA_LITE_CDD_REPORT_URL } from '../../../../../constants'; +import store from '../../../../../store'; +import supervisorReducer, { + reducerName as supervisorReducerName, +} from '../../../../../store/ducks/superset/MDALite/supervisors'; +import { + supervisorData, + wardsData, +} from '../../../../../store/ducks/superset/MDALite/tests/fixtures'; +import wardsReducer, { + reducerName as wardsReducerName, +} from '../../../../../store/ducks/superset/MDALite/wards'; +import ConnectedMDALiteSupervisorReports, { MDALiteSupervisorReports } from '../supervisors'; + +/** register the reducers */ +reducerRegistry.register(supervisorReducerName, supervisorReducer); +reducerRegistry.register(wardsReducerName, wardsReducer); + +jest.mock('../../../../../configs/env'); + +const history = createBrowserHistory(); + +const mock: any = jest.fn(); +const planId = supervisorData[0].plan_id; +const jurisdictionId = supervisorData[0].base_entity_id; +const props = { + history, + location: mock, + match: { + isExact: true, + params: { + jurisdictionId, + planId, + }, + path: `${REPORT_MDA_LITE_CDD_REPORT_URL}/:planId/:jurisdictionId`, + url: `${REPORT_MDA_LITE_CDD_REPORT_URL}/${planId}/${jurisdictionId}`, + }, +}; + +describe('components/MDA/Lite/Reports/cddReport/supervisor', () => { + beforeEach(() => { + jest.resetAllMocks(); + }); + + it('renders without crashing', async () => { + shallow( + + + + ); + }); + + it('renders correctly', async () => { + const supersetServiceMock: any = jest.fn(); + supersetServiceMock.mockImplementationOnce(async () => supervisorData); + supersetServiceMock.mockImplementationOnce(async () => wardsData); + const allProps = { + ...props, + service: supersetServiceMock, + }; + const wrapper = mount( + + + + + + ); + await act(async () => { + await flushPromises(); + }); + wrapper.update(); + + const helmet = Helmet.peek(); + expect(helmet.title).toEqual('MDA Lite Reporting: mungoma'); + expect(wrapper.find('HeaderBreadcrumb').length).toEqual(1); + wrapper.find('BreadcrumbItem li').forEach((item, i) => { + expect(item.text()).toMatchSnapshot(`breadcrumb item-${i + 1}`); + expect(toJson(item.find('a'))).toMatchSnapshot(`breadcrumb item href-${i + 1}`); + }); + expect(wrapper.find('.page-title').text()).toEqual('MDA Lite Reporting: mungoma'); + // table tests + expect(wrapper.find('DrillDownTable .thead .tr').length).toEqual(1); + wrapper + .find('.thead .tr .th') + .forEach((th, i) => expect(th.text()).toMatchSnapshot(`table headers-${i + 1}`)); + expect(wrapper.find('.no-data-cls').length).toMatchInlineSnapshot(`0`); + // check data rendered + expect(wrapper.find('.tbody .tr').length).toEqual(2); + const row1 = wrapper.find('.tbody .tr').at(0); + const row2 = wrapper.find('.tbody .tr').at(1); + expect( + row1 + .find('.td') + .at(0) + .text() + ).toEqual('emuhayaSupervisor1:emuhaya Supervisor 1'); + expect( + row2 + .find('.td') + .at(0) + .text() + ).toEqual('UHS3:UpperHillWard Supervisor 3'); + // do we have correct links to cdds + expect( + row1 + .find('.td a') + .at(0) + .prop('href') + ).toEqual( + '/intervention/mda-lite/cdd/report/5e396185-6094-4817-9dd4-24bcbbc698b0/9ec52632-7bfb-40f5-9ef7-8804627a65cb/emuhayaSupervisor1:emuhaya Supervisor 1' + ); + expect( + row2 + .find('.td a') + .at(0) + .prop('href') + ).toEqual( + '/intervention/mda-lite/cdd/report/5e396185-6094-4817-9dd4-24bcbbc698b0/9ec52632-7bfb-40f5-9ef7-8804627a65cb/UHS3:UpperHillWard Supervisor 3' + ); + }); +}); From 4bd2649ef6c21b7033a60c113f0327a2c7d0f728 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Thu, 8 Apr 2021 18:44:20 +0300 Subject: [PATCH 32/40] Add MDA Lite wards tests --- .../tests/__snapshots__/index.test.tsx.snap | 108 ++++++++++++++ .../MDALite/wardReports/tests/index.test.tsx | 138 ++++++++++++++++++ .../ducks/superset/MDALite/tests/fixtures.ts | 2 +- 3 files changed, 247 insertions(+), 1 deletion(-) create mode 100644 src/containers/pages/MDALite/wardReports/tests/__snapshots__/index.test.tsx.snap create mode 100644 src/containers/pages/MDALite/wardReports/tests/index.test.tsx diff --git a/src/containers/pages/MDALite/wardReports/tests/__snapshots__/index.test.tsx.snap b/src/containers/pages/MDALite/wardReports/tests/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..dafd8399e8 --- /dev/null +++ b/src/containers/pages/MDALite/wardReports/tests/__snapshots__/index.test.tsx.snap @@ -0,0 +1,108 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item href-1 1`] = ` + + Home + +`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item href-2 1`] = ` + + MDA Lite Reporting + +`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item href-3 1`] = ` + + MDA-Lite 2021-03-02 + +`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item href-4 1`] = ` + + Kenya + +`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item href-5 1`] = ` + + Vihiga + +`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item href-6 1`] = `null`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item-1 1`] = `"Home"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item-2 1`] = `"MDA Lite Reporting"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item-3 1`] = `"MDA-Lite 2021-03-02"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item-4 1`] = `"Kenya"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item-5 1`] = `"Vihiga"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item-6 1`] = `"vihiga"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-1 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-2 1`] = `"Male"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-3 1`] = `"Female"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-4 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-5 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-6 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-7 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-8 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-9 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-10 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-11 1`] = `"Name"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-12 1`] = `"1-4"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-13 1`] = `"5-14"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-14 1`] = `"15+"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-15 1`] = `"1-4"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-16 1`] = `"5-14"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-17 1`] = `"15+"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-18 1`] = `"Total Male"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-19 1`] = `"Total female"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-20 1`] = `"Total Treated"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-21 1`] = `"Census Pop Target (Official)"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-22 1`] = `"Treatment Coverage (Census)"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-23 1`] = `"Other Pop Target (Unofficial)"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-24 1`] = `"Other Pop Coverage (Unofficial)"`; diff --git a/src/containers/pages/MDALite/wardReports/tests/index.test.tsx b/src/containers/pages/MDALite/wardReports/tests/index.test.tsx new file mode 100644 index 0000000000..d8af743491 --- /dev/null +++ b/src/containers/pages/MDALite/wardReports/tests/index.test.tsx @@ -0,0 +1,138 @@ +import reducerRegistry from '@onaio/redux-reducer-registry'; +import { mount, shallow } from 'enzyme'; +import toJson from 'enzyme-to-json'; +import flushPromises from 'flush-promises'; +import { createBrowserHistory } from 'history'; +import React from 'react'; +import { act } from 'react-dom/test-utils'; +import Helmet from 'react-helmet'; +import { Provider } from 'react-redux'; +import { Router } from 'react-router'; +import ConnectedMDALiteWardsReport, { MDALiteWardsReport } from '../'; +import { REPORT_MDA_LITE_WARD_URL } from '../../../../../constants'; +import store from '../../../../../store'; +import GenericJurisdictionsReducer, { + reducerName as genericJurisdictionsReducerName, +} from '../../../../../store/ducks/generic/jurisdictions'; +import GenericPlansReducer, { + reducerName as genericPlanReducerName, +} from '../../../../../store/ducks/generic/plans'; +import { + MDALitePlans, + MDALteJurisidtionsData, + wardsData, +} from '../../../../../store/ducks/superset/MDALite/tests/fixtures'; +import wardsReducer, { + reducerName as wardsReducerName, +} from '../../../../../store/ducks/superset/MDALite/wards'; + +/** register the reducers */ +reducerRegistry.register(genericJurisdictionsReducerName, GenericJurisdictionsReducer); +reducerRegistry.register(genericPlanReducerName, GenericPlansReducer); +reducerRegistry.register(wardsReducerName, wardsReducer); + +jest.mock('../../../../../configs/env'); + +const history = createBrowserHistory(); + +const mock: any = jest.fn(); +const planId = wardsData[0].plan_id; +const jurisdictionId = wardsData[0].parent_id; +const props = { + history, + location: mock, + match: { + isExact: true, + params: { + jurisdictionId, + planId, + }, + path: `${REPORT_MDA_LITE_WARD_URL}/:planId/:jurisdictionId`, + url: `${REPORT_MDA_LITE_WARD_URL}/${planId}/${jurisdictionId}`, + }, +}; + +describe('components/MDA/Lite/Reports/wards', () => { + beforeEach(() => { + jest.resetAllMocks(); + }); + + it('renders without crashing', async () => { + shallow( + + + + ); + }); + + it('renders correctly', async () => { + const supersetServiceMock: any = jest.fn(); + supersetServiceMock.mockImplementationOnce(async () => wardsData); + supersetServiceMock.mockImplementationOnce(async () => MDALitePlans); + supersetServiceMock.mockImplementationOnce(async () => MDALteJurisidtionsData); + supersetServiceMock.mockImplementationOnce(async () => []); + const allProps = { + ...props, + service: supersetServiceMock, + }; + const wrapper = mount( + + + + + + ); + await act(async () => { + await flushPromises(); + }); + wrapper.update(); + + const helmet = Helmet.peek(); + expect(helmet.title).toEqual('MDA Lite Reporting: vihiga'); + expect(wrapper.find('HeaderBreadcrumb').length).toEqual(1); + wrapper.find('BreadcrumbItem li').forEach((item, i) => { + expect(item.text()).toMatchSnapshot(`breadcrumb item-${i + 1}`); + expect(toJson(item.find('a'))).toMatchSnapshot(`breadcrumb item href-${i + 1}`); + }); + expect(wrapper.find('.page-title').text()).toEqual('MDA Lite Reporting: vihiga'); + // table tests + expect(wrapper.find('DrillDownTable .thead .tr').length).toEqual(2); + wrapper + .find('.thead .tr .th') + .forEach((th, i) => expect(th.text()).toMatchSnapshot(`table headers-${i + 1}`)); + expect(wrapper.find('.no-data-cls').length).toMatchInlineSnapshot(`0`); + // check data rendered + expect(wrapper.find('.tbody .tr').length).toEqual(2); + const row1 = wrapper.find('.tbody .tr').at(0); + const row2 = wrapper.find('.tbody .tr').at(1); + expect( + row1 + .find('.td') + .at(0) + .text() + ).toEqual('lugaga'); + expect( + row2 + .find('.td') + .at(0) + .text() + ).toEqual('mungoma'); + // do we have correct links to cdds supervisors + expect( + row1 + .find('.td a') + .at(0) + .prop('href') + ).toEqual( + '/intervention/mda-lite/cdd/report/5e396185-6094-4817-9dd4-24bcbbc698b0/28713d21-d4f9-49b7-aab7-b07838fb086f' + ); + expect( + row2 + .find('.td a') + .at(0) + .prop('href') + ).toEqual( + '/intervention/mda-lite/cdd/report/5e396185-6094-4817-9dd4-24bcbbc698b0/9ec52632-7bfb-40f5-9ef7-8804627a65cb' + ); + }); +}); diff --git a/src/store/ducks/superset/MDALite/tests/fixtures.ts b/src/store/ducks/superset/MDALite/tests/fixtures.ts index 9e05fd0f5b..f4ad7ffee6 100644 --- a/src/store/ducks/superset/MDALite/tests/fixtures.ts +++ b/src/store/ducks/superset/MDALite/tests/fixtures.ts @@ -37,7 +37,7 @@ export const MDALitePlans = [ }, ]; -export const wardsJurisidtions = [ +export const MDALteJurisidtionsData = [ { id: '541e7ed0-2dc6-586e-b563-4c988c5ac585', plan_id: '5e396185-6094-4817-9dd4-24bcbbc698b0', From 739d732532ebe40ea71da050034b5a2c0e6935ff Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Thu, 8 Apr 2021 20:01:54 +0300 Subject: [PATCH 33/40] Add MDA Lite map tests --- src/configs/__mocks__/env.ts | 1 + .../cddReports/tests/supervisors.test.tsx | 4 +- src/containers/pages/MDALite/map/index.tsx | 13 +- .../tests/__snapshots__/index.test.tsx.snap | 68 ++++++++++ .../pages/MDALite/map/tests/index.test.tsx | 121 ++++++++++++++++++ .../pages/MDALite/wardReports/index.tsx | 11 +- .../MDALite/wardReports/tests/index.test.tsx | 8 +- src/store/ducks/generic/jurisdictions.ts | 21 ++- .../ducks/superset/MDALite/tests/fixtures.ts | 4 +- .../superset/MDALite/tests/wards.test.ts | 18 +-- 10 files changed, 238 insertions(+), 31 deletions(-) create mode 100644 src/containers/pages/MDALite/map/tests/__snapshots__/index.test.tsx.snap create mode 100644 src/containers/pages/MDALite/map/tests/index.test.tsx diff --git a/src/configs/__mocks__/env.ts b/src/configs/__mocks__/env.ts index 63e24d3e2b..6576e9e3ed 100644 --- a/src/configs/__mocks__/env.ts +++ b/src/configs/__mocks__/env.ts @@ -232,4 +232,5 @@ export const SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_DATA_SLICES = '1,2'; export const SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE = '1'; export const SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE = '1'; export const SUPERSET_MDA_LITE_REPORTING_WARD_SLICE = '1'; +export const SUPERSET_MDA_LITE_REPORTING_WARD_GEOJSON_SLICE = '1'; export const SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_COLUMNS = 'mdaLiteJurisdictionsColumns'; diff --git a/src/containers/pages/MDALite/cddReports/tests/supervisors.test.tsx b/src/containers/pages/MDALite/cddReports/tests/supervisors.test.tsx index 4c973bc378..312cd91180 100644 --- a/src/containers/pages/MDALite/cddReports/tests/supervisors.test.tsx +++ b/src/containers/pages/MDALite/cddReports/tests/supervisors.test.tsx @@ -14,8 +14,8 @@ import supervisorReducer, { reducerName as supervisorReducerName, } from '../../../../../store/ducks/superset/MDALite/supervisors'; import { + MDALiteWardsData, supervisorData, - wardsData, } from '../../../../../store/ducks/superset/MDALite/tests/fixtures'; import wardsReducer, { reducerName as wardsReducerName, @@ -63,7 +63,7 @@ describe('components/MDA/Lite/Reports/cddReport/supervisor', () => { it('renders correctly', async () => { const supersetServiceMock: any = jest.fn(); supersetServiceMock.mockImplementationOnce(async () => supervisorData); - supersetServiceMock.mockImplementationOnce(async () => wardsData); + supersetServiceMock.mockImplementationOnce(async () => MDALiteWardsData); const allProps = { ...props, service: supersetServiceMock, diff --git a/src/containers/pages/MDALite/map/index.tsx b/src/containers/pages/MDALite/map/index.tsx index 440aa3f2e0..7285a30e74 100644 --- a/src/containers/pages/MDALite/map/index.tsx +++ b/src/containers/pages/MDALite/map/index.tsx @@ -40,7 +40,7 @@ import supersetFetch from '../../../../services/superset'; import GenericJurisdictionsReducer, { fetchGenericJurisdictions, GenericJurisdiction, - getGenericJurisdictionByJurisdictionId, + getAllGenericJurisdictionByJurisdictionId, reducerName as genericJurisdictionsReducerName, } from '../../../../store/ducks/generic/jurisdictions'; import GenericPlansReducer, { @@ -280,7 +280,7 @@ const defaultProps: MDALiteMapProps = { }; MDALiteMapReport.defaultProps = defaultProps; -export { MDALiteMapReport as MDALiteWardsReport }; +export { MDALiteMapReport }; /** map dispatch to props */ const mapDispatchToProps = { @@ -305,12 +305,13 @@ const mapStateToProps = ( jurisdictionId, planId ); - const subcountyData: GenericJurisdiction[] = []; + let subcountyData: GenericJurisdiction[] = []; if (jurisdictionId) { defaultProps.slices.forEach((slice: string) => { - const jur = getGenericJurisdictionByJurisdictionId(state, slice, jurisdictionId); - if (jur && jur.plan_id === planId) { - subcountyData.push(jur); + const jurs = getAllGenericJurisdictionByJurisdictionId(state, slice, jurisdictionId); + if (jurs.length) { + const jursOfInterest = jurs.filter(jur => jur.plan_id === planId); + subcountyData = [...subcountyData, ...jursOfInterest]; } }); } diff --git a/src/containers/pages/MDALite/map/tests/__snapshots__/index.test.tsx.snap b/src/containers/pages/MDALite/map/tests/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..b4c9cf9d14 --- /dev/null +++ b/src/containers/pages/MDALite/map/tests/__snapshots__/index.test.tsx.snap @@ -0,0 +1,68 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`components/MDA/Lite/Reports/wards renders correctly: GisidaLite layers 1`] = ` +Array [ + "mda_lite_structures-fill-line", + "mda_lite_structures-fill", + "mda_lite_structures-symbol", +] +`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item href-1 1`] = ` + + Home + +`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item href-2 1`] = ` + + MDA Lite Reporting + +`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item href-3 1`] = ` + + MDA-Lite kenya 2021-01-08 + +`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item href-4 1`] = ` + + Kenya + +`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item href-5 1`] = ` + + Vihiga + +`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item href-6 1`] = `null`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item-1 1`] = `"Home"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item-2 1`] = `"MDA Lite Reporting"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item-3 1`] = `"MDA-Lite kenya 2021-01-08"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item-4 1`] = `"Kenya"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item-5 1`] = `"Vihiga"`; + +exports[`components/MDA/Lite/Reports/wards renders correctly: breadcrumb item-6 1`] = `"vihiga"`; diff --git a/src/containers/pages/MDALite/map/tests/index.test.tsx b/src/containers/pages/MDALite/map/tests/index.test.tsx new file mode 100644 index 0000000000..b5dcb1438e --- /dev/null +++ b/src/containers/pages/MDALite/map/tests/index.test.tsx @@ -0,0 +1,121 @@ +import reducerRegistry from '@onaio/redux-reducer-registry'; +import { mount, shallow } from 'enzyme'; +import toJson from 'enzyme-to-json'; +import flushPromises from 'flush-promises'; +import { createBrowserHistory } from 'history'; +import React from 'react'; +import { act } from 'react-dom/test-utils'; +import Helmet from 'react-helmet'; +import { Provider } from 'react-redux'; +import { Router } from 'react-router'; +import ConnectedMDALiteMapReport, { MDALiteMapReport } from '../'; +import { GisidaLiteProps } from '../../../../../components/GisidaLite'; +import { REPORT_MDA_LITE_PLAN_URL } from '../../../../../constants'; +import store from '../../../../../store'; +import GenericJurisdictionsReducer, { + reducerName as genericJurisdictionsReducerName, +} from '../../../../../store/ducks/generic/jurisdictions'; +import GenericPlansReducer, { + reducerName as genericPlanReducerName, +} from '../../../../../store/ducks/generic/plans'; +import genericStructuresReducer, { + reducerName as genericStructuresReducerName, +} from '../../../../../store/ducks/generic/structures'; +import { + MDALitePlans, + MDALiteWardGeojsonData, + MDALteJurisidtionsData, +} from '../../../../../store/ducks/superset/MDALite/tests/fixtures'; + +/** register the reducers */ +reducerRegistry.register(genericJurisdictionsReducerName, GenericJurisdictionsReducer); +reducerRegistry.register(genericPlanReducerName, GenericPlansReducer); +reducerRegistry.register(genericStructuresReducerName, genericStructuresReducer); + +jest.mock('../../../../../configs/env'); + +jest.mock('../../../../../components/GisidaLite', () => { + const MemoizedGisidaLiteMock = () =>
Mock component
; + return { + MemoizedGisidaLite: MemoizedGisidaLiteMock, + }; +}); + +const history = createBrowserHistory(); + +const mock: any = jest.fn(); +const planId = MDALiteWardGeojsonData[0].plan_id; +const jurisdictionId = MDALiteWardGeojsonData[0].jurisdiction_id; +const props = { + history, + location: mock, + match: { + isExact: true, + params: { + jurisdictionId, + planId, + }, + path: `${REPORT_MDA_LITE_PLAN_URL}/:planId/:jurisdictionId/map`, + url: `${REPORT_MDA_LITE_PLAN_URL}/${planId}/${jurisdictionId}/map`, + }, +}; + +describe('components/MDA/Lite/Reports/wards', () => { + beforeEach(() => { + jest.resetAllMocks(); + jest.restoreAllMocks(); + }); + + it('renders without crashing', async () => { + shallow( + + + + ); + }); + + it('renders correctly', async () => { + const supersetServiceMock: any = jest.fn(); + supersetServiceMock.mockImplementationOnce(async () => MDALiteWardGeojsonData); + supersetServiceMock.mockImplementationOnce(async () => MDALitePlans); + supersetServiceMock.mockImplementationOnce(async () => MDALteJurisidtionsData); + supersetServiceMock.mockImplementationOnce(async () => []); + const allProps = { + ...props, + service: supersetServiceMock, + }; + const wrapper = mount( + + + + + + ); + await act(async () => { + await flushPromises(); + }); + wrapper.update(); + + const helmet = Helmet.peek(); + expect(helmet.title).toEqual('MDA Lite Reporting: vihiga'); + expect(wrapper.find('HeaderBreadcrumb').length).toEqual(1); + wrapper.find('BreadcrumbItem li').forEach((item, i) => { + expect(item.text()).toMatchSnapshot(`breadcrumb item-${i + 1}`); + expect(toJson(item.find('a'))).toMatchSnapshot(`breadcrumb item href-${i + 1}`); + }); + expect(wrapper.find('.page-title').text()).toEqual('MDA Lite Reporting: vihiga'); + + const mapProps = wrapper.find('MemoizedGisidaLiteMock').props() as GisidaLiteProps; + // Check Gisida component map layers + expect((mapProps as any).layers.map((e: any) => e.key)).toMatchSnapshot('GisidaLite layers'); + expect(mapProps.zoom).toEqual(12); + expect(mapProps.mapCenter).toEqual([34.6768368460001, 0.0131305400000485]); + expect(mapProps.mapBounds).toEqual([ + 34.6264335430001, + -0.026151141999947, + 34.7272401490001, + 0.052412222000044, + ]); + wrapper.unmount(); + }); +}); diff --git a/src/containers/pages/MDALite/wardReports/index.tsx b/src/containers/pages/MDALite/wardReports/index.tsx index 6a346d8c50..ce802e546d 100644 --- a/src/containers/pages/MDALite/wardReports/index.tsx +++ b/src/containers/pages/MDALite/wardReports/index.tsx @@ -29,7 +29,7 @@ import supersetFetch from '../../../../services/superset'; import GenericJurisdictionsReducer, { fetchGenericJurisdictions, GenericJurisdiction, - getGenericJurisdictionByJurisdictionId, + getAllGenericJurisdictionByJurisdictionId, reducerName as genericJurisdictionsReducerName, } from '../../../../store/ducks/generic/jurisdictions'; import GenericPlansReducer, { @@ -260,12 +260,13 @@ const mapStateToProps = ( parent_id: jurisdictionId, plan_id: planId, }); - const subcountyData: GenericJurisdiction[] = []; + let subcountyData: GenericJurisdiction[] = []; if (jurisdictionId) { defaultProps.slices.forEach((slice: string) => { - const jur = getGenericJurisdictionByJurisdictionId(state, slice, jurisdictionId); - if (jur && jur.plan_id === planId) { - subcountyData.push(jur); + const jurs = getAllGenericJurisdictionByJurisdictionId(state, slice, jurisdictionId); + if (jurs.length) { + const jursOfInterest = jurs.filter(jur => jur.plan_id === planId); + subcountyData = [...subcountyData, ...jursOfInterest]; } }); } diff --git a/src/containers/pages/MDALite/wardReports/tests/index.test.tsx b/src/containers/pages/MDALite/wardReports/tests/index.test.tsx index d8af743491..a98c0bdf50 100644 --- a/src/containers/pages/MDALite/wardReports/tests/index.test.tsx +++ b/src/containers/pages/MDALite/wardReports/tests/index.test.tsx @@ -19,8 +19,8 @@ import GenericPlansReducer, { } from '../../../../../store/ducks/generic/plans'; import { MDALitePlans, + MDALiteWardsData, MDALteJurisidtionsData, - wardsData, } from '../../../../../store/ducks/superset/MDALite/tests/fixtures'; import wardsReducer, { reducerName as wardsReducerName, @@ -36,8 +36,8 @@ jest.mock('../../../../../configs/env'); const history = createBrowserHistory(); const mock: any = jest.fn(); -const planId = wardsData[0].plan_id; -const jurisdictionId = wardsData[0].parent_id; +const planId = MDALiteWardsData[0].plan_id; +const jurisdictionId = MDALiteWardsData[0].parent_id; const props = { history, location: mock, @@ -67,7 +67,7 @@ describe('components/MDA/Lite/Reports/wards', () => { it('renders correctly', async () => { const supersetServiceMock: any = jest.fn(); - supersetServiceMock.mockImplementationOnce(async () => wardsData); + supersetServiceMock.mockImplementationOnce(async () => MDALiteWardsData); supersetServiceMock.mockImplementationOnce(async () => MDALitePlans); supersetServiceMock.mockImplementationOnce(async () => MDALteJurisidtionsData); supersetServiceMock.mockImplementationOnce(async () => []); diff --git a/src/store/ducks/generic/jurisdictions.ts b/src/store/ducks/generic/jurisdictions.ts index f693fc45e5..a3c205fb9c 100644 --- a/src/store/ducks/generic/jurisdictions.ts +++ b/src/store/ducks/generic/jurisdictions.ts @@ -259,6 +259,22 @@ export function getGenericJurisdictionById( return get((state as any)[reducerName][reducerKey], id) || null; } +/** get all GenericJurisdiction with certain jurisdiction_id + * @param {Partial} state - the redux store + * @param {string} reducerKey - they reducer key + * @param {string} jurisdictionId - the GenericJurisdiction id + * @returns {GenericJurisdiction|null} a GenericJurisdiction object or null + */ +export function getAllGenericJurisdictionByJurisdictionId( + state: Partial, + reducerKey: string = 'GenericJurisdictionsById', + jurisdictionId: string +): GenericJurisdiction[] { + return values((state as any)[reducerName][reducerKey]).filter( + (e: GenericJurisdiction) => e.jurisdiction_id === jurisdictionId + ); +} + /** get one GenericJurisdiction using its jurisdiction_id * @param {Partial} state - the redux store * @param {string} reducerKey - they reducer key @@ -270,9 +286,8 @@ export function getGenericJurisdictionByJurisdictionId( reducerKey: string = 'GenericJurisdictionsById', jurisdictionId: string ): GenericJurisdiction | null { - return values((state as any)[reducerName][reducerKey]).filter( - (e: GenericJurisdiction) => e.jurisdiction_id === jurisdictionId - )[0]; + const allJurs = getAllGenericJurisdictionByJurisdictionId(state, reducerKey, jurisdictionId); + return allJurs.length ? allJurs[0] : null; } /** get an array of GenericJurisdiction objects diff --git a/src/store/ducks/superset/MDALite/tests/fixtures.ts b/src/store/ducks/superset/MDALite/tests/fixtures.ts index f4ad7ffee6..2ea692fece 100644 --- a/src/store/ducks/superset/MDALite/tests/fixtures.ts +++ b/src/store/ducks/superset/MDALite/tests/fixtures.ts @@ -1,6 +1,6 @@ // tslint:disable: object-literal-sort-keys import wardGeojsonDataJson from './wardsGeojson.json'; -export const wardGeojsonData = wardGeojsonDataJson; +export const MDALiteWardGeojsonData = wardGeojsonDataJson; export const MDALitePlans = [ { plan_id: '5e396185-6094-4817-9dd4-24bcbbc698b0', @@ -121,7 +121,7 @@ export const MDALteJurisidtionsData = [ }, ]; -export const wardsData = [ +export const MDALiteWardsData = [ { ward_name: 'lugaga', parent_id: '3c63f48e-bb86-42e5-b3ff-bc539fbf5295', diff --git a/src/store/ducks/superset/MDALite/tests/wards.test.ts b/src/store/ducks/superset/MDALite/tests/wards.test.ts index f3771c0284..308e484827 100644 --- a/src/store/ducks/superset/MDALite/tests/wards.test.ts +++ b/src/store/ducks/superset/MDALite/tests/wards.test.ts @@ -13,7 +13,7 @@ import reducer, { reducerName, removeMDALiteWards, } from '../wards'; -import { wardsData } from './fixtures'; +import { MDALiteWardsData } from './fixtures'; reducerRegistry.register(reducerName, reducer); @@ -35,37 +35,37 @@ describe('reducers/MDA-Lite/wards', () => { it('Fetches wards data correctly', () => { // action creators dispatch - store.dispatch(fetchMDALiteWards(wardsData as MDALiteWards[])); + store.dispatch(fetchMDALiteWards(MDALiteWardsData as MDALiteWards[])); expect(getMDALiteWardById(store.getState(), 'a4c3973d-5076-59ea-b2bd-08abbb71894a')).toEqual( - wardsData[0] + MDALiteWardsData[0] ); // RESELECT TESTS expect(getMDALiteWardsArrayByName()(store.getState(), { ward_name: 'mungoma' })).toEqual([ - wardsData[2], + MDALiteWardsData[2], ]); expect( getMDALiteWardsArrayByParentId()(store.getState(), { parent_id: '3c63f48e-bb86-42e5-b3ff-bc539fbf5295', }) - ).toEqual(wardsData); + ).toEqual(MDALiteWardsData); expect( getMDALiteWardsArrayByPlanId()(store.getState(), { plan_id: '6b485d4b-1043-40ed-ab8a-c64d24045ada', }) - ).toEqual([wardsData[1]]); + ).toEqual([MDALiteWardsData[1]]); expect( getMDALiteWardsArrayByWardId()(store.getState(), { base_entity_id: '9ec52632-7bfb-40f5-9ef7-8804627a65cb', }) - ).toEqual([wardsData[2]]); + ).toEqual([MDALiteWardsData[2]]); expect( makeMDALiteWardsSelector(store.getState(), { parent_id: '3c63f48e-bb86-42e5-b3ff-bc539fbf5295', }) - ).toEqual(wardsData); + ).toEqual(MDALiteWardsData); expect( makeMDALiteWardsSelector(store.getState(), { ward_name: 'onyx', @@ -76,7 +76,7 @@ describe('reducers/MDA-Lite/wards', () => { base_entity_id: '9ec52632-7bfb-40f5-9ef7-8804627a65cb', parent_id: '3c63f48e-bb86-42e5-b3ff-bc539fbf5295', }) - ).toEqual([wardsData[2]]); + ).toEqual([MDALiteWardsData[2]]); // reset store.dispatch(removeMDALiteWards()); From e2dadbad77039180c64679e33387c03066bccb36 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Thu, 8 Apr 2021 21:51:35 +0300 Subject: [PATCH 34/40] Add MDA Lite CDDs reducre test --- .../pages/MDALite/cddReports/cdds.tsx | 4 +- .../pages/MDALite/cddReports/helpers.tsx | 6 +- .../cddReports/tests/supervisors.test.tsx | 10 +- .../ducks/superset/MDALite/tests/cdd.test.ts | 91 +++++++++++++++++++ .../ducks/superset/MDALite/tests/fixtures.ts | 77 +++++++++++++++- .../MDALite/tests/supervisors.test.ts | 16 ++-- 6 files changed, 183 insertions(+), 21 deletions(-) create mode 100644 src/store/ducks/superset/MDALite/tests/cdd.test.ts diff --git a/src/containers/pages/MDALite/cddReports/cdds.tsx b/src/containers/pages/MDALite/cddReports/cdds.tsx index 75e7f3b18b..6338fa5cf8 100644 --- a/src/containers/pages/MDALite/cddReports/cdds.tsx +++ b/src/containers/pages/MDALite/cddReports/cdds.tsx @@ -79,7 +79,7 @@ const MDALiteCddReports = (props: MDALiteCddReportsProps & RouteComponentProps { const original: Dictionary = cell.row.original; - const url = `${REPORT_MDA_LITE_CDD_REPORT_URL}/${original.plan_id}/${original.base_entity_id}/${original.supervisor_name}`; + const url = `${REPORT_MDA_LITE_CDD_REPORT_URL}/${original.plan_id}/${original.base_entity_id}/${original.id}`; return {cell.value}; }, Header: 'Name', @@ -38,12 +38,12 @@ export const cddReportColumns = [ }, ...genderReportColumns, { - Header: 'Name', + Header: 'Days worked', accessor: 'days_worked', }, { Cell: (cell: Cell) => getIRSThresholdAdherenceIndicator(cell, indicatorThresholdsMDALite), - Header: 'Name', + Header: 'Avarange per day', accessor: 'avarage_per_day', }, ...drugDistributionColumns, diff --git a/src/containers/pages/MDALite/cddReports/tests/supervisors.test.tsx b/src/containers/pages/MDALite/cddReports/tests/supervisors.test.tsx index 312cd91180..214404f2cb 100644 --- a/src/containers/pages/MDALite/cddReports/tests/supervisors.test.tsx +++ b/src/containers/pages/MDALite/cddReports/tests/supervisors.test.tsx @@ -13,10 +13,6 @@ import store from '../../../../../store'; import supervisorReducer, { reducerName as supervisorReducerName, } from '../../../../../store/ducks/superset/MDALite/supervisors'; -import { - MDALiteWardsData, - supervisorData, -} from '../../../../../store/ducks/superset/MDALite/tests/fixtures'; import wardsReducer, { reducerName as wardsReducerName, } from '../../../../../store/ducks/superset/MDALite/wards'; @@ -31,8 +27,8 @@ jest.mock('../../../../../configs/env'); const history = createBrowserHistory(); const mock: any = jest.fn(); -const planId = supervisorData[0].plan_id; -const jurisdictionId = supervisorData[0].base_entity_id; +const planId = MDALiteSupervisorData[0].plan_id; +const jurisdictionId = MDALiteSupervisorData[0].base_entity_id; const props = { history, location: mock, @@ -62,7 +58,7 @@ describe('components/MDA/Lite/Reports/cddReport/supervisor', () => { it('renders correctly', async () => { const supersetServiceMock: any = jest.fn(); - supersetServiceMock.mockImplementationOnce(async () => supervisorData); + supersetServiceMock.mockImplementationOnce(async () => MDALiteSupervisorData); supersetServiceMock.mockImplementationOnce(async () => MDALiteWardsData); const allProps = { ...props, diff --git a/src/store/ducks/superset/MDALite/tests/cdd.test.ts b/src/store/ducks/superset/MDALite/tests/cdd.test.ts new file mode 100644 index 0000000000..f5e323e91e --- /dev/null +++ b/src/store/ducks/superset/MDALite/tests/cdd.test.ts @@ -0,0 +1,91 @@ +import reducerRegistry from '@onaio/redux-reducer-registry'; +import { FlushThunks } from 'redux-testkit'; +import store from '../../../../'; +import reducer, { + fetchMDALiteCDDs, + getMDALiteCDDById, + getMDALiteCDDsArrayByName, + getMDALiteCDDsArrayByPlanId, + getMDALiteCDDsArrayBySupervisorId, + getMDALiteCDDsArrayBySupervisorName, + getMDALiteCDDsArrayByWardId, + makeMDALiteCDDsArraySelector, + MDALiteCDDData, + reducerName, + removeMDALiteCDDs, +} from '../cdd'; +import { MDALiteCDDReportData } from './fixtures'; + +reducerRegistry.register(reducerName, reducer); + +const MDALiteCDDsArraySelector = makeMDALiteCDDsArraySelector(); +const defaultProps = {}; + +describe('reducers/MDA-Lite/wards', () => { + let flushThunks; + + beforeEach(() => { + flushThunks = FlushThunks.createMiddleware(); + jest.resetAllMocks(); + }); + + it('should have initial state', () => { + expect(MDALiteCDDsArraySelector(store.getState(), defaultProps)).toEqual([]); + expect(getMDALiteCDDById(store.getState(), 'test-id')).toEqual(null); + }); + + it('Fetches wards data correctly', () => { + // action creators dispatch + store.dispatch(fetchMDALiteCDDs(MDALiteCDDReportData as MDALiteCDDData[])); + + expect(getMDALiteCDDById(store.getState(), '2d5530cd-0008-5727-ac86-d658441ac750')).toEqual( + MDALiteCDDReportData[0] + ); + + // RESELECT TESTS + expect( + getMDALiteCDDsArrayByName()(store.getState(), { cdd_name: 'UHCDD1:UpperHillWard' }) + ).toEqual([MDALiteCDDReportData[0]]); + expect( + getMDALiteCDDsArrayBySupervisorName()(store.getState(), { + supervisor_name: 'UHS3:UpperHillWard', + }) + ).toEqual([MDALiteCDDReportData[0], MDALiteCDDReportData[1]]); + expect( + getMDALiteCDDsArrayBySupervisorId()(store.getState(), { + supervisor_id: 'a8c6bbda-4ce1-51fa-b68d-b525a3e4da86', + }) + ).toEqual([MDALiteCDDReportData[2]]); + expect( + getMDALiteCDDsArrayByPlanId()(store.getState(), { + plan_id: '23da5624-707a-5055-81e8-5a0e6800d7ef', + }) + ).toEqual([MDALiteCDDReportData[2]]); + expect( + getMDALiteCDDsArrayByWardId()(store.getState(), { + base_entity_id: '6cb96ec5-a89f-4eb6-bb5e-83692687095e', + }) + ).toEqual([MDALiteCDDReportData[2]]); + + expect( + MDALiteCDDsArraySelector(store.getState(), { + supervisor_id: 'a8c6bbda-4ce1-51fa-b68d-b525a3e4da86', + }) + ).toEqual([MDALiteCDDReportData[2]]); + expect( + MDALiteCDDsArraySelector(store.getState(), { + supervisor_name: 'onyx', + }) + ).toEqual([]); + expect( + MDALiteCDDsArraySelector(store.getState(), { + base_entity_id: '6cb96ec5-a89f-4eb6-bb5e-83692687095e', + plan_id: '23da5624-707a-5055-81e8-5a0e6800d7ef', + }) + ).toEqual([MDALiteCDDReportData[2]]); + + // reset + store.dispatch(removeMDALiteCDDs()); + expect(MDALiteCDDsArraySelector(store.getState(), defaultProps)).toEqual([]); + }); +}); diff --git a/src/store/ducks/superset/MDALite/tests/fixtures.ts b/src/store/ducks/superset/MDALite/tests/fixtures.ts index 2ea692fece..d7951fa691 100644 --- a/src/store/ducks/superset/MDALite/tests/fixtures.ts +++ b/src/store/ducks/superset/MDALite/tests/fixtures.ts @@ -194,7 +194,7 @@ export const MDALiteWardsData = [ }, ]; -export const supervisorData = [ +export const MDALiteSupervisorData = [ { supervisor_name: 'emuhayaSupervisor1:emuhaya Supervisor 1', base_entity_id: '9ec52632-7bfb-40f5-9ef7-8804627a65cb', @@ -262,3 +262,78 @@ export const supervisorData = [ plan_id: '28713d21-d4f9-49b7-aab7-b07838fb086f', }, ]; + +export const MDALiteCDDReportData = [ + { + id: '2d5530cd-0008-5727-ac86-d658441ac750', + supervisor_id: 'b26bbce2-75b0-5d5f-8e3d-4eec512f24d3', + supervisor_name: 'UHS3:UpperHillWard Supervisor 3', + plan_id: '5e396185-6094-4817-9dd4-24bcbbc698b0', + base_entity_id: '9ec52632-7bfb-40f5-9ef7-8804627a65cb', + cdd_name: 'UHCDD1:UpperHillWard CDD 1', + treated_male_1_4: 0, + treated_male_5_14: 0, + treated_male_above_15: 0, + treated_female_1_4: 0, + treated_female_5_14: 0, + treated_female_above_15: 0, + total_males: 0, + total_females: 0, + total_all_genders: 0, + supervisor_distributed: 2, + received_number: 0, + adminstered: 0, + damaged: 0, + adverse: 0, + remaining_with_cdd: 0, + returned_to_supervisor: 1, + }, + { + id: '19e416a4-7130-5213-8e0b-0884248cb326', + supervisor_id: 'b26bbce2-75b0-5d5f-8e3d-4eec512f24d3', + supervisor_name: 'UHS3:UpperHillWard Supervisor 3', + plan_id: '5e396185-6094-4817-9dd4-24bcbbc698b0', + base_entity_id: '9ec52632-7bfb-40f5-9ef7-8804627a65cb', + cdd_name: 'UH4CDD4:UpperHillWard CDD 4', + treated_male_1_4: 0, + treated_male_5_14: 23, + treated_male_above_15: 0, + treated_female_1_4: 0, + treated_female_5_14: 123, + treated_female_above_15: 67, + total_males: 23, + total_females: 190, + total_all_genders: 213, + supervisor_distributed: 0, + received_number: 0, + adminstered: 123, + damaged: 0, + adverse: 9, + remaining_with_cdd: -123, + returned_to_supervisor: 0, + }, + { + id: '23792003-f956-5956-9594-0dab04a403fa', + supervisor_id: 'a8c6bbda-4ce1-51fa-b68d-b525a3e4da86', + supervisor_name: 'UHS2:UpperHillWard Supervisor 2', + plan_id: '23da5624-707a-5055-81e8-5a0e6800d7ef', + base_entity_id: '6cb96ec5-a89f-4eb6-bb5e-83692687095e', + cdd_name: 'UH4CDD4:UpperHillWard CDD 4', + treated_male_1_4: 0, + treated_male_5_14: 3, + treated_male_above_15: 0, + treated_female_1_4: 0, + treated_female_5_14: 6, + treated_female_above_15: 8, + total_males: 3, + total_females: 14, + total_all_genders: 17, + supervisor_distributed: 0, + received_number: 0, + adminstered: 4, + damaged: 7, + adverse: 9, + remaining_with_cdd: -11, + returned_to_supervisor: 0, + }, +]; diff --git a/src/store/ducks/superset/MDALite/tests/supervisors.test.ts b/src/store/ducks/superset/MDALite/tests/supervisors.test.ts index be9dde54ce..961f938978 100644 --- a/src/store/ducks/superset/MDALite/tests/supervisors.test.ts +++ b/src/store/ducks/superset/MDALite/tests/supervisors.test.ts @@ -12,7 +12,7 @@ import reducer, { reducerName, removeMDALiteSupervisors, } from '../supervisors'; -import { supervisorData } from './fixtures'; +import { MDALiteSupervisorData } from './fixtures'; reducerRegistry.register(reducerName, reducer); @@ -33,34 +33,34 @@ describe('reducers/MDA-Lite/supervisors', () => { it('Fetches supervisor data correctly', () => { // action creators dispatch - store.dispatch(fetchMDALiteSupervisors(supervisorData as MDALiteSupervisor[])); + store.dispatch(fetchMDALiteSupervisors(MDALiteSupervisorData as MDALiteSupervisor[])); expect( getMDALiteSupervisorById(store.getState(), '13890722-db5d-53a6-a930-a9fb04c7bcc3') - ).toEqual(supervisorData[0]); + ).toEqual(MDALiteSupervisorData[0]); // RESELECT TESTS expect( getMDALiteSupervisorsArrayByName()(store.getState(), { supervisor_name: 'UHS3:UpperHillWard', }) - ).toEqual([supervisorData[1]]); + ).toEqual([MDALiteSupervisorData[1]]); expect( getMDALiteSupervisorsArrayByPlanId()(store.getState(), { plan_id: '5e396185-6094-4817-9dd4-24bcbbc698b0', }) - ).toEqual([supervisorData[0], supervisorData[1]]); + ).toEqual([MDALiteSupervisorData[0], MDALiteSupervisorData[1]]); expect( getMDALiteSupervisorsArrayByWardId()(store.getState(), { base_entity_id: '6cb96ec5-a89f-4eb6-bb5e-83692687095e', }) - ).toEqual([supervisorData[2]]); + ).toEqual([MDALiteSupervisorData[2]]); expect( MDALiteSupervisorsSelector(store.getState(), { plan_id: '28713d21-d4f9-49b7-aab7-b07838fb086f', }) - ).toEqual([supervisorData[2]]); + ).toEqual([MDALiteSupervisorData[2]]); expect( MDALiteSupervisorsSelector(store.getState(), { supervisor_name: 'onyx', @@ -71,7 +71,7 @@ describe('reducers/MDA-Lite/supervisors', () => { base_entity_id: '9ec52632-7bfb-40f5-9ef7-8804627a65cb', supervisor_name: 'UHS3:UpperHillWard', }) - ).toEqual([supervisorData[1]]); + ).toEqual([MDALiteSupervisorData[1]]); // reset store.dispatch(removeMDALiteSupervisors()); From b26f1f3ee9af9c24e2b3725dc84e41ae6a37d797 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Thu, 8 Apr 2021 22:18:14 +0300 Subject: [PATCH 35/40] Add MDA Lite CDDs report page test --- src/configs/__mocks__/env.ts | 1 + .../pages/MDALite/cddReports/cdds.tsx | 1 - .../tests/__snapshots__/cdds.test.tsx.snap | 95 ++++++++++++++ .../MDALite/cddReports/tests/cdds.test.tsx | 118 ++++++++++++++++++ .../cddReports/tests/supervisors.test.tsx | 8 +- 5 files changed, 220 insertions(+), 3 deletions(-) create mode 100644 src/containers/pages/MDALite/cddReports/tests/__snapshots__/cdds.test.tsx.snap create mode 100644 src/containers/pages/MDALite/cddReports/tests/cdds.test.tsx diff --git a/src/configs/__mocks__/env.ts b/src/configs/__mocks__/env.ts index 6576e9e3ed..d36dc2700f 100644 --- a/src/configs/__mocks__/env.ts +++ b/src/configs/__mocks__/env.ts @@ -233,4 +233,5 @@ export const SUPERSET_MDA_LITE_REPORTING_PLANS_SLICE = '1'; export const SUPERSET_MDA_LITE_REPORTING_SUPERVISORS_DATA_SLICE = '1'; export const SUPERSET_MDA_LITE_REPORTING_WARD_SLICE = '1'; export const SUPERSET_MDA_LITE_REPORTING_WARD_GEOJSON_SLICE = '1'; +export const SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE = '1'; export const SUPERSET_MDA_LITE_REPORTING_JURISDICTIONS_COLUMNS = 'mdaLiteJurisdictionsColumns'; diff --git a/src/containers/pages/MDALite/cddReports/cdds.tsx b/src/containers/pages/MDALite/cddReports/cdds.tsx index 6338fa5cf8..d914fb478d 100644 --- a/src/containers/pages/MDALite/cddReports/cdds.tsx +++ b/src/containers/pages/MDALite/cddReports/cdds.tsx @@ -33,7 +33,6 @@ import wardsReducer, { MDALiteWards, reducerName as wardsReducerName, } from '../../../../store/ducks/superset/MDALite/wards'; - import { cddReportColumns, getCddTableProps } from './helpers'; /** register the reducers */ diff --git a/src/containers/pages/MDALite/cddReports/tests/__snapshots__/cdds.test.tsx.snap b/src/containers/pages/MDALite/cddReports/tests/__snapshots__/cdds.test.tsx.snap new file mode 100644 index 0000000000..019a40dfcc --- /dev/null +++ b/src/containers/pages/MDALite/cddReports/tests/__snapshots__/cdds.test.tsx.snap @@ -0,0 +1,95 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: breadcrumb item href-1 1`] = ` + + ... + +`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: breadcrumb item href-2 1`] = ` + + mungoma + +`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: breadcrumb item href-3 1`] = `null`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: breadcrumb item-1 1`] = `"..."`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: breadcrumb item-2 1`] = `"mungoma"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: breadcrumb item-3 1`] = `"UHS3:UpperHillWard Supervisor 3"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-1 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-2 1`] = `"Male"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-3 1`] = `"Female"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-4 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-5 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-6 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-7 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-8 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-9 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-10 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-11 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-12 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-13 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-14 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-15 1`] = `" "`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-16 1`] = `"Name"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-17 1`] = `"1-4"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-18 1`] = `"5-14"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-19 1`] = `"15+"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-20 1`] = `"1-4"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-21 1`] = `"5-14"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-22 1`] = `"15+"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-23 1`] = `"Total Male"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-24 1`] = `"Total female"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-25 1`] = `"Total Treated"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-26 1`] = `"Days worked"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-27 1`] = `"Avarange per day"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-28 1`] = `"Supervisor Distributed"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-29 1`] = `"Received by CDD"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-30 1`] = `"Administered"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-31 1`] = `"Damaged"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-32 1`] = `"Remaining with CDD"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-33 1`] = `"Returned to Supervisor"`; + +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-34 1`] = `"Adverse Reaction"`; diff --git a/src/containers/pages/MDALite/cddReports/tests/cdds.test.tsx b/src/containers/pages/MDALite/cddReports/tests/cdds.test.tsx new file mode 100644 index 0000000000..472c1a2adf --- /dev/null +++ b/src/containers/pages/MDALite/cddReports/tests/cdds.test.tsx @@ -0,0 +1,118 @@ +import reducerRegistry from '@onaio/redux-reducer-registry'; +import { mount, shallow } from 'enzyme'; +import toJson from 'enzyme-to-json'; +import flushPromises from 'flush-promises'; +import { createBrowserHistory } from 'history'; +import React from 'react'; +import { act } from 'react-dom/test-utils'; +import Helmet from 'react-helmet'; +import { Provider } from 'react-redux'; +import { Router } from 'react-router'; +import { REPORT_MDA_LITE_CDD_REPORT_URL } from '../../../../../constants'; +import store from '../../../../../store'; +import cddReducer, { + reducerName as cddReducerName, +} from '../../../../../store/ducks/superset/MDALite/cdd'; +import { + MDALiteCDDReportData, + MDALiteWardsData, +} from '../../../../../store/ducks/superset/MDALite/tests/fixtures'; +import wardsReducer, { + reducerName as wardsReducerName, +} from '../../../../../store/ducks/superset/MDALite/wards'; +import ConnectedMDALiteCddReports, { MDALiteCddReports } from '../cdds'; + +/** register the reducers */ +reducerRegistry.register(cddReducerName, cddReducer); +reducerRegistry.register(wardsReducerName, wardsReducer); + +jest.mock('../../../../../configs/env'); + +const history = createBrowserHistory(); + +const mock: any = jest.fn(); +const planId = MDALiteCDDReportData[0].plan_id; +const jurisdictionId = MDALiteCDDReportData[0].base_entity_id; +const supervisorId = MDALiteCDDReportData[0].supervisor_id; +const props = { + history, + location: mock, + match: { + isExact: true, + params: { + jurisdictionId, + planId, + supervisorId, + }, + path: `${REPORT_MDA_LITE_CDD_REPORT_URL}/:planId/:jurisdictionId/:supervisorId`, + url: `${REPORT_MDA_LITE_CDD_REPORT_URL}/${planId}/${jurisdictionId}/${supervisorId}`, + }, +}; + +describe('components/MDA/Lite/Reports/cddReport/supervisor', () => { + beforeEach(() => { + jest.resetAllMocks(); + }); + + it('renders without crashing', async () => { + shallow( + + + + ); + }); + + it('renders correctly', async () => { + const supersetServiceMock: any = jest.fn(); + supersetServiceMock.mockImplementationOnce(async () => MDALiteCDDReportData); + supersetServiceMock.mockImplementationOnce(async () => MDALiteWardsData); + const allProps = { + ...props, + service: supersetServiceMock, + }; + const wrapper = mount( + + + + + + ); + await act(async () => { + await flushPromises(); + }); + wrapper.update(); + + const helmet = Helmet.peek(); + expect(helmet.title).toEqual('MDA Lite Reporting: UHS3:UpperHillWard Supervisor 3'); + expect(wrapper.find('HeaderBreadcrumb').length).toEqual(1); + wrapper.find('BreadcrumbItem li').forEach((item, i) => { + expect(item.text()).toMatchSnapshot(`breadcrumb item-${i + 1}`); + expect(toJson(item.find('a'))).toMatchSnapshot(`breadcrumb item href-${i + 1}`); + }); + expect(wrapper.find('.page-title').text()).toEqual( + 'MDA Lite Reporting: UHS3:UpperHillWard Supervisor 3' + ); + // table tests + expect(wrapper.find('DrillDownTable .thead .tr').length).toEqual(2); + wrapper + .find('.thead .tr .th') + .forEach((th, i) => expect(th.text()).toMatchSnapshot(`table headers-${i + 1}`)); + expect(wrapper.find('.no-data-cls').length).toMatchInlineSnapshot(`0`); + // // check data rendered + expect(wrapper.find('.tbody .tr').length).toEqual(2); + const row1 = wrapper.find('.tbody .tr').at(0); + const row2 = wrapper.find('.tbody .tr').at(1); + expect( + row1 + .find('.td') + .at(0) + .text() + ).toEqual('UHCDD1:UpperHillWard CDD 1'); + expect( + row2 + .find('.td') + .at(0) + .text() + ).toEqual('UH4CDD4:UpperHillWard CDD 4'); + }); +}); diff --git a/src/containers/pages/MDALite/cddReports/tests/supervisors.test.tsx b/src/containers/pages/MDALite/cddReports/tests/supervisors.test.tsx index 214404f2cb..9b079939e9 100644 --- a/src/containers/pages/MDALite/cddReports/tests/supervisors.test.tsx +++ b/src/containers/pages/MDALite/cddReports/tests/supervisors.test.tsx @@ -13,6 +13,10 @@ import store from '../../../../../store'; import supervisorReducer, { reducerName as supervisorReducerName, } from '../../../../../store/ducks/superset/MDALite/supervisors'; +import { + MDALiteSupervisorData, + MDALiteWardsData, +} from '../../../../../store/ducks/superset/MDALite/tests/fixtures'; import wardsReducer, { reducerName as wardsReducerName, } from '../../../../../store/ducks/superset/MDALite/wards'; @@ -113,7 +117,7 @@ describe('components/MDA/Lite/Reports/cddReport/supervisor', () => { .at(0) .prop('href') ).toEqual( - '/intervention/mda-lite/cdd/report/5e396185-6094-4817-9dd4-24bcbbc698b0/9ec52632-7bfb-40f5-9ef7-8804627a65cb/emuhayaSupervisor1:emuhaya Supervisor 1' + '/intervention/mda-lite/cdd/report/5e396185-6094-4817-9dd4-24bcbbc698b0/9ec52632-7bfb-40f5-9ef7-8804627a65cb/13890722-db5d-53a6-a930-a9fb04c7bcc3' ); expect( row2 @@ -121,7 +125,7 @@ describe('components/MDA/Lite/Reports/cddReport/supervisor', () => { .at(0) .prop('href') ).toEqual( - '/intervention/mda-lite/cdd/report/5e396185-6094-4817-9dd4-24bcbbc698b0/9ec52632-7bfb-40f5-9ef7-8804627a65cb/UHS3:UpperHillWard Supervisor 3' + '/intervention/mda-lite/cdd/report/5e396185-6094-4817-9dd4-24bcbbc698b0/9ec52632-7bfb-40f5-9ef7-8804627a65cb/b26bbce2-75b0-5d5f-8e3d-4eec512f24d3' ); }); }); From c814575e34a8ba01d75e86ac25fe3b509cff34a1 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Fri, 9 Apr 2021 09:48:15 +0300 Subject: [PATCH 36/40] Clean up --- docs/env.md | 2 +- src/configs/env.ts | 2 +- src/configs/settings.ts | 2 +- src/containers/pages/MDALite/jurisdictionsReport/index.tsx | 2 +- src/containers/pages/MDALite/map/index.tsx | 3 ++- src/containers/pages/MDALite/wardReports/index.tsx | 1 + 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/env.md b/docs/env.md index edbd640b8a..ebb520a920 100644 --- a/docs/env.md +++ b/docs/env.md @@ -143,7 +143,7 @@ Below is a list of currently supported environment variables: - **REACT_APP_SHOW_MAP_AT_JURISDICTION_LEVEL** - Jurisdiction level on which to show map - - Default vaule: 99 + - Default value: 99 - **Not Required** - **REACT_APP_SUPERSET_MDA_LITE_REPORTING_CDD_DATA_SLICE** diff --git a/src/configs/env.ts b/src/configs/env.ts index 6693762052..3ead2907ff 100644 --- a/src/configs/env.ts +++ b/src/configs/env.ts @@ -71,7 +71,7 @@ export type ENABLE_DYNAMIC_MDA = typeof ENABLE_DYNAMIC_MDA; export const ENABLE_SMC = process.env.REACT_APP_ENABLE_SMC === 'true'; export type ENABLE_SMC = typeof ENABLE_SMC; -/** Do you want to enable the SMC Point plan features? */ +/** Do you want to enable the MDA Lite plan features? */ export const ENABLE_MDA_LITE = process.env.REACT_APP_ENABLE_MDA_LITE === 'true'; export type ENABLE_MDA_LITE = typeof ENABLE_MDA_LITE; diff --git a/src/configs/settings.ts b/src/configs/settings.ts index cb4cec8ab3..68a8711a12 100644 --- a/src/configs/settings.ts +++ b/src/configs/settings.ts @@ -1935,7 +1935,7 @@ export const indicatorThresholdsMDALite: IndicatorThresholds = { value: 0.8, }, }; -/** END Focus Investigation Reporting Configs */ +/** END MDA Lite Reporting Configs */ /** Interface describing thresholds look up */ export interface IndicatorThresholdsLookUp { diff --git a/src/containers/pages/MDALite/jurisdictionsReport/index.tsx b/src/containers/pages/MDALite/jurisdictionsReport/index.tsx index 1b1697157c..0bc7cc0383 100644 --- a/src/containers/pages/MDALite/jurisdictionsReport/index.tsx +++ b/src/containers/pages/MDALite/jurisdictionsReport/index.tsx @@ -37,7 +37,7 @@ import '../../IRS/JurisdictionsReport/style.css'; /** register the reducers */ reducerRegistry.register(genericPlansReducerName, GenericPlansReducer); -/** Renders IRS Jurisdictions reports */ +/** Renders MDA Lite Jurisdictions reports */ const MdaLiteJurisdictionReport = ( props: GenericJurisdictionProps & RouteComponentProps ) => { diff --git a/src/containers/pages/MDALite/map/index.tsx b/src/containers/pages/MDALite/map/index.tsx index 7285a30e74..09e6a62676 100644 --- a/src/containers/pages/MDALite/map/index.tsx +++ b/src/containers/pages/MDALite/map/index.tsx @@ -76,6 +76,7 @@ interface MDALiteMapProps { wardData: StructureFeatureCollection | null; } +/** Component for displaying MDA lite ward map */ const MDALiteMapReport = (props: MDALiteMapProps & RouteComponentProps) => { const { wardData, @@ -210,7 +211,7 @@ const MDALiteMapReport = (props: MDALiteMapProps & RouteComponentProps ) => { From f2b2183db64097729defee4c28efbcaa01698b88 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Mon, 12 Apr 2021 19:41:01 +0300 Subject: [PATCH 37/40] Translate MDA Lite table headers --- src/configs/lang.ts | 31 ++++++++ .../GenericJurisdictionReport/helpers.ts | 70 ++++++++++++------- .../pages/MDALite/cddReports/helpers.tsx | 9 +-- .../tests/__snapshots__/cdds.test.tsx.snap | 4 +- .../tests/__snapshots__/index.test.tsx.snap | 2 +- 5 files changed, 85 insertions(+), 31 deletions(-) diff --git a/src/configs/lang.ts b/src/configs/lang.ts index c74caa29ac..1d3d5cfa94 100644 --- a/src/configs/lang.ts +++ b/src/configs/lang.ts @@ -1016,3 +1016,34 @@ export const LOWEST_JURISDICTION = translate( export const SUBCOUNTY_LABEL = translate('SUBCOUNTY_LABEL', 'Subcounty'); export const NOT_AVAILABLE_LABEL = translate('NOT_AVAILABLE_LABEL', 'Not Available'); + +export const MALE_LABEL = translate('MALE_LABEL', 'Male'); +export const FEMALE_LABEL = translate('FEMALE_LABEL', 'Female'); +export const TOTAL_MALE = translate('TOTAL_MALE', 'Total Male'); +export const TOTAL_FEMALE = translate('FEMALE_LABEL', 'Total Female'); +export const TOTAL_TREATED = translate('FEMALE_LABEL', 'Total Treated'); +export const SUPERVISOR_DISTRIBUTED = translate('SUPERVISOR_DISTRIBUTED', 'Supervisor Distributed'); +export const RECEIVED_BY_CDD = translate('RECEIVED_BY_CDD', 'Received by CDD'); +export const ADMINISTERED_LABEL = translate('ADMINISTERED_LABEL', 'Administered'); +export const DAMAGED_LABEL = translate('DAMAGED_LABEL', 'Damaged'); +export const REMAINING_WITH_CDD = translate('REMAINING_WITH_CDD', 'Remaining with CDD'); +export const RETURNED_TO_SUPERVISOR = translate('RETURNED_TO_SUPERVISOR', 'Returned to Supervisor'); +export const ADVERSE_REACTION = translate('ADVERSE_REACTION', 'Adverse Reaction'); +export const OFFICIAL_CENSUS_POP_TARGET = translate( + 'OFFICIAL_CENSUS_POP_TARGET', + 'Census Pop Target (Official)' +); +export const TREATMENT_COVERAGE_CENSUS = translate( + 'TREATMENT_COVERAGE_CENSUS', + 'Treatment Coverage (Census)' +); +export const OTHER_POP_TARGET = translate('OTHER_POP_TARGET', 'Other Pop Target (Unofficial)'); +export const OTHER_POP_COVERAGE = translate( + 'OTHER_POP_COVERAGE', + 'Other Pop Coverage (Unofficial)' +); +export const DAYS_WORKED = translate('DAYS_WORKED', 'Days worked'); +export const AVERAGE_PER_DAY = translate('AVERAGE_PER_DAYE', 'Average per day'); +export const ONE_TO_FOUR_YEARS = translate('ONE_TO_FOUR_YEARS', '1-4'); +export const FIVE_TO_FOURTEEN_YEARS = translate('FOUR_TO_FOURTEEN_YEARS', '5-14'); +export const FIFTEEN_YEARS_AND_ABOVE = translate('FIFTEEN_YEARS_AND_ABOVE', '15+'); diff --git a/src/containers/pages/GenericJurisdictionReport/helpers.ts b/src/containers/pages/GenericJurisdictionReport/helpers.ts index e5d0202e5b..4f8f5f8e2e 100644 --- a/src/containers/pages/GenericJurisdictionReport/helpers.ts +++ b/src/containers/pages/GenericJurisdictionReport/helpers.ts @@ -2,7 +2,29 @@ import { DrillDownColumn, DrillDownTableProps } from '@onaio/drill-down-table'; import { Dictionary } from '@onaio/utils'; import { get } from 'lodash'; import { Cell } from 'react-table'; -import { IRS_RED_THRESHOLD } from '../../../configs/lang'; +import { + ADMINISTERED_LABEL, + ADVERSE_REACTION, + DAMAGED_LABEL, + FEMALE_LABEL, + FIFTEEN_YEARS_AND_ABOVE, + FIVE_TO_FOURTEEN_YEARS, + IRS_RED_THRESHOLD, + MALE_LABEL, + NAME, + OFFICIAL_CENSUS_POP_TARGET, + ONE_TO_FOUR_YEARS, + OTHER_POP_COVERAGE, + OTHER_POP_TARGET, + RECEIVED_BY_CDD, + REMAINING_WITH_CDD, + RETURNED_TO_SUPERVISOR, + SUPERVISOR_DISTRIBUTED, + TOTAL_FEMALE, + TOTAL_MALE, + TOTAL_TREATED, + TREATMENT_COVERAGE_CENSUS, +} from '../../../configs/lang'; import { indicatorThresholdsMDALite } from '../../../configs/settings'; import { getIRSLiteThresholdAdherenceIndicator, @@ -410,22 +432,22 @@ export const smcJurisdictionsColumns = [ /** columns for mda Lite jurisdictions */ export const genderReportColumns = [ { - Header: 'Male', + Header: MALE_LABEL, columns: [ { - Header: '1-4', + Header: ONE_TO_FOUR_YEARS, accessor: 'treated_male_1_4', id: 'maleOneToFour', width: '100', }, { - Header: '5-14', + Header: FIVE_TO_FOURTEEN_YEARS, accessor: 'treated_male_5_14', id: 'maleOneToFourteen', width: '100', }, { - Header: '15+', + Header: FIFTEEN_YEARS_AND_ABOVE, accessor: 'treated_male_above_15', id: 'maleGreaterThanFifteen', width: '100', @@ -433,22 +455,22 @@ export const genderReportColumns = [ ], }, { - Header: 'Female', + Header: FEMALE_LABEL, columns: [ { - Header: '1-4', + Header: ONE_TO_FOUR_YEARS, accessor: 'treated_female_1_4', id: 'femaleOneToFour', width: '100', }, { - Header: '5-14', + Header: FIVE_TO_FOURTEEN_YEARS, accessor: 'treated_female_5_14', id: 'femaleOneToFourteen', width: '100', }, { - Header: '15+', + Header: FIFTEEN_YEARS_AND_ABOVE, accessor: 'treated_female_above_15', id: 'femaleGreaterThanFifteen', width: '100', @@ -457,73 +479,73 @@ export const genderReportColumns = [ }, { Cell: (cell: Cell) => MDALiteGenderComparison(cell, 'total_females', IRS_RED_THRESHOLD), - Header: 'Total Male', + Header: TOTAL_MALE, accessor: 'total_males', }, { Cell: (cell: Cell) => MDALiteGenderComparison(cell, 'total_males', IRS_RED_THRESHOLD), - Header: 'Total female', + Header: TOTAL_FEMALE, accessor: 'total_females', }, { - Header: 'Total Treated', + Header: TOTAL_TREATED, accessor: 'total_all_genders', }, ]; export const drugDistributionColumns = [ { - Header: 'Supervisor Distributed', + Header: SUPERVISOR_DISTRIBUTED, accessor: 'supervisor_distributed', }, { - Header: 'Received by CDD', + Header: RECEIVED_BY_CDD, accessor: 'received_number', }, { - Header: 'Administered', + Header: ADMINISTERED_LABEL, accessor: 'adminstered', }, { - Header: 'Damaged', + Header: DAMAGED_LABEL, accessor: 'damaged', }, { - Header: 'Remaining with CDD', + Header: REMAINING_WITH_CDD, accessor: 'remaining_with_cdd', }, { Cell: (cell: Cell) => returnedToSupervicerCol(cell, 'remaining_with_cdd', IRS_RED_THRESHOLD), - Header: 'Returned to Supervisor', + Header: RETURNED_TO_SUPERVISOR, accessor: 'returned_to_supervisor', }, { - Header: 'Adverse Reaction', + Header: ADVERSE_REACTION, accessor: 'adverse', }, ]; export const censusPopColumns = [ { - Header: 'Census Pop Target (Official)', + Header: OFFICIAL_CENSUS_POP_TARGET, accessor: 'official_population', }, { Cell: (cell: Cell) => getIRSThresholdAdherenceIndicator(cell, indicatorThresholdsMDALite), - Header: 'Treatment Coverage (Census)', + Header: TREATMENT_COVERAGE_CENSUS, accessor: 'treatment_coverage', }, { - Header: 'Other Pop Target (Unofficial)', + Header: OTHER_POP_TARGET, accessor: 'other_pop_target', }, { Cell: (cell: Cell) => getIRSThresholdAdherenceIndicator(cell, indicatorThresholdsMDALite), - Header: 'Other Pop Coverage (Unofficial)', + Header: OTHER_POP_COVERAGE, accessor: 'other_pop_coverage', }, ]; export const mdaLiteJurisdictionsColumns = [ { - Header: 'Name', + Header: NAME, accessor: 'jurisdiction_name', minWidth: 180, }, diff --git a/src/containers/pages/MDALite/cddReports/helpers.tsx b/src/containers/pages/MDALite/cddReports/helpers.tsx index 50897e7670..9c75b19e26 100644 --- a/src/containers/pages/MDALite/cddReports/helpers.tsx +++ b/src/containers/pages/MDALite/cddReports/helpers.tsx @@ -8,6 +8,7 @@ import { renderInFilterFactory, } from '../../../../components/Table/DrillDownFilters/utils'; import { NoDataComponent } from '../../../../components/Table/NoDataComponent'; +import { AVERAGE_PER_DAY, DAYS_WORKED, NAME } from '../../../../configs/lang'; import { indicatorThresholdsMDALite } from '../../../../configs/settings'; import { REPORT_MDA_LITE_CDD_REPORT_URL } from '../../../../constants'; import { getIRSThresholdAdherenceIndicator } from '../../../../helpers/indicators'; @@ -24,7 +25,7 @@ export const supervisorColumns = [ const url = `${REPORT_MDA_LITE_CDD_REPORT_URL}/${original.plan_id}/${original.base_entity_id}/${original.id}`; return {cell.value}; }, - Header: 'Name', + Header: NAME, accessor: 'supervisor_name', }, ...drugDistributionColumns, @@ -33,17 +34,17 @@ export const supervisorColumns = [ /** CDD columns */ export const cddReportColumns = [ { - Header: 'Name', + Header: NAME, accessor: 'cdd_name', }, ...genderReportColumns, { - Header: 'Days worked', + Header: DAYS_WORKED, accessor: 'days_worked', }, { Cell: (cell: Cell) => getIRSThresholdAdherenceIndicator(cell, indicatorThresholdsMDALite), - Header: 'Avarange per day', + Header: AVERAGE_PER_DAY, accessor: 'avarage_per_day', }, ...drugDistributionColumns, diff --git a/src/containers/pages/MDALite/cddReports/tests/__snapshots__/cdds.test.tsx.snap b/src/containers/pages/MDALite/cddReports/tests/__snapshots__/cdds.test.tsx.snap index 019a40dfcc..5095c3452a 100644 --- a/src/containers/pages/MDALite/cddReports/tests/__snapshots__/cdds.test.tsx.snap +++ b/src/containers/pages/MDALite/cddReports/tests/__snapshots__/cdds.test.tsx.snap @@ -72,13 +72,13 @@ exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: tab exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-23 1`] = `"Total Male"`; -exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-24 1`] = `"Total female"`; +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-24 1`] = `"Total Female"`; exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-25 1`] = `"Total Treated"`; exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-26 1`] = `"Days worked"`; -exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-27 1`] = `"Avarange per day"`; +exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-27 1`] = `"Average per day"`; exports[`components/MDA/Lite/Reports/cddReport/supervisor renders correctly: table headers-28 1`] = `"Supervisor Distributed"`; diff --git a/src/containers/pages/MDALite/wardReports/tests/__snapshots__/index.test.tsx.snap b/src/containers/pages/MDALite/wardReports/tests/__snapshots__/index.test.tsx.snap index dafd8399e8..6bf72f2cd0 100644 --- a/src/containers/pages/MDALite/wardReports/tests/__snapshots__/index.test.tsx.snap +++ b/src/containers/pages/MDALite/wardReports/tests/__snapshots__/index.test.tsx.snap @@ -95,7 +95,7 @@ exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-17 1 exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-18 1`] = `"Total Male"`; -exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-19 1`] = `"Total female"`; +exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-19 1`] = `"Total Female"`; exports[`components/MDA/Lite/Reports/wards renders correctly: table headers-20 1`] = `"Total Treated"`; From 5ba87560044167e4d31a7fc9278fac12b5e764f5 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Mon, 12 Apr 2021 20:16:37 +0300 Subject: [PATCH 38/40] Clean up: Update comments and remove unused code --- src/containers/pages/MDALite/cddReports/cdds.tsx | 13 +++++++------ .../pages/MDALite/cddReports/supervisors.tsx | 14 +++++++------- .../pages/MDALite/jurisdictionsReport/index.tsx | 6 +----- src/containers/pages/MDALite/map/index.tsx | 7 ++----- src/containers/pages/MDALite/plans/index.tsx | 6 +----- src/containers/pages/MDALite/wardReports/index.tsx | 7 +++---- 6 files changed, 21 insertions(+), 32 deletions(-) diff --git a/src/containers/pages/MDALite/cddReports/cdds.tsx b/src/containers/pages/MDALite/cddReports/cdds.tsx index d914fb478d..733f2350f1 100644 --- a/src/containers/pages/MDALite/cddReports/cdds.tsx +++ b/src/containers/pages/MDALite/cddReports/cdds.tsx @@ -1,7 +1,7 @@ import { DrillDownTable } from '@onaio/drill-down-table'; import reducerRegistry from '@onaio/redux-reducer-registry'; import superset, { SupersetAdhocFilterOption } from '@onaio/superset-connector'; -import React, { useEffect, useState } from 'react'; +import React, { Fragment, useEffect, useState } from 'react'; import Helmet from 'react-helmet'; import { connect } from 'react-redux'; import { RouteComponentProps } from 'react-router-dom'; @@ -111,6 +111,10 @@ const MDALiteCddReports = (props: MDALiteCddReportsProps & RouteComponentProps displayError(err)); }, [planId, jurisdictionId, supervisorId]); + if (loading) { + return ; + } + const currentPage = { label: supervisorName, url: `${REPORT_MDA_LITE_CDD_REPORT_URL}/${planId}/${jurisdictionId}/${supervisorId}`, @@ -135,11 +139,8 @@ const MDALiteCddReports = (props: MDALiteCddReportsProps & RouteComponentProps; - } return ( -
+ {currentTitle} @@ -153,7 +154,7 @@ const MDALiteCddReports = (props: MDALiteCddReportsProps & RouteComponentProps -
+ ); }; diff --git a/src/containers/pages/MDALite/cddReports/supervisors.tsx b/src/containers/pages/MDALite/cddReports/supervisors.tsx index e873b62394..d71fdd3190 100644 --- a/src/containers/pages/MDALite/cddReports/supervisors.tsx +++ b/src/containers/pages/MDALite/cddReports/supervisors.tsx @@ -1,7 +1,7 @@ import { DrillDownTable } from '@onaio/drill-down-table'; import reducerRegistry from '@onaio/redux-reducer-registry'; import superset, { SupersetAdhocFilterOption } from '@onaio/superset-connector'; -import React, { useEffect, useState } from 'react'; +import React, { Fragment, useEffect, useState } from 'react'; import Helmet from 'react-helmet'; import { connect } from 'react-redux'; import { RouteComponentProps } from 'react-router-dom'; @@ -104,6 +104,10 @@ const MDALiteSupervisorReports = ( loadData().catch(err => displayError(err)); }, [planId, jurisdictionId, supervisorId]); + if (loading) { + return ; + } + const currentPage = { label: wardName, url: '', @@ -123,12 +127,8 @@ const MDALiteSupervisorReports = ( // table props const tableProps = getCddTableProps(supervisorColumns, supervisorData, props); - - if (loading) { - return ; - } return ( -
+ {currentTitle} @@ -142,7 +142,7 @@ const MDALiteSupervisorReports = ( -
+ ); }; diff --git a/src/containers/pages/MDALite/jurisdictionsReport/index.tsx b/src/containers/pages/MDALite/jurisdictionsReport/index.tsx index 0bc7cc0383..87946dc55c 100644 --- a/src/containers/pages/MDALite/jurisdictionsReport/index.tsx +++ b/src/containers/pages/MDALite/jurisdictionsReport/index.tsx @@ -41,11 +41,7 @@ reducerRegistry.register(genericPlansReducerName, GenericPlansReducer); const MdaLiteJurisdictionReport = ( props: GenericJurisdictionProps & RouteComponentProps ) => { - return ( -
- -
- ); + return ; }; // change indicator rows component indicatorRows default prop diff --git a/src/containers/pages/MDALite/map/index.tsx b/src/containers/pages/MDALite/map/index.tsx index 09e6a62676..e6f6bb597d 100644 --- a/src/containers/pages/MDALite/map/index.tsx +++ b/src/containers/pages/MDALite/map/index.tsx @@ -62,8 +62,7 @@ reducerRegistry.register(genericJurisdictionsReducerName, GenericJurisdictionsRe reducerRegistry.register(genericPlanReducerName, GenericPlansReducer); reducerRegistry.register(genericStructuresReducerName, genericStructuresReducer); -/** selectors */ - +/** MDA Lite map props */ interface MDALiteMapProps { baseUrl: string; fetchJurisdictions: typeof fetchGenericJurisdictions; @@ -194,9 +193,7 @@ const MDALiteMapReport = (props: MDALiteMapProps & RouteComponentProps - [POLYGON].includes(feature.geometry.type) - ); + const polygons = wardData?.features.filter(feature => [POLYGON].includes(feature.geometry.type)); // get each polygon centroid const centroidPoints = polygons?.map(polygon => { diff --git a/src/containers/pages/MDALite/plans/index.tsx b/src/containers/pages/MDALite/plans/index.tsx index 05d9cb6cc0..8c75b220a5 100644 --- a/src/containers/pages/MDALite/plans/index.tsx +++ b/src/containers/pages/MDALite/plans/index.tsx @@ -31,11 +31,7 @@ const makeMDALitePlansArraySelector = makeGenericPlansArraySelector(); /** Simple component that loads a preview list of MDA plans */ const MDALitePlansList = (props: GenericPlanListProps & RouteComponentProps) => { - return ( -
- -
- ); + return ; }; /** Declare default props for MDALitePlansList */ diff --git a/src/containers/pages/MDALite/wardReports/index.tsx b/src/containers/pages/MDALite/wardReports/index.tsx index 6f7a3645dd..7fd7cbfb53 100644 --- a/src/containers/pages/MDALite/wardReports/index.tsx +++ b/src/containers/pages/MDALite/wardReports/index.tsx @@ -1,5 +1,5 @@ import reducerRegistry from '@onaio/redux-reducer-registry'; -import React, { useEffect, useState } from 'react'; +import React, { Fragment, useEffect, useState } from 'react'; import { RouteComponentProps } from 'react-router-dom'; import { DrillDownTable } from '@onaio/drill-down-table'; @@ -185,7 +185,6 @@ const MDALiteWardsReport = ( const tableProps = { columns: wardColumns, data: wardData || [], - // identifierField: 'id', paginate: true, renderInBottomFilterBar: renderInFilterFactory({ showColumnHider: false, @@ -205,7 +204,7 @@ const MDALiteWardsReport = ( }; return ( -
+ {pageTitle} @@ -218,7 +217,7 @@ const MDALiteWardsReport = (
-
+ ); }; From 3a8babec018fb3c63ea57358d6210e12ab868148 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Tue, 13 Apr 2021 09:54:53 +0300 Subject: [PATCH 39/40] Tests use equality assertions instead of snapshot --- .../tests/__snapshots__/index.test.tsx.snap | 103 ------------------ .../pages/MDALite/plans/tests/index.test.tsx | 10 +- 2 files changed, 6 insertions(+), 107 deletions(-) diff --git a/src/containers/pages/MDALite/plans/tests/__snapshots__/index.test.tsx.snap b/src/containers/pages/MDALite/plans/tests/__snapshots__/index.test.tsx.snap index e7d1f47a20..a0dc18eefc 100644 --- a/src/containers/pages/MDALite/plans/tests/__snapshots__/index.test.tsx.snap +++ b/src/containers/pages/MDALite/plans/tests/__snapshots__/index.test.tsx.snap @@ -1,108 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`components/MDALiteReports/MDALitePlansList handles search correctly: search results props 1`] = ` -Array [ - Object { - "jurisdiction_root_parent_ids": "[\\"bac41d87-b09d-4e76-be3b-3b6d07399891\\"]", - "plan_date": 1610064000000, - "plan_effective_period_end": 1640822400000, - "plan_effective_period_start": 1610064000000, - "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada", - "plan_intervention_type": "MDA-Lite", - "plan_name": "MDA-Lite-2021-01-08", - "plan_status": "active", - "plan_title": "MDA-Lite kenya 2021-01-08", - }, -] -`; - -exports[`components/MDALiteReports/MDALitePlansList renders plan definition list correctly: GenericPlansList props 1`] = ` -Object { - "fetchPlans": [Function], - "history": Object { - "action": "POP", - "block": [Function], - "createHref": [Function], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "length": 1, - "listen": [Function], - "location": Object { - "hash": "", - "pathname": "/", - "search": "", - "state": undefined, - }, - "push": [Function], - "replace": [Function], - }, - "location": Object { - "hash": "", - "pathname": "/intervention/mda-lite/report", - "search": "", - "state": undefined, - }, - "match": Object { - "isExact": true, - "params": Object {}, - "path": "/intervention/mda-lite/report/", - "url": "/intervention/mda-lite/report/", - }, - "pageTitle": "MDA Lite Plans", - "pageUrl": "/intervention/mda-lite/report", - "plans": Array [ - Object { - "jurisdiction_root_parent_ids": "[\\"bac41d87-b09d-4e76-be3b-3b6d07399891\\"]", - "plan_date": 1614643200000, - "plan_effective_period_end": 1616371200000, - "plan_effective_period_start": 1614643200000, - "plan_id": "5e396185-6094-4817-9dd4-24bcbbc698b0", - "plan_intervention_type": "MDA-Lite", - "plan_name": "MDA-Lite-2021-03-02", - "plan_status": "active", - "plan_title": "MDA-Lite 2021-03-02", - }, - Object { - "jurisdiction_root_parent_ids": "[\\"bac41d87-b09d-4e76-be3b-3b6d07399891\\"]", - "plan_date": 1610064000000, - "plan_effective_period_end": 1640822400000, - "plan_effective_period_start": 1610064000000, - "plan_id": "6b485d4b-1043-40ed-ab8a-c64d24045ada", - "plan_intervention_type": "MDA-Lite", - "plan_name": "MDA-Lite-2021-01-08", - "plan_status": "active", - "plan_title": "MDA-Lite kenya 2021-01-08", - }, - Object { - "jurisdiction_root_parent_ids": "[\\"bac41d87-b09d-4e76-be3b-3b6d07399891\\"]", - "plan_date": 1613520000000, - "plan_effective_period_end": 1615248000000, - "plan_effective_period_start": 1613520000000, - "plan_id": "bbaf9674-e381-45f1-94d1-23bd373bc88e", - "plan_intervention_type": "MDA-Lite", - "plan_name": "MDA-Lite-2021-02-17", - "plan_status": "active", - "plan_title": "MDA-Lite Em test3 2021-02-17", - }, - ], - "service": [MockFunction] { - "calls": Array [ - Array [ - "1", - ], - ], - "results": Array [ - Object { - "type": "return", - "value": Promise {}, - }, - ], - }, - "supersetReportingSlice": "1", -} -`; - exports[`components/MDALiteReports/MDALitePlansList renders plan definition list correctly: breadcrumb item-1 1`] = `"Home"`; exports[`components/MDALiteReports/MDALitePlansList renders plan definition list correctly: breadcrumb item-2 1`] = `"MDA Lite Plans"`; diff --git a/src/containers/pages/MDALite/plans/tests/index.test.tsx b/src/containers/pages/MDALite/plans/tests/index.test.tsx index a298284a45..bd996797ab 100644 --- a/src/containers/pages/MDALite/plans/tests/index.test.tsx +++ b/src/containers/pages/MDALite/plans/tests/index.test.tsx @@ -84,7 +84,11 @@ describe('components/MDALiteReports/MDALitePlansList', () => { ).toEqual('Customize Columns'); expect(wrapper.find('GenericPlansList').length).toBe(1); - expect(wrapper.find('GenericPlansList').props()).toMatchSnapshot('GenericPlansList props'); + const GenericPlansListProps = wrapper.find('GenericPlansList').props() as any; + expect(GenericPlansListProps.plans).toEqual(MDALitePlans); + expect(GenericPlansListProps.pageTitle).toEqual('MDA Lite Plans'); + expect(GenericPlansListProps.pageUrl).toEqual('/intervention/mda-lite/report'); + expect(GenericPlansListProps.supersetReportingSlice).toEqual('1'); expect(wrapper.find('.page-title').text()).toEqual('MDA Lite Plans'); @@ -109,8 +113,6 @@ describe('components/MDALiteReports/MDALitePlansList', () => { expect(wrapper.find('.tbody .tr').length).toEqual(1); expect(wrapper.find('.tbody .tr .td a').text()).toEqual('MDA-Lite kenya 2021-01-08'); - expect((wrapper.find('GenericPlansList').props() as any).plans).toMatchSnapshot( - 'search results props' - ); + expect((wrapper.find('GenericPlansList').props() as any).plans).toEqual([MDALitePlans[1]]); }); }); From bf55e0fa74b881cb5c01192e85644596b76d70f9 Mon Sep 17 00:00:00 2001 From: ciremusyoka Date: Tue, 13 Apr 2021 10:16:20 +0300 Subject: [PATCH 40/40] Translate missed string --- src/containers/pages/MDALite/wardReports/helpers.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/containers/pages/MDALite/wardReports/helpers.tsx b/src/containers/pages/MDALite/wardReports/helpers.tsx index 941312fada..2a34cdb8da 100644 --- a/src/containers/pages/MDALite/wardReports/helpers.tsx +++ b/src/containers/pages/MDALite/wardReports/helpers.tsx @@ -3,6 +3,7 @@ import { Dictionary } from '@onaio/utils'; import React from 'react'; import { Link } from 'react-router-dom'; import { Cell } from 'react-table'; +import { NAME } from '../../../../configs/lang'; import { REPORT_MDA_LITE_CDD_REPORT_URL } from '../../../../constants'; import { censusPopColumns, genderReportColumns } from '../../GenericJurisdictionReport/helpers'; @@ -14,7 +15,7 @@ export const wardColumns: Array> = [ const url = `${REPORT_MDA_LITE_CDD_REPORT_URL}/${original.plan_id}/${original.base_entity_id}`; return {cell.value}; }, - Header: 'Name', + Header: NAME, accessor: 'ward_name', }, ...genderReportColumns,