Skip to content

Commit

Permalink
Merge pull request #778 from opensrp/fhir-location-management
Browse files Browse the repository at this point in the history
Fhir location management
  • Loading branch information
peterMuriuki authored Feb 25, 2022
2 parents caf6b90 + e43d5a3 commit 53d455d
Show file tree
Hide file tree
Showing 59 changed files with 4,851 additions and 248 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:16.13.0
- image: cimg/node:16.14.0

environment:
SKIP_PREFLIGHT_CHECK: 'true'
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM alpine/git AS sources

RUN git clone --depth=1 --branch=v1.3.1 https://github.com/onaio/express-server.git /usr/src/express-server

FROM node:16.13.0-alpine as build
FROM node:16.14.0-alpine as build

COPY ./ /project

Expand All @@ -20,7 +20,7 @@ RUN chown -R node .
USER node
RUN yarn lerna:prepublish

FROM node:16.13.0-alpine as nodejsbuild
FROM node:16.14.0-alpine as nodejsbuild
COPY --from=sources /usr/src/express-server /usr/src/express-server

WORKDIR /usr/src/express-server
Expand All @@ -29,7 +29,7 @@ RUN yarn && yarn tsc && npm prune -production
# Remove unused dependencies
RUN rm -rf ./node_modules/typescript

FROM node:16.13.0-alpine as final
FROM node:16.14.0-alpine as final

# Use tini for NodeJS application https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#handling-kernel-signals
RUN apk add --no-cache tini curl
Expand Down
1 change: 1 addition & 0 deletions app/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ REACT_APP_DISABLE_TEAM_MEMBER_REASSIGNMENT=false
REACT_APP_USER_FORM_HIDDEN_FIELDS=""
REACT_APP_USER_FORM_RENDER_FIELDS=""
REACT_APP_PAGINATION_SIZE=1000
REACT_APP_ENABLE_FHIR_LOCATIONS=false
REACT_APP_ENABLE_SERVER_SETTINGS=false
REACT_APP_OPENSRP_WEB_VERSION=$npm_package_version
REACT_APP_SENTRY_CONFIG_JSON={"dsn":"https://public@sentry.example.com/1","release":"1.0.0","environment":"prod","tags":{"release-name":"web","commit":"012345"}}
3 changes: 2 additions & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@opensrp/ant-icons": "^0.0.1",
"@opensrp/card-support": "^0.0.9",
"@opensrp/error-boundary-fallback": "^0.0.7",
"@opensrp/fhir-location-management": "^0.0.1",
"@opensrp/form-config-antd": "^0.0.4",
"@opensrp/inventory": "^0.0.9",
"@opensrp/keycloak-service": "^0.0.17",
Expand All @@ -34,7 +35,7 @@
"@opensrp/server-logout": "^0.0.1",
"@opensrp/server-service": "^0.0.16",
"@opensrp/store": "^0.0.10",
"@opensrp/fhir-team-management": "file:../packages/fhir-team-management",
"@opensrp/fhir-team-management": "^0.0.5",
"@opensrp/team-assignment": "^0.0.6",
"@opensrp/team-management": "^0.0.9",
"@opensrp/user-management": "^0.1.19",
Expand Down
11 changes: 8 additions & 3 deletions app/src/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
DISABLE_LOGIN_PROTECTION,
OPENSRP_ROLES,
DEFAULT_HOME_MODE,
ENABLE_FHIR_LOCATIONS,
ENABLE_FHIR_TEAMS_MODULE,
} from '../configs/env';
import {
Expand Down Expand Up @@ -122,6 +123,10 @@ import {
NewLocationUnit,
EditLocationUnit,
} from '@opensrp/location-management';
import {
LocationUnitList as FHIRLocationUnitList,
NewEditLocationUnit as FHIRNewEditLocationUnit,
} from '@opensrp/fhir-location-management';
import {
BaseProps,
jsonValidatorListProps,
Expand Down Expand Up @@ -711,7 +716,7 @@ const App: React.FC = () => {
exact
path={URL_LOCATION_UNIT}
{...locationUnitProps}
component={LocationUnitList}
component={ENABLE_FHIR_LOCATIONS ? FHIRLocationUnitList : LocationUnitList}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
Expand All @@ -720,7 +725,7 @@ const App: React.FC = () => {
exact
path={URL_LOCATION_UNIT_ADD}
{...newLocationUnitProps}
component={NewLocationUnit}
component={ENABLE_FHIR_LOCATIONS ? FHIRNewEditLocationUnit : NewLocationUnit}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
Expand All @@ -729,7 +734,7 @@ const App: React.FC = () => {
exact
path={URL_LOCATION_UNIT_EDIT}
{...editLocationProps}
component={EditLocationUnit}
component={ENABLE_FHIR_LOCATIONS ? FHIRNewEditLocationUnit : EditLocationUnit}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
Expand Down
2 changes: 2 additions & 0 deletions app/src/App/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
USER_FORM_HIDDEN_FIELDS,
USER_FORM_RENDER_FIELDS,
PAGINATION_SIZE,
FHIR_ROOT_LOCATION_IDENTIFIER,
FHIR_RESOURCES_PAGE_SIZE,
} from '../configs/env';

Expand All @@ -49,6 +50,7 @@ export const teamManagementProps = {

export const locationUnitProps = {
filterByParentId: FILTER_BY_PARENT_ID,
fhirRootLocationIdentifier: FHIR_ROOT_LOCATION_IDENTIFIER,
};

export const newLocationUnitProps = {
Expand Down
6 changes: 6 additions & 0 deletions app/src/configs/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ export const SUPPORTED_LANGUAGES = setEnv('REACT_APP_SUPPORTED_LANGUAGES', '').s
export const ENABLE_LANGUAGE_SWITCHER =
setEnv('REACT_APP_ENABLE_LANGUAGE_SWITCHER', 'false') === 'true';

export const ENABLE_FHIR_LOCATIONS = setEnv('REACT_APP_ENABLE_FHIR_LOCATIONS', 'false') === 'true';

export const FILTER_BY_PARENT_ID = setEnv('REACT_APP_FILTER_BY_PARENT_ID', 'true') === 'true';

export const DEFAULT_HOME_MODE = setEnv('REACT_APP_DEFAULT_HOME_MODE', 'default');
Expand All @@ -192,6 +194,10 @@ export const PAGINATION_SIZE = Number(setEnv('REACT_APP_PAGINATION_SIZE', 1000))

export const DEFAULTS_TABLE_PAGE_SIZE = Number(setEnv('REACT_APP_DEFAULTS_TABLE_PAGE_SIZE', 5));

export const FHIR_ROOT_LOCATION_IDENTIFIER = setEnv(
'REACT_APP_FHIR_ROOT_LOCATION_IDENTIFIER',
''
);
export const FHIR_RESOURCES_PAGE_SIZE = Number(setEnv('REACT_APP_FHIR_RESOURCES_PAGE_SIZE', 500));

export const ENABLE_SERVER_SETTINGS = setEnv('REACT_APP_ENABLE_SERVER_SETTINGS', false) === 'true';
Expand Down
2 changes: 1 addition & 1 deletion app/src/lang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function lang(t: TFunction) {
INVENTORY: t(`Inventory`, { ns: namespace }),
SERVICE_POINT_INVENTORY: t(`Service point inventory`, { ns: namespace }),
ADD_INVENTORY_VIA_CSV: t(`Add inventory via CSV`, { ns: namespace }),
CARE_TEAM: t(`Care Team`, { ns: namespace }),
CARE_TEAM: t(`Care Teams Management`, { ns: namespace }),
};
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/locales/core/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Administration": "",
"An error occurred": "An error occurred",
"Card Support": "",
"Care Team": "",
"Care Teams Management": "",
"Complete": "Complete",
"Download Client Data": "",
"Draft": "Draft",
Expand Down
2 changes: 1 addition & 1 deletion app/src/locales/core/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Administration": "",
"An error occurred": "An error occurred",
"Card Support": "",
"Care Team": "",
"Care Teams Management": "",
"Complete": "Complete",
"Download Client Data": "",
"Draft": "Draft",
Expand Down
2 changes: 1 addition & 1 deletion app/src/locales/core/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Administration": "",
"An error occurred": "An error occurred",
"Card Support": "Card Support",
"Care Team": "",
"Care Teams Management": "",
"Complete": "Complete",
"Download Client Data": "Download Client Data",
"Draft": "Draft",
Expand Down
2 changes: 1 addition & 1 deletion app/src/locales/core/sw.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Administration": "",
"An error occurred": "An error occurred",
"Card Support": "",
"Care Team": "",
"Care Teams Management": "",
"Complete": "Complete",
"Download Client Data": "",
"Draft": "Draft",
Expand Down
2 changes: 1 addition & 1 deletion app/src/locales/core/th.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Administration": "",
"An error occurred": "",
"Card Support": "",
"Care Team": "",
"Care Teams Management": "",
"Complete": "",
"Download Client Data": "",
"Draft": "",
Expand Down
4 changes: 3 additions & 1 deletion docker/confd_env.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,7 @@ keys = [
"/react/app/enable/server/settings",
"/react/app/opensrp/api/v2/base/url",
"/react/app/opensrp/web/version",
"/react/app/opensrp/sentry/config/json"
"/react/app/opensrp/sentry/config/json",
"/react/app/enable/fhir/locations",
"react/app/fhir/root/location/identifier"
]
2 changes: 2 additions & 0 deletions docker/config.js.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,6 @@ window._env_ = {
REACT_APP_OPENSRP_API_V2_BASE_URL: "{{ getv "/react/app/opensrp/api/v2/base/url" "https://opensrp-stage.smartregister.org/opensrp/rest/v2/" }}",
REACT_APP_OPENSRP_WEB_VERSION: "{{ getv "/react/app/opensrp/web/version" "" }}"
REACT_APP_SENTRY_CONFIG_JSON: "{{ getv "/react/app/opensrp/sentry/config/json" ""}}"
REACT_APP_ENABLE_FHIR_LOCATIONS: "{{ getv "/react/app/enable/fhir/locations" "false" }}"
REACT_APP_FHIR_ROOT_LOCATION_IDENTIFIER: "{{ getv "react/app/fhir/root/location/identifier" ""}}"
};
13 changes: 12 additions & 1 deletion docs/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ Below is a list of currently supported environment variables:
- **optional**
- default: `''`

- **REACT_APP_ENABLE_FHIR_LOCATIONS**

- Enables FHIR location management module
- **Optional**(`boolean`)
- default: `"false"`

- **REACT_APP_ENABLE_FHIR_CARE_TEAM**

- Enables the FHIR Care Team module
Expand All @@ -238,7 +244,12 @@ Below is a list of currently supported environment variables:

- Default number of rows per table page
- default: 5
- `Enum: 5, 10, 20 , 50, 100
- `Enum: 5, 10, 20 , 50, 100`

- **REACT_APP_FHIR_ROOT_LOCATION_IDENTIFIER**

- FHIR Hierarchy root location UUID
- **Optional**_(`string`)_

- **REACT_APP_FHIR_RESOURCES_PAGE_SIZE**

Expand Down
5 changes: 1 addition & 4 deletions packages/error-boundary-fallback/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

**Note:** Version bump only for package @opensrp/error-boundary-fallback

## [0.0.6](https://github.com/OpenSRP/web/compare/@opensrp/error-boundary-fallback@0.0.5...@opensrp/error-boundary-fallback@0.0.6) (2021-06-30)

**Note:** Version bump only for package @opensrp/error-boundary-fallback

## 0.0.4 (2021-02-24)

**Note:** Version bump only for package @opensrp/error-boundary-fallback
Expand All @@ -22,3 +18,4 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
## 0.0.2 (2021-02-18)

**Note:** Version bump only for package @opensrp/error-boundary-fallback
`
8 changes: 8 additions & 0 deletions packages/fhir-location-management/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 0.0.1 (2020-10-28)

**Note:** Version bump only for package @opensrp/fhir-location-management
10 changes: 10 additions & 0 deletions packages/fhir-location-management/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# FHIR Location Management

This package contains a set of components for managing (create, edit, view, delete) locations on FHIR.

## Installation

```sh

yarn add @opensrp/fhir-location-management
```
69 changes: 69 additions & 0 deletions packages/fhir-location-management/locales/core/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"</> JSON": "",
"Actions": "",
"Active": "",
"Add Location Unit": "",
"Add Location Unit Group": "",
"Alias": "",
"An error occurred": "",
"Building": "",
"Cancel": "",
"Delete": "",
"Description": "",
"E.g. -16.08306": "",
"E.g. 49.54933": "",
"Edit": "",
"Edit Location Unit": "",
"Edit Location Unit Group": "",
"Enter a location group name": "",
"Enter a location name": "",
"External ID": "",
"External ID can only contain letters, numbers and spaces": "",
"Geometry": "",
"Id": "",
"Inactive": "",
"Instance": "",
"Jurisdiction": "",
"Latitude": "",
"Level": "",
"Location category": "",
"Location category is required": "",
"Location Name": "",
"Location Unit": "",
"Location Unit created successfully": "",
"Location Unit Group": "",
"Location Unit Group can only contain letters, numbers and spaces": "",
"Location Unit Group Management": "",
"Location Unit Management": "",
"Location Unit must be an array": "",
"Location Unit updated successfully": "",
"Location was successfully created": "",
"Location was successfully updated": "",
"Longitude": "",
"Name": "",
"Name can only contain letters, numbers and spaces": "",
"Name is required": "",
"Only decimal values allowed": "",
"Parent ID can only contain letters, numbers and spaces": "",
"Part Of": "",
"Physical Type": "",
"Save": "",
"Saving": "",
"Search": "",
"Select status": "",
"Select the parent location": "",
"Select the service point type": "",
"Select type": "",
"Service types is required": "",
"Status": "",
"Status is required": "",
"Sync status": "",
"Type": "",
"Type can only contain letters, numbers and spaces": "",
"Type is required": "",
"Unit group": "",
"username": "",
"Username": "",
"Version": "",
"View Details": ""
}
Loading

0 comments on commit 53d455d

Please sign in to comment.