├── app ├── public │ ├── config.js │ ├── logo.png │ ├── logob.png │ ├── favicon.ico │ ├── logo192.png │ ├── logo512.png │ ├── robots.txt │ ├── opensrp-32x32.png │ ├── manifest.json │ └── index.html ├── src │ ├── react-app-env.d.ts │ ├── assets │ │ └── images │ │ │ ├── logo.png │ │ │ ├── eusmLogo.png │ │ │ ├── fhir-web-logo.png │ │ │ ├── opensrp2-logo.png │ │ │ ├── opensrp-logo-color.png │ │ │ ├── opensrp2-logo-small.png │ │ │ └── opensrp-logo-color-40.png │ ├── components │ │ ├── page │ │ │ └── Header │ │ │ │ └── Header.css │ │ ├── NotFound │ │ │ ├── tests │ │ │ │ ├── __snapshots__ │ │ │ │ │ └── index.test.tsx.snap │ │ │ │ └── index.test.tsx │ │ │ └── index.tsx │ │ └── Logout │ │ │ └── tests │ │ │ └── __snapshots__ │ │ │ └── index.test.tsx.snap │ ├── configs │ │ ├── __mocks__ │ │ │ └── settings.ts │ │ ├── tests │ │ │ └── dispatchConfig.test.ts │ │ ├── utils.ts │ │ └── settings.ts │ ├── mls.ts │ ├── helpers │ │ └── testUtils.tsx │ ├── index.css │ ├── containers │ │ ├── pages │ │ │ └── Home │ │ │ │ └── Home.css │ │ ├── ConnectedSidebar │ │ │ └── index.tsx │ │ └── ConnectedHeader │ │ │ └── index.tsx │ └── App │ │ ├── App.tsx │ │ └── tests │ │ └── fixtures.tsx ├── i18next-parser.config.js └── tsconfig.json ├── packages ├── template │ ├── src │ │ └── index.tsx │ ├── tsconfig.json │ ├── CHANGELOG.md │ ├── package.json │ └── README.md ├── rbac │ ├── src │ │ ├── adapters │ │ │ └── index.d.ts │ │ ├── index.tsx │ │ ├── mls.ts │ │ └── helpers │ │ │ └── types.ts │ ├── tsconfig.json │ └── README.md ├── opensrp-notifications │ ├── src │ │ └── index.tsx │ ├── tsconfig.json │ ├── CHANGELOG.md │ ├── README.md │ └── package.json ├── i18n │ ├── src │ │ ├── index.tsx │ │ └── resources.ts │ ├── locales │ │ ├── core │ │ │ ├── fhir-quest-form │ │ │ │ ├── en.json │ │ │ │ └── fr.json │ │ │ ├── error-boundary-fallback │ │ │ │ ├── ar.json │ │ │ │ ├── en.json │ │ │ │ └── fr.json │ │ │ ├── react-utils │ │ │ │ ├── fr.json │ │ │ │ ├── vi.json │ │ │ │ └── en.json │ │ │ ├── fhir-resources │ │ │ │ ├── en.json │ │ │ │ └── fr.json │ │ │ ├── team-assignment │ │ │ │ ├── fr.json │ │ │ │ ├── ar.json │ │ │ │ ├── en.json │ │ │ │ └── vi.json │ │ │ ├── fhir-group-management │ │ │ │ └── fr.json │ │ │ ├── fhir-views │ │ │ │ ├── fr.json │ │ │ │ └── en.json │ │ │ ├── fhir-care-team │ │ │ │ ├── ar.json │ │ │ │ └── fr.json │ │ │ ├── fhir-flag │ │ │ │ └── en.json │ │ │ ├── team-management │ │ │ │ ├── fr.json │ │ │ │ ├── en.json │ │ │ │ ├── ar.json │ │ │ │ └── vi.json │ │ │ ├── app │ │ │ │ ├── en.json │ │ │ │ ├── vi.json │ │ │ │ └── fr.json │ │ │ ├── fhir-healthcare-service │ │ │ │ ├── fr.json │ │ │ │ └── en.json │ │ │ ├── fhir-keycloak-user-management │ │ │ │ └── fr.json │ │ │ ├── fhir-team-management │ │ │ │ └── fr.json │ │ │ └── fhir-location-management │ │ │ │ └── fr.json │ │ └── eusm │ │ │ ├── fhir-quest-form │ │ │ ├── en.json │ │ │ └── fr.json │ │ │ ├── error-boundary-fallback │ │ │ ├── ar.json │ │ │ ├── en.json │ │ │ └── fr.json │ │ │ ├── react-utils │ │ │ ├── ar.json │ │ │ ├── th.json │ │ │ ├── en.json │ │ │ └── fr.json │ │ │ ├── team-assignment │ │ │ ├── ar.json │ │ │ ├── vi.json │ │ │ ├── en.json │ │ │ └── fr.json │ │ │ ├── fhir-resources │ │ │ ├── en.json │ │ │ └── fr.json │ │ │ ├── fhir-views │ │ │ ├── en.json │ │ │ └── fr.json │ │ │ ├── fhir-care-team │ │ │ └── ar.json │ │ │ ├── fhir-flag │ │ │ └── en.json │ │ │ ├── team-management │ │ │ ├── ar.json │ │ │ ├── vi.json │ │ │ └── en.json │ │ │ └── keycloak-user-management │ │ │ └── ar.json │ ├── README.md │ └── tsconfig.json ├── react-utils │ ├── src │ │ ├── components │ │ │ ├── PageHeaders │ │ │ │ └── index.tsx │ │ │ ├── AsyncSelect │ │ │ │ ├── BaseAsyncSelect │ │ │ │ │ └── index.css │ │ │ │ └── index.tsx │ │ │ ├── fhirDataTypes │ │ │ │ ├── index.ts │ │ │ │ ├── Coding │ │ │ │ │ └── index.tsx │ │ │ │ └── CodeableConcept │ │ │ │ │ └── index.tsx │ │ │ ├── GenericDetailsView │ │ │ │ ├── index.tsx │ │ │ │ ├── TabsTable │ │ │ │ │ └── test │ │ │ │ │ │ └── __snapshots__ │ │ │ │ │ │ └── index.test.tsx.snap │ │ │ │ ├── TabsTitle │ │ │ │ │ ├── tests │ │ │ │ │ │ └── fixtures.tsx │ │ │ │ │ └── index.css │ │ │ │ ├── index.css │ │ │ │ └── ResourceItemLoader │ │ │ │ │ └── index.tsx │ │ │ ├── NoData │ │ │ │ ├── index.css │ │ │ │ └── tests │ │ │ │ │ └── index.test.tsx │ │ │ ├── BodyLayout │ │ │ │ └── index.tsx │ │ │ ├── Resource404 │ │ │ │ └── tests │ │ │ │ │ └── index.test.tsx │ │ │ ├── ButtonLink │ │ │ │ └── index.tsx │ │ │ └── UtilPageExtra │ │ │ │ └── tests │ │ │ │ └── index.test.tsx │ │ ├── mls.ts │ │ ├── constants.ts │ │ └── hooks │ │ │ └── tests │ │ │ └── __snapshots__ │ │ │ └── useServerSideActionDataGrid.test.tsx.snap │ └── tsconfig.json ├── error-boundary-fallback │ ├── src │ │ ├── index.tsx │ │ ├── mls.ts │ │ └── components │ │ │ └── ErrorBoundaryFallback │ │ │ └── index.tsx │ ├── tsconfig.json │ ├── README.md │ ├── CHANGELOG.md │ └── package.json ├── pkg-config │ ├── src │ │ ├── index.tsx │ │ └── constants.ts │ ├── README.md │ ├── tsconfig.json │ ├── CHANGELOG.md │ └── package.json ├── fhir-flag │ ├── src │ │ ├── index.tsx │ │ ├── mls.ts │ │ └── constants.tsx │ ├── README.md │ └── tsconfig.json ├── fhir-user-sync │ ├── src │ │ ├── index.tsx │ │ ├── mls.ts │ │ └── constants.ts │ └── tsconfig.json ├── opensrp-server-service │ ├── src │ │ ├── index.ts │ │ └── tests │ │ │ └── fixtures │ │ │ └── session.ts │ ├── tsconfig.json │ └── package.json ├── opensrp-store │ ├── src │ │ ├── index.tsx │ │ └── store │ │ │ └── tests │ │ │ └── ducks │ │ │ └── random.ts │ ├── tsconfig.json │ └── CHANGELOG.md ├── keycloak-service │ ├── src │ │ └── index.ts │ ├── tsconfig.json │ └── package.json ├── fhir-location-management │ ├── src │ │ ├── external.d.ts │ │ ├── components │ │ │ ├── AddEditLocationUnit │ │ │ │ ├── index.tsx │ │ │ │ ├── core.tsx │ │ │ │ └── tests │ │ │ │ │ └── __snapshots__ │ │ │ │ │ └── index.test.tsx.snap │ │ │ ├── AllLocationListFlat │ │ │ │ ├── index.tsx │ │ │ │ ├── base.css │ │ │ │ └── tests │ │ │ │ │ └── __snapshots__ │ │ │ │ │ ├── eusm.test.tsx.snap │ │ │ │ │ └── index.test.tsx.snap │ │ │ ├── LocationTree │ │ │ │ ├── tree.css │ │ │ │ └── tests │ │ │ │ │ └── __snapshots__ │ │ │ │ │ └── index.test.tsx.snap │ │ │ ├── ViewDetails │ │ │ │ ├── LocationDetails │ │ │ │ │ └── tests │ │ │ │ │ │ └── __snapshots__ │ │ │ │ │ │ └── index.test.tsx.snap │ │ │ │ └── tests │ │ │ │ │ └── __snapshots__ │ │ │ │ │ └── viewDetails.test.tsx.snap │ │ │ ├── LocationUnitList │ │ │ │ └── LocationUnitList.css │ │ │ ├── EditLink │ │ │ │ ├── tests │ │ │ │ │ └── fixtures.ts │ │ │ │ └── index.tsx │ │ │ └── RootLocationWizard │ │ │ │ └── tests │ │ │ │ └── fixtures.ts │ │ ├── cycle.d.ts │ │ ├── mls.ts │ │ ├── index.tsx │ │ └── ducks │ │ │ └── tests │ │ │ └── location-tree-state.test.ts │ ├── README.md │ ├── CHANGELOG.md │ └── tsconfig.json ├── fhir-views │ ├── src │ │ ├── QuestionnaireList │ │ │ └── index.css │ │ ├── index.tsx │ │ ├── constants.tsx │ │ └── mls.ts │ ├── tsconfig.json │ └── README.md ├── fhir-resources │ ├── src │ │ ├── index.tsx │ │ ├── mls.ts │ │ └── QuestionnaireResponse │ │ │ └── tests │ │ │ └── fixtures │ │ │ └── index.ts │ ├── tsconfig.json │ └── README.md ├── fhir-team-management │ ├── src │ │ ├── components │ │ │ ├── OrganizationList │ │ │ │ └── ViewDetails │ │ │ │ │ └── index.css │ │ │ └── AddEditOrganization │ │ │ │ └── tests │ │ │ │ └── __snapshots__ │ │ │ │ └── index.test.tsx.snap │ │ ├── index.tsx │ │ ├── mls.ts │ │ └── index.css │ ├── README.md │ └── tsconfig.json ├── fhir-care-team │ ├── src │ │ ├── index.tsx │ │ ├── components │ │ │ └── CreateEditCareTeam │ │ │ │ └── tests │ │ │ │ ├── utils.test.tsx │ │ │ │ └── __snapshots__ │ │ │ │ └── index.test.tsx.snap │ │ ├── mls.ts │ │ ├── index.css │ │ └── constants.tsx │ ├── README.md │ ├── CHANGELOG.md │ └── tsconfig.json ├── fhir-helpers │ ├── src │ │ ├── constants │ │ │ ├── extensions.ts │ │ │ ├── valueSetEnums.ts │ │ │ └── resourceTypes.ts │ │ ├── index.ts │ │ └── utils │ │ │ └── tests │ │ │ └── fixtures.ts │ ├── tsconfig.json │ ├── package.json │ └── README.md ├── fhir-healthcare-service │ ├── src │ │ ├── index.tsx │ │ ├── mls.ts │ │ ├── constants.tsx │ │ └── components │ │ │ └── HealthCareAddEdit │ │ │ └── tests │ │ │ └── __snapshots__ │ │ │ └── index.test.tsx.snap │ ├── README.md │ └── tsconfig.json ├── fhir-client │ ├── src │ │ ├── index.tsx │ │ ├── mls.ts │ │ ├── components │ │ │ └── PatientDetails │ │ │ │ ├── index.css │ │ │ │ ├── PopulatedTableTabs │ │ │ │ └── tests │ │ │ │ │ └── __snapshots__ │ │ │ │ │ └── index.test.tsx.snap │ │ │ │ └── ResourceSchema │ │ │ │ ├── MedicationStatement.tsx │ │ │ │ ├── DiagnosticReport.tsx │ │ │ │ ├── Practitioner.tsx │ │ │ │ ├── MedicationAdministration.tsx │ │ │ │ ├── Location.tsx │ │ │ │ └── ImmunizationRecommendation.tsx │ │ ├── constants.ts │ │ └── helpers │ │ │ └── testUtils.tsx │ ├── README.md │ └── tsconfig.json ├── fhir-import │ ├── src │ │ ├── index.tsx │ │ ├── mls.ts │ │ ├── components │ │ │ ├── tests │ │ │ │ └── statusTag.test.tsx │ │ │ └── statusTag.tsx │ │ ├── containers │ │ │ ├── StartImportView │ │ │ │ ├── form.css │ │ │ │ ├── tests │ │ │ │ │ ├── __snapshots__ │ │ │ │ │ │ ├── index.test.tsx.snap │ │ │ │ │ │ └── formInstruction.test.tsx.snap │ │ │ │ │ └── index.test.tsx │ │ │ │ └── index.tsx │ │ │ ├── ImportDetailView │ │ │ │ ├── tests │ │ │ │ │ └── __snapshots__ │ │ │ │ │ │ └── index.test.tsx.snap │ │ │ │ └── index.css │ │ │ └── ImportListView │ │ │ │ └── tests │ │ │ │ └── fixtures.tsx │ │ ├── helpers │ │ │ └── utils.tsx │ │ └── constants.ts │ ├── README.md │ └── tsconfig.json ├── fhir-group-management │ ├── CHANGELOG.md │ ├── README.md │ ├── src │ │ ├── index.tsx │ │ ├── types.ts │ │ ├── mls.ts │ │ ├── components │ │ │ ├── CommodityAddEdit │ │ │ │ ├── Default │ │ │ │ │ └── tests │ │ │ │ │ │ └── __snapshots__ │ │ │ │ │ │ └── index.test.tsx.snap │ │ │ │ ├── index.tsx │ │ │ │ └── Eusm │ │ │ │ │ └── tests │ │ │ │ │ └── __snapshots__ │ │ │ │ │ └── index.test.tsx.snap │ │ │ ├── CommodityList │ │ │ │ └── index.tsx │ │ │ ├── LocationInventory │ │ │ │ └── types.ts │ │ │ └── ProductForm │ │ │ │ └── types.ts │ │ └── helpers │ │ │ └── tests │ │ │ └── utils.test.ts │ └── tsconfig.json ├── opensrp-reducer-factory │ └── tsconfig.json ├── keycloak-user-management │ ├── src │ │ ├── components │ │ │ ├── CreateEditUserGroup │ │ │ │ ├── tests │ │ │ │ │ ├── __snapshots__ │ │ │ │ │ │ ├── Form.test.tsx.snap │ │ │ │ │ │ └── index.test.tsx.snap │ │ │ │ │ └── fixtures.ts │ │ │ │ └── form.css │ │ │ ├── UserList │ │ │ │ ├── TableActions │ │ │ │ │ └── tests │ │ │ │ │ │ └── fixtures.ts │ │ │ │ └── tests │ │ │ │ │ ├── __snapshots__ │ │ │ │ │ └── index.test.tsx.snap │ │ │ │ │ └── utils.test.tsx │ │ │ ├── UserGroupsList │ │ │ │ └── tests │ │ │ │ │ └── __snapshots__ │ │ │ │ │ └── index.test.tsx.snap │ │ │ └── UserRolesList │ │ │ │ └── utils.tsx │ │ ├── mls.ts │ │ └── index.tsx │ └── tsconfig.json ├── fhir-keycloak-user-management │ ├── src │ │ ├── index.tsx │ │ ├── mls.ts │ │ ├── components │ │ │ └── UserList │ │ │ │ ├── Viewdetails │ │ │ │ ├── index.css │ │ │ │ └── ViewDetailResources │ │ │ │ │ └── tests │ │ │ │ │ └── practitionerDetails.test.tsx │ │ │ │ └── ViewdetailsOverview │ │ │ │ └── index.css │ │ └── constants.ts │ └── tsconfig.json ├── server-logout │ ├── tsconfig.json │ └── package.json └── fhir-quest-form │ ├── tsconfig.json │ └── src │ └── mls.ts ├── jest-setup.ts ├── __mocks__ └── fileMock.js ├── .eslintignore ├── .yarnrc.yml ├── .husky └── pre-commit ├── docs ├── images │ ├── create-client.png │ ├── composite-role.png │ ├── user-list-start.png │ ├── 403-unauthorized.png │ ├── assign-role-group.png │ ├── clients-list-start.png │ ├── create-group-start.png │ ├── create-realm-form.png │ ├── create-realm-start.png │ ├── create-role-form.png │ ├── create-user-form.png │ ├── group-create-form.png │ ├── valid-redirect-uris.png │ └── create-client-capability.png └── publishing.md ├── .prettierrc ├── docker-compose.yml ├── lerna.json ├── public └── assets │ └── custom-login │ └── login │ └── resources │ └── img │ ├── hand.png │ ├── openSRP.png │ ├── keycloak-bg.png │ ├── keycloak-logo.png │ ├── feedback-error-sign.png │ ├── feedback-success-sign.png │ ├── feedback-warning-sign.png │ ├── feedback-error-arrow-down.png │ ├── feedback-success-arrow-down.png │ └── feedback-warning-arrow-down.png ├── .dockerignore ├── scripts ├── helm-envs-checker │ ├── package.json │ └── readme.md ├── i18n │ ├── package.json │ └── lib │ │ └── uploadMerged.js ├── .gitignore └── readme.md ├── .yarnrc ├── .github ├── codecov.yml ├── pull_request_template.md └── workflows │ └── docker-docs.yml ├── docker └── app.sh ├── babel.config.js ├── .gitignore ├── nx.json ├── tsconfig.json └── waypoint.hcl /app/public/config.js: -------------------------------------------------------------------------------- 1 | window._env_ = {}; 2 | -------------------------------------------------------------------------------- /packages/template/src/index.tsx: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /jest-setup.ts: -------------------------------------------------------------------------------- 1 | import '@testing-library/jest-dom'; 2 | -------------------------------------------------------------------------------- /packages/rbac/src/adapters/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /__mocks__/fileMock.js: -------------------------------------------------------------------------------- 1 | export default 'test-file-stub'; 2 | -------------------------------------------------------------------------------- /app/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /packages/opensrp-notifications/src/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './notifications'; 2 | -------------------------------------------------------------------------------- /app/public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/app/public/logo.png -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | node_modules/ 3 | build/ 4 | .eslintrc.js 5 | # testing 6 | coverage/ -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | 3 | yarnPath: .yarn/releases/yarn-3.6.1.cjs 4 | -------------------------------------------------------------------------------- /app/public/logob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/app/public/logob.png -------------------------------------------------------------------------------- /packages/i18n/src/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './init'; 2 | export * from 'react-i18next'; 3 | -------------------------------------------------------------------------------- /app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/app/public/favicon.ico -------------------------------------------------------------------------------- /app/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/app/public/logo192.png -------------------------------------------------------------------------------- /app/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/app/public/logo512.png -------------------------------------------------------------------------------- /packages/react-utils/src/components/PageHeaders/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './RichPageHeader'; 2 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | yarn lint-staged 5 | -------------------------------------------------------------------------------- /app/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /packages/error-boundary-fallback/src/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './components/ErrorBoundaryFallback'; 2 | -------------------------------------------------------------------------------- /packages/pkg-config/src/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './configStore'; 2 | export * from './constants'; 3 | -------------------------------------------------------------------------------- /app/public/opensrp-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/app/public/opensrp-32x32.png -------------------------------------------------------------------------------- /docs/images/create-client.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/docs/images/create-client.png -------------------------------------------------------------------------------- /app/src/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/app/src/assets/images/logo.png -------------------------------------------------------------------------------- /docs/images/composite-role.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/docs/images/composite-role.png -------------------------------------------------------------------------------- /docs/images/user-list-start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/docs/images/user-list-start.png -------------------------------------------------------------------------------- /packages/fhir-flag/src/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './components/BaseComponent'; 2 | export * from './constants'; 3 | -------------------------------------------------------------------------------- /packages/fhir-user-sync/src/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './components/UserSync'; 2 | export * from './constants'; 3 | -------------------------------------------------------------------------------- /packages/opensrp-server-service/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './serviceClass'; 2 | export * from './errors'; 3 | -------------------------------------------------------------------------------- /packages/opensrp-store/src/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './store/store'; 2 | export * from './store/selectors'; 3 | -------------------------------------------------------------------------------- /app/src/assets/images/eusmLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/app/src/assets/images/eusmLogo.png -------------------------------------------------------------------------------- /docs/images/403-unauthorized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/docs/images/403-unauthorized.png -------------------------------------------------------------------------------- /docs/images/assign-role-group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/docs/images/assign-role-group.png -------------------------------------------------------------------------------- /docs/images/clients-list-start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/docs/images/clients-list-start.png -------------------------------------------------------------------------------- /docs/images/create-group-start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/docs/images/create-group-start.png -------------------------------------------------------------------------------- /docs/images/create-realm-form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/docs/images/create-realm-form.png -------------------------------------------------------------------------------- /docs/images/create-realm-start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/docs/images/create-realm-start.png -------------------------------------------------------------------------------- /docs/images/create-role-form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/docs/images/create-role-form.png -------------------------------------------------------------------------------- /docs/images/create-user-form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/docs/images/create-user-form.png -------------------------------------------------------------------------------- /docs/images/group-create-form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/docs/images/group-create-form.png -------------------------------------------------------------------------------- /packages/react-utils/src/components/AsyncSelect/BaseAsyncSelect/index.css: -------------------------------------------------------------------------------- 1 | .asyncSelect{ 2 | min-width: 240px; 3 | } -------------------------------------------------------------------------------- /docs/images/valid-redirect-uris.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/docs/images/valid-redirect-uris.png -------------------------------------------------------------------------------- /packages/keycloak-service/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './service/serviceClass'; 2 | export * from './service/errors'; 3 | -------------------------------------------------------------------------------- /app/src/assets/images/fhir-web-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/app/src/assets/images/fhir-web-logo.png -------------------------------------------------------------------------------- /app/src/assets/images/opensrp2-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/app/src/assets/images/opensrp2-logo.png -------------------------------------------------------------------------------- /packages/react-utils/src/components/fhirDataTypes/index.ts: -------------------------------------------------------------------------------- 1 | export * from './CodeableConcept'; 2 | export * from './Coding'; 3 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "singleQuote": true, 4 | "trailingComma": "es5", 5 | "endOfLine":"auto" 6 | } -------------------------------------------------------------------------------- /docs/images/create-client-capability.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/docs/images/create-client-capability.png -------------------------------------------------------------------------------- /packages/fhir-location-management/src/external.d.ts: -------------------------------------------------------------------------------- 1 | declare module '@onaio/loaders' { 2 | export declare const Ripple; 3 | } 4 | -------------------------------------------------------------------------------- /app/src/assets/images/opensrp-logo-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/app/src/assets/images/opensrp-logo-color.png -------------------------------------------------------------------------------- /packages/fhir-location-management/src/components/AddEditLocationUnit/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './core'; 2 | export * from './eusm'; 3 | -------------------------------------------------------------------------------- /packages/fhir-location-management/src/components/AllLocationListFlat/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './core'; 2 | export * from './eusm'; 3 | -------------------------------------------------------------------------------- /app/src/assets/images/opensrp2-logo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/app/src/assets/images/opensrp2-logo-small.png -------------------------------------------------------------------------------- /app/src/components/page/Header/Header.css: -------------------------------------------------------------------------------- 1 | .layout-header { 2 | height: 50px !important; 3 | background-color: #141414 !important; 4 | } 5 | -------------------------------------------------------------------------------- /packages/fhir-views/src/QuestionnaireList/index.css: -------------------------------------------------------------------------------- 1 | .content-section.fhir-resource-container .ant-page-header{ 2 | padding-top: 24px; 3 | } -------------------------------------------------------------------------------- /app/src/assets/images/opensrp-logo-color-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/app/src/assets/images/opensrp-logo-color-40.png -------------------------------------------------------------------------------- /packages/fhir-resources/src/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './QuestionnaireResponse/questionResponse'; 2 | export * from './Questionnaire/Questionnaire'; 3 | -------------------------------------------------------------------------------- /packages/fhir-team-management/src/components/OrganizationList/ViewDetails/index.css: -------------------------------------------------------------------------------- 1 | .view-details-content .custom-spinner { 2 | min-height: unset; 3 | } 4 | -------------------------------------------------------------------------------- /packages/fhir-views/src/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './QuestionnaireList'; 2 | export * from './QuestionnaireResponseList'; 3 | export * from './constants'; 4 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | web: 3 | build: . 4 | ports: 5 | - "3000:3000" 6 | environment: 7 | - "API_URL=production.example.com" -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/lerna/schemas/lerna-schema.json", 3 | "version": "independent", 4 | "packages": ["packages/*", "app"] 5 | } 6 | -------------------------------------------------------------------------------- /public/assets/custom-login/login/resources/img/hand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/public/assets/custom-login/login/resources/img/hand.png -------------------------------------------------------------------------------- /packages/fhir-care-team/src/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './components/ListView'; 2 | export * from './components/CreateEditCareTeam'; 3 | export * from './constants'; 4 | -------------------------------------------------------------------------------- /public/assets/custom-login/login/resources/img/openSRP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/public/assets/custom-login/login/resources/img/openSRP.png -------------------------------------------------------------------------------- /packages/fhir-helpers/src/constants/extensions.ts: -------------------------------------------------------------------------------- 1 | export const locationGeometryExtensionUri = 2 | 'http://build.fhir.org/extension-location-boundary-geojson.html'; 3 | -------------------------------------------------------------------------------- /packages/fhir-location-management/src/components/LocationTree/tree.css: -------------------------------------------------------------------------------- 1 | span.searchValue { 2 | background-color: #1890ff; 3 | padding: 4px; 4 | color: white; 5 | } 6 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/fhir-quest-form/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "Cancel": "", 3 | "Questionnaire Response resource submitted successfully": "", 4 | "Submit": "" 5 | } 6 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/fhir-quest-form/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "Cancel": "", 3 | "Questionnaire Response resource submitted successfully": "", 4 | "Submit": "" 5 | } 6 | -------------------------------------------------------------------------------- /packages/rbac/src/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './helpers/utils'; 2 | export * from './components/hoc'; 3 | export * from './constants'; 4 | export * from './roleDefinition'; 5 | -------------------------------------------------------------------------------- /public/assets/custom-login/login/resources/img/keycloak-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/public/assets/custom-login/login/resources/img/keycloak-bg.png -------------------------------------------------------------------------------- /public/assets/custom-login/login/resources/img/keycloak-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/public/assets/custom-login/login/resources/img/keycloak-logo.png -------------------------------------------------------------------------------- /packages/fhir-healthcare-service/src/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './components/HealthCareAddEdit'; 2 | export * from './components/HealthCareList'; 3 | export * from './constants'; 4 | -------------------------------------------------------------------------------- /app/i18next-parser.config.js: -------------------------------------------------------------------------------- 1 | const configs = require('../i18next-parser.config'); 2 | 3 | module.exports = { 4 | ...configs, 5 | output: 'src/locales/core/$LOCALE.json', 6 | }; 7 | -------------------------------------------------------------------------------- /packages/fhir-client/src/index.tsx: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | export * from './components/PatientsList'; 3 | export * from './components/PatientDetails'; 4 | export * from './constants'; 5 | -------------------------------------------------------------------------------- /public/assets/custom-login/login/resources/img/feedback-error-sign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/public/assets/custom-login/login/resources/img/feedback-error-sign.png -------------------------------------------------------------------------------- /packages/pkg-config/README.md: -------------------------------------------------------------------------------- 1 | # pkg-config 2 | 3 | Redux module to store configuration for packages 4 | 5 | ## Installation 6 | 7 | ```sh 8 | yarn add @opensrp/pkg-config 9 | ``` 10 | -------------------------------------------------------------------------------- /public/assets/custom-login/login/resources/img/feedback-success-sign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/public/assets/custom-login/login/resources/img/feedback-success-sign.png -------------------------------------------------------------------------------- /public/assets/custom-login/login/resources/img/feedback-warning-sign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/public/assets/custom-login/login/resources/img/feedback-warning-sign.png -------------------------------------------------------------------------------- /public/assets/custom-login/login/resources/img/feedback-error-arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/public/assets/custom-login/login/resources/img/feedback-error-arrow-down.png -------------------------------------------------------------------------------- /packages/fhir-user-sync/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist", 5 | "rootDir": "./src" 6 | }, 7 | "include": ["src"] 8 | } 9 | -------------------------------------------------------------------------------- /public/assets/custom-login/login/resources/img/feedback-success-arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/public/assets/custom-login/login/resources/img/feedback-success-arrow-down.png -------------------------------------------------------------------------------- /public/assets/custom-login/login/resources/img/feedback-warning-arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onaio/fhir-web/HEAD/public/assets/custom-login/login/resources/img/feedback-warning-arrow-down.png -------------------------------------------------------------------------------- /app/src/configs/__mocks__/settings.ts: -------------------------------------------------------------------------------- 1 | export const COMPOSITE_ENABLE_USER_MANAGEMENT = true; 2 | export const COMPOSITE_ENABLE_TEAM_MANAGEMENT = true; 3 | export const COMPOSITE_ENABLE_LOCATIONS_MANAGEMENT = true; 4 | -------------------------------------------------------------------------------- /packages/fhir-client/README.md: -------------------------------------------------------------------------------- 1 | # Fhir Clients 2 | 3 | Container views that help see and manage fhir client resources. 4 | 5 | ## Installation 6 | 7 | ```sh 8 | yarn add @opensrp/fhir-client 9 | ``` 10 | -------------------------------------------------------------------------------- /packages/fhir-import/src/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './containers/ImportListView'; 2 | export * from './constants'; 3 | export * from './containers/StartImportView'; 4 | export * from './containers/ImportDetailView'; 5 | -------------------------------------------------------------------------------- /packages/i18n/README.md: -------------------------------------------------------------------------------- 1 | # I18n 2 | 3 | package that adds support for localization to opensrp web's applications and packages. 4 | 5 | ## Installation 6 | 7 | ```sh 8 | yarn add @opensrp/i18n 9 | ``` 10 | -------------------------------------------------------------------------------- /packages/opensrp-server-service/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declarationDir": "dist/types" 6 | }, 7 | "include": ["src"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/fhir-group-management/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | -------------------------------------------------------------------------------- /packages/fhir-location-management/src/components/AllLocationListFlat/base.css: -------------------------------------------------------------------------------- 1 | #all-locations .search-input-wrapper { 2 | width: 45%; 3 | min-width: 192px; 4 | } 5 | 6 | .filter-row { 7 | margin-bottom: 16px; 8 | } 9 | -------------------------------------------------------------------------------- /packages/opensrp-reducer-factory/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declarationDir": "dist/types" 6 | }, 7 | "include": ["src"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/fhir-flag/README.md: -------------------------------------------------------------------------------- 1 | # Fhir Flag 2 | 3 | 4 | 5 | Views that help update and manage fhir flag resources. 6 | 7 | ## Installation 8 | 9 | ```sh 10 | yarn add @opensrp/fhir-flag 11 | ``` 12 | -------------------------------------------------------------------------------- /packages/fhir-user-sync/src/mls.ts: -------------------------------------------------------------------------------- 1 | import { useTranslation as useOrigTranslation } from '@opensrp/i18n'; 2 | 3 | export const namespace = 'fhir-user-sync'; 4 | 5 | export const useTranslation = () => useOrigTranslation(namespace); 6 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/fhir-quest-form/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "Cancel": "Cancel", 3 | "Questionnaire Response resource submitted successfully": "Questionnaire Response resource submitted successfully", 4 | "Submit": "Submit" 5 | } 6 | -------------------------------------------------------------------------------- /packages/fhir-care-team/src/components/CreateEditCareTeam/tests/utils.test.tsx: -------------------------------------------------------------------------------- 1 | import { getPatientName } from '../utils'; 2 | 3 | test('getPatientName works for undefined input', () => { 4 | expect(getPatientName()).toEqual(''); 5 | }); 6 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/fhir-quest-form/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "Cancel": "Annuler", 3 | "Questionnaire Response resource submitted successfully": "La ressource Réponse au questionnaire a été envoyée avec succès", 4 | "Submit": "Soumettre" 5 | } 6 | -------------------------------------------------------------------------------- /packages/fhir-helpers/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './constants/codeSystems'; 2 | export * from './constants/extensions'; 3 | export * from './constants/valueSetEnums'; 4 | export * from './constants/resourceTypes'; 5 | export * from './utils/utils'; 6 | -------------------------------------------------------------------------------- /packages/fhir-import/README.md: -------------------------------------------------------------------------------- 1 | # Package 2 | 3 | 4 | Contains view modules that allow a user to perform data import actions 5 | 6 | ## Installation 7 | 8 | ```sh 9 | yarn add @opensrp/fhir-import 10 | ``` 11 | -------------------------------------------------------------------------------- /packages/fhir-team-management/README.md: -------------------------------------------------------------------------------- 1 | # Team Management 2 | 3 | This package has components for creating, editing, viewing or deleting a team. 4 | 5 | ## Installation 6 | 7 | ```sh 8 | 9 | yarn add @opensrp/fhir-team-management 10 | ``` 11 | -------------------------------------------------------------------------------- /packages/fhir-group-management/README.md: -------------------------------------------------------------------------------- 1 | # Group Management 2 | 3 | This package has components for creating, editing, viewing or deleting a group. 4 | 5 | ## Installation 6 | 7 | ```sh 8 | 9 | yarn add @opensrp/fhir-group-management 10 | ``` 11 | -------------------------------------------------------------------------------- /packages/fhir-healthcare-service/README.md: -------------------------------------------------------------------------------- 1 | # Team Management 2 | 3 | This package has components for creating, editing, viewing or deleting a team. 4 | 5 | ## Installation 6 | 7 | ```sh 8 | 9 | yarn add @opensrp/fhir-health-care-service 10 | ``` 11 | -------------------------------------------------------------------------------- /packages/keycloak-user-management/src/components/CreateEditUserGroup/tests/__snapshots__/Form.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`components/forms/UserFroupForm renders correctly 1`] = `"New User GroupNameSaveCancel"`; 4 | -------------------------------------------------------------------------------- /packages/react-utils/src/components/AsyncSelect/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './BaseAsyncSelect'; 2 | export * from './PaginatedAsyncSelect'; 3 | export * from './ValueSetAsyncSelect'; 4 | export * from './ClientSideActionsSelect'; 5 | export * from './utils'; 6 | -------------------------------------------------------------------------------- /packages/fhir-care-team/README.md: -------------------------------------------------------------------------------- 1 | # FHIR Care Team Management 2 | 3 | This package has components for creating, editing, vieing or deleting an FHIR Care Team. 4 | 5 | ## Installation 6 | 7 | ```sh 8 | 9 | yarn add @opensrp/fhir-care-team 10 | ``` 11 | -------------------------------------------------------------------------------- /packages/keycloak-user-management/src/components/CreateEditUserGroup/form.css: -------------------------------------------------------------------------------- 1 | /* overrides overrides from @helsenorge styles */ 2 | .user-group .ant-checkbox-input { 3 | clip: unset !important; 4 | width: 100% !important; 5 | height: 100% !important; 6 | } 7 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/error-boundary-fallback/ar.json: -------------------------------------------------------------------------------- 1 | { 2 | "An Error Occurred": "", 3 | "Back Home": "", 4 | "There has been an error. It’s been reported to the site administrators via email and should be fixed shortly. Thanks for your patience.": "" 5 | } 6 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/error-boundary-fallback/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "An Error Occurred": "", 3 | "Back Home": "", 4 | "There has been an error. It’s been reported to the site administrators via email and should be fixed shortly. Thanks for your patience.": "" 5 | } 6 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/error-boundary-fallback/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "An Error Occurred": "", 3 | "Back Home": "", 4 | "There has been an error. It’s been reported to the site administrators via email and should be fixed shortly. Thanks for your patience.": "" 5 | } 6 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/error-boundary-fallback/ar.json: -------------------------------------------------------------------------------- 1 | { 2 | "An Error Occurred": "", 3 | "Back Home": "", 4 | "There has been an error. It’s been reported to the site administrators via email and should be fixed shortly. Thanks for your patience.": "" 5 | } 6 | -------------------------------------------------------------------------------- /app/src/components/NotFound/tests/__snapshots__/index.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`components/NotFount renders the NotFount component 1`] = ` 4 | 5 |
6 | 404! 7 |
8 |
9 | `; 10 | -------------------------------------------------------------------------------- /packages/fhir-team-management/src/index.tsx: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | export * from './components/AddEditOrganization'; 3 | export * from './components/OrganizationList/ListView'; 4 | export * from './components/OrganizationAffiliation'; 5 | export * from './constants'; 6 | -------------------------------------------------------------------------------- /app/src/components/NotFound/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { useTranslation } from '../../mls'; 3 | 4 | const NotFound: React.FC = () => { 5 | const { t } = useTranslation(); 6 | return
{t('404!')}
; 7 | }; 8 | 9 | export default NotFound; 10 | -------------------------------------------------------------------------------- /packages/fhir-location-management/src/cycle.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'cycle' { 2 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 3 | interface Dictionary { 4 | [key: string]: T; 5 | } 6 | 7 | export declare function decycle(obj: Dictionary): object; 8 | } 9 | -------------------------------------------------------------------------------- /packages/react-utils/src/components/GenericDetailsView/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './ResourceDetails'; 2 | export * from './TabsView'; 3 | export * from './TabsTable'; 4 | export * from './PopulatedResourceDetails'; 5 | export * from './TabsTitle'; 6 | export * from './ResourceItemLoader'; 7 | -------------------------------------------------------------------------------- /packages/fhir-location-management/README.md: -------------------------------------------------------------------------------- 1 | # FHIR Location Management 2 | 3 | This package contains a set of components for managing (create, edit, view, delete) locations on FHIR. 4 | 5 | ## Installation 6 | 7 | ```sh 8 | 9 | yarn add @opensrp/fhir-location-management 10 | ``` 11 | -------------------------------------------------------------------------------- /packages/fhir-group-management/src/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './components/GroupList'; 2 | export * from './components/CommodityAddEdit'; 3 | export * from './components/CommodityList/'; 4 | export * from './components/LocationInventory'; 5 | export * from './types'; 6 | export * from './constants'; 7 | -------------------------------------------------------------------------------- /packages/fhir-keycloak-user-management/src/index.tsx: -------------------------------------------------------------------------------- 1 | import { UserDetails as UserDetailsV2 } from './components/UserList/Viewdetails'; 2 | export * from './components/CreateEditUser'; 3 | export * from './components/UserList/ListView'; 4 | export * from './constants'; 5 | export { UserDetailsV2 }; 6 | -------------------------------------------------------------------------------- /packages/pkg-config/src/constants.ts: -------------------------------------------------------------------------------- 1 | export const SLICE_NOT_REGISTERED = 2 | 'Looks like configuration slice is being used without having been yet registered to the store'; 3 | export const USER_PREFERENCE_KEY = 'Preference'; 4 | 5 | // magic strings 6 | export const clientIdConfig = 'clientId' as const; 7 | -------------------------------------------------------------------------------- /packages/react-utils/src/components/GenericDetailsView/TabsTable/test/__snapshots__/index.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`renders correctly 1`] = `"Test NamefinishedID: a1f3a048-8863-42b7-9d2e-2e9efbbca9a8Date created2021-12-14T14:42:59.368+00:00statusfinishedClassAMB"`; 4 | -------------------------------------------------------------------------------- /packages/react-utils/src/components/NoData/index.css: -------------------------------------------------------------------------------- 1 | .header-text { 2 | font-size: 16px; 3 | line-height: 24px; 4 | letter-spacing: 0.15px; 5 | color: #000000; 6 | } 7 | 8 | .info-text { 9 | font-size: 13px; 10 | font-weight: 400; 11 | line-height: 17px; 12 | letter-spacing: 0px; 13 | } 14 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | **/*.db 2 | **/.env 3 | **/.env.development.local 4 | **/.env.local 5 | **/.env.production.local 6 | **/.env.test.local 7 | **/.git* 8 | **/.waypoint 9 | **/build 10 | **/dist 11 | **/node_modules 12 | **/npm-debug.log 13 | .dckerignore 14 | Dockerfile 15 | README.md 16 | docs 17 | waypoint.hcl 18 | -------------------------------------------------------------------------------- /packages/fhir-care-team/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## 0.0.1 (2021-06-02) 7 | 8 | **Note:** Version bump only for package @opensrp/fhir-care-team 9 | -------------------------------------------------------------------------------- /scripts/helm-envs-checker/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@opensrp/scripts-helm-envs-checker", 3 | "packageManager": "yarn@3.6.1", 4 | "bin": "cli.js", 5 | "devDependencies": { 6 | "js-yaml": "^4.1.0", 7 | "typescript": "^5.7.2" 8 | }, 9 | "engines": { 10 | "node": ">=22" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /scripts/i18n/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@opensrp/scripts-i18n", 3 | "packageManager": "yarn@3.6.1", 4 | "type": "module", 5 | "bin": "cli.js", 6 | "devDependencies": { 7 | "gulp": "^5.0.0", 8 | "i18next-parser": "^9.0.2" 9 | }, 10 | "engines": { 11 | "node": ">=22" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/rbac/src/mls.ts: -------------------------------------------------------------------------------- 1 | import { useTranslation as useOrigTranslation, UseTranslationOptions } from '@opensrp/i18n'; 2 | 3 | export const namespace = 'rbac'; 4 | 5 | export const useTranslation = (ns?: string, options?: UseTranslationOptions) => { 6 | return useOrigTranslation(ns ? ns : namespace, options); 7 | }; 8 | -------------------------------------------------------------------------------- /scripts/.gitignore: -------------------------------------------------------------------------------- 1 | .yarn/* 2 | !.yarn/patches 3 | !.yarn/plugins 4 | !.yarn/releases 5 | !.yarn/sdks 6 | !.yarn/versions 7 | 8 | # Swap the comments on the following lines if you don't wish to use zero-installs 9 | # Documentation here: https://yarnpkg.com/features/zero-installs 10 | !.yarn/cache 11 | #.pnp.* 12 | -------------------------------------------------------------------------------- /packages/rbac/src/helpers/types.ts: -------------------------------------------------------------------------------- 1 | import { UserRole } from '../roleDefinition'; 2 | 3 | export interface RbacAdapter { 4 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 5 | (roles: any): UserRole; 6 | } 7 | 8 | export type Valueof = T[keyof T]; 9 | 10 | export type MatchStrategy = 'all' | 'any'; 11 | -------------------------------------------------------------------------------- /packages/rbac/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/react-utils/src/mls.ts: -------------------------------------------------------------------------------- 1 | import { useTranslation as useOrigTranslation, UseTranslationOptions } from '@opensrp/i18n'; 2 | 3 | export const namespace = 'react-utils'; 4 | 5 | export const useTranslation = (ns?: string, options?: UseTranslationOptions) => { 6 | return useOrigTranslation(ns ? ns : namespace, options); 7 | }; 8 | -------------------------------------------------------------------------------- /.yarnrc: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | yarn-path ".yarn/releases/yarn-1.18.0.cjs" 6 | 7 | # yarn install timing out on github ci - increase timeout to 5 mins 8 | # https://github.com/yarnpkg/yarn/issues/5540#issuecomment-374069461 9 | network-timeout 300000 10 | -------------------------------------------------------------------------------- /packages/fhir-flag/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/fhir-location-management/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## 0.0.1 (2020-10-28) 7 | 8 | **Note:** Version bump only for package @opensrp/fhir-location-management 9 | -------------------------------------------------------------------------------- /packages/template/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/fhir-care-team/src/mls.ts: -------------------------------------------------------------------------------- 1 | import { useTranslation as useOrigTranslation, UseTranslationOptions } from '@opensrp/i18n'; 2 | 3 | export const namespace = 'fhir-care-team'; 4 | 5 | export const useTranslation = (ns?: string, options?: UseTranslationOptions) => { 6 | return useOrigTranslation(ns ? ns : namespace, options); 7 | }; 8 | -------------------------------------------------------------------------------- /packages/fhir-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/fhir-helpers/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/fhir-import/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/fhir-resources/src/mls.ts: -------------------------------------------------------------------------------- 1 | import { useTranslation as useOrigTranslation, UseTranslationOptions } from '@opensrp/i18n'; 2 | 3 | export const namespace = 'fhir-resources'; 4 | 5 | export const useTranslation = (ns?: string, options?: UseTranslationOptions) => { 6 | return useOrigTranslation(ns ? ns : namespace, options); 7 | }; 8 | -------------------------------------------------------------------------------- /packages/fhir-views/src/constants.tsx: -------------------------------------------------------------------------------- 1 | export const questionnaireResourceType = 'Questionnaire' as const; 2 | export const questionnaireResponseResourceType = 'QuestionnaireResponse' as const; 3 | export const QUEST_VIEW_URL = '/quest'; 4 | export const QUEST_RESPONSE_VIEW_URL = '/questR'; 5 | export const QUEST_FORM_VIEW_URL = '/quest-form'; 6 | -------------------------------------------------------------------------------- /packages/fhir-views/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/opensrp-store/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/pkg-config/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/react-utils/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/server-logout/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/fhir-care-team/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["**/src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/fhir-quest-form/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/keycloak-service/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /app/src/mls.ts: -------------------------------------------------------------------------------- 1 | import { useTranslation as useOrigTranslation } from '@opensrp/i18n'; 2 | import type { UseTranslationOptions } from '@opensrp/i18n'; 3 | 4 | export const namespace = 'app'; 5 | 6 | export const useTranslation = (ns?: string, options?: UseTranslationOptions) => { 7 | return useOrigTranslation(ns ? ns : namespace, options); 8 | }; 9 | -------------------------------------------------------------------------------- /packages/fhir-group-management/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["**/src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/fhir-healthcare-service/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/fhir-team-management/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["**/src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/react-utils/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "403": "", 3 | "404": "", 4 | 5 | "Error": "", 6 | "Go back": "", 7 | "Go home": "", 8 | "Search": "", 9 | "Something went wrong": "", 10 | "Sorry, the resource you requested for, does not exist": "", 11 | "Sorry, you are not authorized to access this page": "" 12 | } 13 | -------------------------------------------------------------------------------- /packages/opensrp-notifications/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/error-boundary-fallback/src/mls.ts: -------------------------------------------------------------------------------- 1 | import { useTranslation as useOrigTranslation, UseTranslationOptions } from '@opensrp/i18n'; 2 | 3 | export const namespace = 'error-boundary-fallback'; 4 | 5 | export const useTranslation = (ns?: string, options?: UseTranslationOptions) => { 6 | return useOrigTranslation(ns ? ns : namespace, options); 7 | }; 8 | -------------------------------------------------------------------------------- /packages/error-boundary-fallback/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["**/src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/fhir-location-management/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["**/src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/keycloak-user-management/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["**/src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /.github/codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | precision: 2 3 | round: down 4 | range: "90...100" 5 | 6 | status: 7 | project: 8 | default: 9 | threshold: 0.64% 10 | if_ci_failed: error 11 | patch: 12 | default: 13 | target: 90% 14 | if_ci_failed: error 15 | 16 | codecov: 17 | require_ci_to_pass: false 18 | -------------------------------------------------------------------------------- /packages/fhir-keycloak-user-management/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["**/src"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/i18n/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types", 7 | "jsx": "react-jsx", 8 | }, 9 | "include": ["src"], 10 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 11 | } 12 | -------------------------------------------------------------------------------- /packages/keycloak-user-management/src/mls.ts: -------------------------------------------------------------------------------- 1 | import { useTranslation as useOrigTranslation, UseTranslationOptions } from '@opensrp/i18n'; 2 | 3 | export const useTranslation = (ns?: string, options?: UseTranslationOptions) => { 4 | return useOrigTranslation(ns ? ns : namespace, options); 5 | }; 6 | 7 | export const namespace = 'keycloak-user-management'; 8 | -------------------------------------------------------------------------------- /packages/fhir-group-management/src/types.ts: -------------------------------------------------------------------------------- 1 | /** Organizations redux module */ 2 | import { Require } from '@opensrp/react-utils'; 3 | import { IfhirR4 } from '@smile-cdr/fhirts'; 4 | 5 | /** interface for Objects */ 6 | 7 | export interface Group extends Require { 8 | resourceType: 'Group'; 9 | } 10 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/fhir-resources/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "{{val, datetime}}": "", 3 | "Effective period end:": "", 4 | "Effective period start:": "", 5 | "Last Changed:": "", 6 | "Last reviewed date:": "", 7 | "linkId: {{linkId}}": "", 8 | "Publisher:": "", 9 | "Subject type:": "", 10 | "type: {{itemType}}": "", 11 | "Version:": "" 12 | } 13 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/fhir-resources/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "{{val, datetime}}": "", 3 | "Effective period end:": "", 4 | "Effective period start:": "", 5 | "Last Changed:": "", 6 | "Last reviewed date:": "", 7 | "linkId: {{linkId}}": "", 8 | "Publisher:": "", 9 | "Subject type:": "", 10 | "type: {{itemType}}": "", 11 | "Version:": "" 12 | } 13 | -------------------------------------------------------------------------------- /packages/i18n/src/resources.ts: -------------------------------------------------------------------------------- 1 | import { Resource } from 'i18next'; 2 | 3 | // PS: process.env. __OPENSRP_WEB_LANG_RESOURCES__ is not a real environment variable 4 | // its a placeholder for where we will insert the tranlsation string json files data during 5 | // build. 6 | export const resources = process.env.__OPENSRP_WEB_LANG_RESOURCES__ as unknown as Resource; 7 | -------------------------------------------------------------------------------- /packages/fhir-flag/src/mls.ts: -------------------------------------------------------------------------------- 1 | import { useTranslation as useOrigTranslation } from '@opensrp/i18n'; 2 | import type { UseTranslationOptions } from '@opensrp/i18n'; 3 | 4 | export const namespace = 'fhir-flag'; 5 | 6 | export const useTranslation = (ns?: string, options?: UseTranslationOptions) => { 7 | return useOrigTranslation(ns ? ns : namespace, options); 8 | }; 9 | -------------------------------------------------------------------------------- /packages/fhir-views/src/mls.ts: -------------------------------------------------------------------------------- 1 | import { useTranslation as useOrigTranslation } from '@opensrp/i18n'; 2 | import type { UseTranslationOptions } from '@opensrp/i18n'; 3 | 4 | export const namespace = 'fhir-views'; 5 | 6 | export const useTranslation = (ns?: string, options?: UseTranslationOptions) => { 7 | return useOrigTranslation(ns ? ns : namespace, options); 8 | }; 9 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/react-utils/ar.json: -------------------------------------------------------------------------------- 1 | { 2 | "403": "", 3 | "404": "", 4 | "Error": "", 5 | "Go back": "", 6 | "Go home": "", 7 | "Search": "", 8 | "Session Expired": "", 9 | "Something went wrong": "", 10 | "Sorry, the resource you requested for, does not exist": "", 11 | "Sorry, you are not authorized to access this page": "" 12 | } 13 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/react-utils/th.json: -------------------------------------------------------------------------------- 1 | { 2 | "403": "", 3 | "404": "", 4 | "Error": "", 5 | "Go back": "", 6 | "Go home": "", 7 | "Search": "", 8 | "Session Expired": "", 9 | "Something went wrong": "", 10 | "Sorry, the resource you requested for, does not exist": "", 11 | "Sorry, you are not authorized to access this page": "" 12 | } 13 | -------------------------------------------------------------------------------- /docker/app.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # vim:sw=4:ts=4:et 3 | 4 | set -e 5 | 6 | confd -onetime -backend env 7 | sed -i "s/CONFIG_VERSION/`date '+%s'`/" /usr/src/web/index.html 8 | sed -i "s/Redirected path should match configured path/Redirected path ' + Url.parse(options.redirectUri).pathname + 'should match configured path/" /usr/src/web/node_modules/client-oauth2/src/client-oauth2.js -------------------------------------------------------------------------------- /packages/fhir-client/src/mls.ts: -------------------------------------------------------------------------------- 1 | import { useTranslation as useOrigTranslation } from '@opensrp/i18n'; 2 | import type { UseTranslationOptions } from '@opensrp/i18n'; 3 | 4 | export const namespace = 'fhir-client'; 5 | 6 | export const useTranslation = (ns?: string, options?: UseTranslationOptions) => { 7 | return useOrigTranslation(ns ? ns : namespace, options); 8 | }; 9 | -------------------------------------------------------------------------------- /packages/fhir-import/src/mls.ts: -------------------------------------------------------------------------------- 1 | import { useTranslation as useOrigTranslation } from '@opensrp/i18n'; 2 | import type { UseTranslationOptions } from '@opensrp/i18n'; 3 | 4 | export const namespace = 'fhir-import'; 5 | 6 | export const useTranslation = (ns?: string, options?: UseTranslationOptions) => { 7 | return useOrigTranslation(ns ? ns : namespace, options); 8 | }; 9 | -------------------------------------------------------------------------------- /packages/fhir-location-management/src/mls.ts: -------------------------------------------------------------------------------- 1 | import { useTranslation as useOrigTranslation } from '@opensrp/i18n'; 2 | import type { UseTranslationOptions } from '@opensrp/i18n'; 3 | import { namespace } from './constants'; 4 | 5 | export const useMls = (ns?: string, options?: UseTranslationOptions) => { 6 | return useOrigTranslation(ns ? ns : namespace, options); 7 | }; 8 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/team-assignment/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "An error occurred": "", 3 | "Assign/Unassign Teams | {{locationName}}": "", 4 | "Assigned Teams": "", 5 | "Cancel": "", 6 | "Edit": "", 7 | "Enter a Team name": "", 8 | "Name": "", 9 | "Save": "", 10 | "Successfully Assigned Teams": "", 11 | "Team Assignment": "", 12 | "Teams": "" 13 | } 14 | -------------------------------------------------------------------------------- /packages/fhir-quest-form/src/mls.ts: -------------------------------------------------------------------------------- 1 | import { useTranslation as useOrigTranslation } from '@opensrp/i18n'; 2 | import type { UseTranslationOptions } from '@opensrp/i18n'; 3 | 4 | export const namespace = 'fhir-quest-form'; 5 | 6 | export const useTranslation = (ns?: string, options?: UseTranslationOptions) => { 7 | return useOrigTranslation(ns ? ns : namespace, options); 8 | }; 9 | -------------------------------------------------------------------------------- /scripts/readme.md: -------------------------------------------------------------------------------- 1 | # scripts 2 | 3 | Home of tiny bespoke and lightweight utility code that automates common code maintenance and shipping tasks. 4 | 5 | These include: 6 | 7 | 1. i18n : cli utility that one can use to manage internationalization tasks on the repository 8 | 2. helm-envs-checker : cli utility that checks envs disparity across web, express and our official helm chart 9 | -------------------------------------------------------------------------------- /packages/fhir-team-management/src/mls.ts: -------------------------------------------------------------------------------- 1 | import { useTranslation as useOrigTranslation } from '@opensrp/i18n'; 2 | import type { UseTranslationOptions } from '@opensrp/i18n'; 3 | 4 | export const namespace = 'fhir-team-management'; 5 | 6 | export const useTranslation = (ns?: string, options?: UseTranslationOptions) => { 7 | return useOrigTranslation(ns ? ns : namespace, options); 8 | }; 9 | -------------------------------------------------------------------------------- /packages/fhir-user-sync/src/constants.ts: -------------------------------------------------------------------------------- 1 | export const URL_USER_SYNC = '/admin/users/sync'; 2 | 3 | export const practitionerResourceType = 'Practitioner'; 4 | export const groupResourceType = 'Group'; 5 | export const practitionerRoleResourceType = 'PractitionerRole'; 6 | 7 | export const PRACTITIONER_USER_TYPE_CODE = '405623001'; 8 | export const SUPERVISOR_USER_TYPE_CODE = '223366009'; 9 | -------------------------------------------------------------------------------- /app/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "OpenSRP", 3 | "name": "OpenSRP Frontend App", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /packages/fhir-group-management/src/mls.ts: -------------------------------------------------------------------------------- 1 | import { useTranslation as useOrigTranslation } from '@opensrp/i18n'; 2 | import type { UseTranslationOptions } from '@opensrp/i18n'; 3 | 4 | export const namespace = 'fhir-group-management'; 5 | 6 | export const useTranslation = (ns?: string, options?: UseTranslationOptions) => { 7 | return useOrigTranslation(ns ? ns : namespace, options); 8 | }; 9 | -------------------------------------------------------------------------------- /packages/fhir-healthcare-service/src/mls.ts: -------------------------------------------------------------------------------- 1 | import { useTranslation as useOrigTranslation } from '@opensrp/i18n'; 2 | import type { UseTranslationOptions } from '@opensrp/i18n'; 3 | 4 | export const namespace = 'fhir-healthcare-service'; 5 | 6 | export const useTranslation = (ns?: string, options?: UseTranslationOptions) => { 7 | return useOrigTranslation(ns ? ns : namespace, options); 8 | }; 9 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/fhir-group-management/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "{{val, datetime}}": "", 3 | "{{val,datetime}}": "", 4 | 5 | "Active": "", 6 | "Create Group": "", 7 | "Edit": "", 8 | "Groups list": "", 9 | "Id": "", 10 | "Last updated": "", 11 | "Last Updated": "", 12 | "Members": "", 13 | "Name": "", 14 | "No. of Members": "", 15 | "View Details": "" 16 | } 17 | -------------------------------------------------------------------------------- /packages/fhir-views/README.md: -------------------------------------------------------------------------------- 1 | # Fhir Questionnaire 2 | 3 | TBDone 4 | 5 | 6 | 7 | ## Installation 8 | 9 | ```sh 10 | yarn add @opensrp/fhir-questionnaire 11 | ``` 12 | 13 | 17 | 18 | ## Usage 19 | 20 | ### Code examples 21 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/team-assignment/ar.json: -------------------------------------------------------------------------------- 1 | { 2 | "Actions": "", 3 | "An error occurred": "", 4 | "Assign/Unassign Teams | {{locationName}}": "", 5 | "Assigned Teams": "", 6 | "Cancel": "", 7 | "Edit": "", 8 | "Enter a Team name": "", 9 | "Name": "", 10 | "Save": "", 11 | "Successfully Assigned Teams": "", 12 | "Team Assignment": "", 13 | "Teams": "" 14 | } 15 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/team-assignment/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "Actions": "", 3 | "An error occurred": "", 4 | "Assign/Unassign Teams | {{locationName}}": "", 5 | "Assigned Teams": "", 6 | "Cancel": "", 7 | "Edit": "", 8 | "Enter a Team name": "", 9 | "Name": "", 10 | "Save": "", 11 | "Successfully Assigned Teams": "", 12 | "Team Assignment": "", 13 | "Teams": "" 14 | } 15 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/team-assignment/ar.json: -------------------------------------------------------------------------------- 1 | { 2 | "Actions": "", 3 | "An error occurred": "", 4 | "Assign/Unassign Teams | {{locationName}}": "", 5 | "Assigned Teams": "", 6 | "Cancel": "", 7 | "Edit": "", 8 | "Enter a Team name": "", 9 | "Name": "", 10 | "Save": "", 11 | "Successfully Assigned Teams": "", 12 | "Team Assignment": "", 13 | "Teams": "" 14 | } 15 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/team-assignment/vi.json: -------------------------------------------------------------------------------- 1 | { 2 | "Actions": "", 3 | "An error occurred": "", 4 | "Assign/Unassign Teams | {{locationName}}": "", 5 | "Assigned Teams": "", 6 | "Cancel": "", 7 | "Edit": "", 8 | "Enter a Team name": "", 9 | "Name": "", 10 | "Save": "", 11 | "Successfully Assigned Teams": "", 12 | "Team Assignment": "", 13 | "Teams": "" 14 | } 15 | -------------------------------------------------------------------------------- /packages/fhir-keycloak-user-management/src/mls.ts: -------------------------------------------------------------------------------- 1 | import { useTranslation as useOrigTranslation } from '@opensrp/i18n'; 2 | import type { UseTranslationOptions } from '@opensrp/i18n'; 3 | 4 | export const namespace = 'fhir-keycloak-user-management'; 5 | 6 | export const useTranslation = (ns?: string, options?: UseTranslationOptions) => { 7 | return useOrigTranslation(ns ? ns : namespace, options); 8 | }; 9 | -------------------------------------------------------------------------------- /app/src/helpers/testUtils.tsx: -------------------------------------------------------------------------------- 1 | import { mount, MountRendererProps } from 'enzyme'; 2 | import React from 'react'; 3 | import { OpensrpWebI18nProvider } from '@opensrp/i18n'; 4 | 5 | export const mountWithTranslations: typeof mount = ( 6 | component: React.ReactNode, 7 | options?: MountRendererProps 8 | ) => { 9 | return mount({component}, options); 10 | }; 11 | -------------------------------------------------------------------------------- /packages/fhir-resources/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "declaration": true, 6 | "declarationDir": "dist/types" 7 | }, 8 | "include": ["src", "../react-utils/src/components/FhirForm", "../react-utils/src/components/ui"], 9 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/error-boundary-fallback/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "An Error Occurred": "An Error Occurred", 3 | "Back Home": "Back Home", 4 | "There has been an error. It’s been reported to the site administrators via email and should be fixed shortly. Thanks for your patience.": "There has been an error. It’s been reported to the site administrators via email and should be fixed shortly. Thanks for your patience." 5 | } 6 | -------------------------------------------------------------------------------- /packages/fhir-location-management/src/components/ViewDetails/LocationDetails/tests/__snapshots__/index.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`GeometryRender Component renders valid JSON string formatted 1`] = ` 4 |
 7 |   {
 8 |   "key": "value"
 9 | }
10 | 
11 | `; 12 | -------------------------------------------------------------------------------- /app/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 5 | 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace; 12 | } 13 | -------------------------------------------------------------------------------- /packages/keycloak-user-management/src/components/CreateEditUserGroup/tests/__snapshots__/index.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`components/CreateEditUserGroup renders correctly: full user group form 1`] = `"Edit User Group | AdminNameRealm Roles2 itemsAvailable RolesEDIT_KEYCLOAK_USERSVIEW_KEYCLOAK_USERS6 itemsAssigned RolesOPENMRSALL_EVENTSPLANS_FOR_USERrealm-adminoffline_accessuma_authorizationSaveCancel"`; 4 | -------------------------------------------------------------------------------- /packages/fhir-client/src/components/PatientDetails/index.css: -------------------------------------------------------------------------------- 1 | .details-content { 2 | background: #FFFFFF; 3 | top: 155px; 4 | left: 286px; 5 | padding: 16px; 6 | gap: 14px; 7 | border-radius: 12px; 8 | } 9 | 10 | .details-content .main-content { 11 | padding: 0px; 12 | } 13 | 14 | .details-content .ant-tabs-tab-btn { 15 | padding-left: 16px; 16 | } 17 | 18 | .details-content .view-details-content { 19 | padding: 0px; 20 | } 21 | 22 | -------------------------------------------------------------------------------- /packages/fhir-import/src/components/tests/statusTag.test.tsx: -------------------------------------------------------------------------------- 1 | import { getStatusColor } from '../statusTag'; 2 | 3 | test('getStatusColor works correctly', () => { 4 | expect(getStatusColor('completed')).toBe('success'); 5 | expect(getStatusColor('active')).toBe('processing'); 6 | expect(getStatusColor('failed')).toBe('error'); 7 | expect(getStatusColor('paused')).toBe('warning'); 8 | expect(getStatusColor('waiting')).toBe('default'); 9 | }); 10 | -------------------------------------------------------------------------------- /packages/react-utils/src/constants.ts: -------------------------------------------------------------------------------- 1 | export const HOME_URL = '/'; 2 | export const EXPRESS_TOKEN_REFRESH_URL = '/refresh/token'; 3 | 4 | export const TABLE_ACTIONS_KEY = '_actions'; 5 | 6 | export const TABLE_PAGE = 1; 7 | export const TABLE_PAGE_SIZE = 5; 8 | export const TABLE_PAGE_SIZE_OPTIONS = ['5', '10', '20', '50', '100']; 9 | 10 | // query parameters 11 | export const tabViewQuery = 'tabView'; 12 | export const activeTabQuery = 'activeTab'; 13 | -------------------------------------------------------------------------------- /packages/fhir-flag/src/constants.tsx: -------------------------------------------------------------------------------- 1 | // urls 2 | export const URL_ADMIN = '/admin'; 3 | export const URL_CLOSE_FLAGS = `${URL_ADMIN}/close-flags`; 4 | 5 | // // magic strings 6 | 7 | export const thatiMinutes = 30 * 60 * 1000; 8 | 9 | // form fields 10 | export const locationName = 'locationName' as const; 11 | export const productName = 'productName' as const; 12 | export const status = 'status' as const; 13 | export const comments = 'comments' as const; 14 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/error-boundary-fallback/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "An Error Occurred": "Une erreur est survenue", 3 | "Back Home": "Retour à l'accueil.", 4 | "There has been an error. It’s been reported to the site administrators via email and should be fixed shortly. Thanks for your patience.": "Une erreur s'est produite. Elle a été signalée aux administrateurs du site par courrier électronique et devrait être corrigée sous peu. Nous vous remercions de votre patience." 5 | } 6 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/fhir-views/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "{{val, datetime}}": "", 3 | 4 | "Create questionnaire": "", 5 | "date": "", 6 | "Date authored": "", 7 | "Edit": "", 8 | "Fill form": "", 9 | "Name/Id": "", 10 | "Problem loading questionnaire": "", 11 | "Publisher": "", 12 | "Questionnaire list view": "", 13 | "QuestionnaireVersion": "", 14 | "Status": "", 15 | "Submission Id": "", 16 | "Version": "", 17 | "View Questionnaire Responses": "" 18 | } 19 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/team-assignment/vi.json: -------------------------------------------------------------------------------- 1 | { 2 | "Actions": "Lệnh", 3 | "An error occurred": "Đã xảy ra lỗi", 4 | "Assign/Unassign Teams | {{locationName}}": "", 5 | "Assigned Teams": "Nhóm người dùng tương ứng", 6 | "Cancel": "Hủy", 7 | "Edit": "Chỉnh sửa", 8 | "Enter a Team name": "Điền tên Nhóm", 9 | "Name": "Khu vực", 10 | "Save": "Lưu", 11 | "Successfully Assigned Teams": "", 12 | "Team Assignment": "Điều phối Nhóm", 13 | "Teams": "Nhóm" 14 | } 15 | -------------------------------------------------------------------------------- /packages/fhir-group-management/src/components/CommodityAddEdit/Default/tests/__snapshots__/index.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`renders correctly: active radio button 1`] = ` 4 | 10 | `; 11 | 12 | exports[`renders correctly: disabled radio button 1`] = ` 13 | 18 | `; 19 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/fhir-views/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "{{val, datetime}}": "", 3 | "Actions": "", 4 | "Create questionnaire": "", 5 | "date": "", 6 | "Date authored": "", 7 | "Edit": "", 8 | "Fill form": "", 9 | "Name/Id": "", 10 | "Problem loading questionnaire": "", 11 | "Publisher": "", 12 | "Questionnaire list view": "", 13 | "QuestionnaireVersion": "", 14 | "Status": "", 15 | "Submission Id": "", 16 | "Version": "", 17 | "View Questionnaire Responses": "" 18 | } 19 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function (api) { 2 | api.cache(true); 3 | return { 4 | presets: ['@babel/preset-env', '@babel/preset-react', '@babel/preset-typescript'], 5 | plugins: [ 6 | '@babel/proposal-class-properties', 7 | '@babel/proposal-object-rest-spread', 8 | '@babel/transform-runtime', 9 | ], 10 | env: { 11 | test: { 12 | plugins: ['transform-es2015-modules-commonjs'], 13 | }, 14 | }, 15 | comments: false, 16 | }; 17 | }; 18 | -------------------------------------------------------------------------------- /packages/fhir-resources/README.md: -------------------------------------------------------------------------------- 1 | # Fhir Resources 2 | 3 | Utils and components to parse and render individual fhir resources 4 | 5 | ## Installation 6 | 7 | ```sh 8 | yarn add @opensrp/fhir-resources 9 | ``` 10 | 11 | ## Usage 12 | 13 | ### Resources 14 | 15 | 1. Questionnaire 16 | 2. QuestionnaireResponse 17 | 18 | ### Code examples 19 | 20 | ```typescript 21 | 22 | import { Questionnaire, QuestionnaireResponse } from '@opensrp/fhir-resources'; 23 | 24 | 25 | 26 | ``` 27 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/fhir-resources/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "{{val, datetime}}": "{{val, datetime}}", 3 | "Effective period end:": "Effective period end:", 4 | "Effective period start:": "Effective period start:", 5 | "Last Changed:": "Last Changed:", 6 | "Last reviewed date:": "Last reviewed date:", 7 | "linkId: {{linkId}}": "linkId: {{linkId}}", 8 | "Publisher:": "Publisher:", 9 | "Subject type:": "Subject type:", 10 | "type: {{itemType}}": "type: {{itemType}}", 11 | "Version:": "Version:" 12 | } 13 | -------------------------------------------------------------------------------- /packages/fhir-client/src/constants.ts: -------------------------------------------------------------------------------- 1 | export const dateFormat = 'yyyy-MM-dd'; 2 | export const patientResourceType = 'Patient'; 3 | export const carePlanResourceType = 'CarePlan'; 4 | export const immunizationResourceType = 'Immunization'; 5 | export const encounterResourceType = 'Encounter'; 6 | export const conditionResourceType = 'Condition'; 7 | export const taskResourceType = 'Task'; 8 | export const planDefinitionType = 'PlanDefinition'; 9 | 10 | // urls 11 | export const LIST_PATIENTS_URL = '/fhir/Patient'; 12 | -------------------------------------------------------------------------------- /app/src/components/NotFound/tests/index.test.tsx: -------------------------------------------------------------------------------- 1 | import { mount, shallow } from 'enzyme'; 2 | import toJson from 'enzyme-to-json'; 3 | import React from 'react'; 4 | 5 | import NotFound from '../'; 6 | 7 | describe('components/NotFount', () => { 8 | it('renders without crashing', () => { 9 | shallow(); 10 | }); 11 | it('renders the NotFount component', () => { 12 | const wrapper = mount(); 13 | expect(toJson(wrapper)).toMatchSnapshot(); 14 | wrapper.unmount(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /app/src/configs/tests/dispatchConfig.test.ts: -------------------------------------------------------------------------------- 1 | import '../dispatchConfig'; 2 | import { getAllConfigs } from '@opensrp/pkg-config'; 3 | 4 | it('can dispatch configs', () => { 5 | const configs = getAllConfigs(); 6 | expect(configs).toMatchObject({ 7 | appLoginURL: '/login', 8 | keycloakBaseURL: 'https://keycloak-stage.smartregister.org/auth/admin/realms/opensrp-web-stage', 9 | languageCode: 'en', 10 | opensrpBaseURL: 'https://some.opesrp.server/opensrp/rest/', 11 | projectCode: 'eusm', 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /packages/fhir-location-management/src/components/LocationUnitList/LocationUnitList.css: -------------------------------------------------------------------------------- 1 | .table-container { 2 | background-color: #ffffff; 3 | margin: 20px; 4 | } 5 | 6 | .location-table-action { 7 | width: 86px; 8 | } 9 | 10 | .location-table-action .edit { 11 | width: 45px; 12 | color: #1890ff; 13 | } 14 | 15 | .location-table-action .more-options { 16 | cursor: pointer; 17 | width: 32px; 18 | color: #1890ff; 19 | border-left: 1px solid; 20 | height: 16px; 21 | font-size: 18px; 22 | border-left-color: #e9e9e9; 23 | } 24 | -------------------------------------------------------------------------------- /packages/fhir-location-management/src/index.tsx: -------------------------------------------------------------------------------- 1 | import Tree from './components/LocationTree'; 2 | export { Tree }; 3 | export * as locationTreeStateDucks from './ducks/location-tree-state'; 4 | export * from './components/LocationUnitList'; 5 | export * from './components/AddEditLocationUnit'; 6 | export * from './components/ViewDetails'; 7 | export * from './components/LocationForm'; 8 | export * from './components/AllLocationListFlat'; 9 | export * from './helpers/utils'; 10 | export * from './helpers/types'; 11 | export * from './constants'; 12 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/team-assignment/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "Actions": "Actions", 3 | "An error occurred": "An error occurred", 4 | "Assign/Unassign Teams | {{locationName}}": "Assign/Unassign Teams | {{locationName}}", 5 | "Assigned Teams": "Assigned Teams", 6 | "Cancel": "Cancel", 7 | "Edit": "Edit", 8 | "Enter a Team name": "Enter a Team name", 9 | "Name": "Name", 10 | "Save": "Save", 11 | "Successfully Assigned Teams": "Successfully Assigned Teams", 12 | "Team Assignment": "Team Assignment", 13 | "Teams": "Teams" 14 | } 15 | -------------------------------------------------------------------------------- /packages/react-utils/src/components/GenericDetailsView/TabsTitle/tests/fixtures.tsx: -------------------------------------------------------------------------------- 1 | export const resourceEntriesCount = { 2 | resourceType: 'Bundle', 3 | id: '2f5a9993-912b-4201-b1ba-dc04eede1a9f', 4 | meta: { 5 | lastUpdated: '2024-05-21T11:17:47.268+00:00', 6 | tag: [ 7 | { 8 | system: 'http://terminology.hl7.org/CodeSystem/v3-ObservationValue', 9 | code: 'SUBSETTED', 10 | display: 'Resource encoded in summary mode', 11 | }, 12 | ], 13 | }, 14 | type: 'searchset', 15 | total: 5, 16 | }; 17 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/react-utils/vi.json: -------------------------------------------------------------------------------- 1 | { 2 | "403": "403", 3 | "404": "404", 4 | "Actions": "Lệnh", 5 | "Error": "Lỗi", 6 | "Go back": "Quay lại", 7 | "Go home": "Quay lại Trang chủ", 8 | "Search": "Tìm kiếm", 9 | "Session Expired": "Hết phiên đăng nhập", 10 | "Something went wrong": "Hệ thống đăng gặp lỗi", 11 | "Sorry, the resource you requested for, does not exist": "Xin lỗi, trang bạn tìm không tồn tại", 12 | "Sorry, you are not authorized to access this page": "Xin lỗi, bạn không có quyền truy cập trang này" 13 | } 14 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/fhir-resources/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "{{val, datetime}}": "{{val, datetime}}", 3 | "Effective period end:": "Fin de la période de redevabilité :", 4 | "Effective period start:": "Début de la période de redevabilité:", 5 | "Last Changed:": "Dernière modification :", 6 | "Last reviewed date:": "Date de la dernière vérification :", 7 | "linkId: {{linkId}}": "linkId: {{linkId}}", 8 | "Publisher:": "Éditeur :", 9 | "Subject type:": "Type de sujet :", 10 | "type: {{itemType}}": "type: {{itemType}}", 11 | "Version:": "Version:" 12 | } 13 | -------------------------------------------------------------------------------- /packages/fhir-helpers/src/constants/valueSetEnums.ts: -------------------------------------------------------------------------------- 1 | // location physical types. 2 | export const physicalTypeValueSetUrl = 'http://hl7.org/fhir/ValueSet/location-physical-type'; 3 | export enum PhysicalTypeCodes { 4 | JURISDICTION = 'jdn', 5 | BUILDING = 'bu', 6 | } 7 | 8 | /** 9 | * https://www.hl7.org/fhir/R4/valueset-group-type.html 10 | */ 11 | export const R4GroupTypeCodesValueSetUrl = 'http://hl7.org/fhir/ValueSet/group-type'; 12 | export enum R4GroupTypeCodes { 13 | MEDICATION = 'medication', 14 | DEVICE = 'device', 15 | SUBSTANCE = 'substance', 16 | } 17 | -------------------------------------------------------------------------------- /packages/fhir-import/src/containers/StartImportView/form.css: -------------------------------------------------------------------------------- 1 | form.import-form .ant-form-item-label label { 2 | width: 144px; 3 | word-break: break-word; 4 | text-align: left; 5 | white-space: wrap; 6 | } 7 | 8 | .form-instructions-steps .ant-steps-item-icon { 9 | background-color: rgba(0, 0, 0, 0.06) !important; 10 | border-color: transparent !important; 11 | 12 | > .ant-steps-icon{ 13 | color: rgba(0, 0, 0, 0.65) !important; 14 | } 15 | } 16 | 17 | .form-instructions-steps .ant-steps-item-description { 18 | color: rgba(0, 0, 0, 0.88) !important; 19 | } 20 | -------------------------------------------------------------------------------- /packages/fhir-keycloak-user-management/src/components/UserList/Viewdetails/index.css: -------------------------------------------------------------------------------- 1 | .details-full-view { 2 | background: #f5f5f5; 3 | } 4 | 5 | .details-full-view .site-page-header { 6 | padding: 16px 24px; 7 | background: #fff; 8 | } 9 | 10 | .details-full-view .content-body { 11 | margin: 24px; 12 | display: flex; 13 | gap: 16px; 14 | flex-direction: column; 15 | } 16 | 17 | .details-full-view .content-box { 18 | background-color: #fff; 19 | } 20 | 21 | .details-full-view .details-tab { 22 | background: #fff; 23 | padding-top: 16px; 24 | width: 100%; 25 | } 26 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/team-assignment/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "Actions": "Actions", 3 | "An error occurred": "Une erreur est survenue", 4 | "Assign/Unassign Teams | {{locationName}}": "Affecter/désaffecter des équipes {{locationName}}", 5 | "Assigned Teams": "Equipes assignées", 6 | "Cancel": "Annuler", 7 | "Edit": "Modifier", 8 | "Enter a Team name": "Saisir nom de l'équipe", 9 | "Name": "Prénom", 10 | "Save": "Sauvegarder", 11 | "Successfully Assigned Teams": "Équipes affectées avec succès", 12 | "Team Assignment": "Mission de l'équipe", 13 | "Teams": "Equipes" 14 | } 15 | -------------------------------------------------------------------------------- /packages/fhir-keycloak-user-management/src/components/UserList/ViewdetailsOverview/index.css: -------------------------------------------------------------------------------- 1 | .details-full-view { 2 | background: #f5f5f5; 3 | } 4 | 5 | .details-full-view .site-page-header { 6 | padding: 16px 24px; 7 | background: #fff; 8 | } 9 | 10 | .details-full-view .content-body { 11 | margin: 24px; 12 | display: flex; 13 | gap: 16px; 14 | flex-direction: column; 15 | } 16 | 17 | .details-full-view .content-box { 18 | background-color: #fff; 19 | } 20 | 21 | .details-full-view .details-tab { 22 | background: #fff; 23 | padding-top: 16px; 24 | width: 100%; 25 | } 26 | -------------------------------------------------------------------------------- /packages/fhir-location-management/src/components/AllLocationListFlat/tests/__snapshots__/eusm.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Show data as expected: table data 1`] = `"Good Health Clinic"`; 4 | 5 | exports[`Show data as expected: table data 2`] = `"Building"`; 6 | 7 | exports[`Show data as expected: table data 3`] = `"active"`; 8 | 9 | exports[`Show data as expected: table data 4`] = `""`; 10 | 11 | exports[`Show data as expected: table data 5`] = `"Edit"`; 12 | 13 | exports[`Show data as expected: table header 1`] = `"NameTypeStatusParentActions"`; 14 | -------------------------------------------------------------------------------- /app/src/containers/pages/Home/Home.css: -------------------------------------------------------------------------------- 1 | .text-center { 2 | text-align: center; 3 | margin-top: 40px; 4 | padding: 0 50px; 5 | } 6 | 7 | .admin-link, 8 | .admin-link:hover { 9 | text-decoration: none; 10 | } 11 | 12 | div.home .btn-links { 13 | color: #40a9ff; 14 | background-color: #ffffff; 15 | border: 2px solid #40a9ff; 16 | border-radius: 5px; 17 | box-shadow: 0 1px 3px 0 #d7d7e0; 18 | min-height: 300px; 19 | width: 100%; 20 | } 21 | 22 | .links-box { 23 | margin-top: 50px; 24 | } 25 | 26 | div.home .btn-links:hover { 27 | background: #40a9ff; 28 | color: #fff; 29 | } 30 | -------------------------------------------------------------------------------- /packages/pkg-config/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## 0.0.4 (2021-02-24) 7 | 8 | **Note:** Version bump only for package @opensrp/pkg-config 9 | 10 | ## [0.0.3](https://github.com/opensrp/web/compare/@opensrp/pkg-config@0.0.2...@opensrp/pkg-config@0.0.3) (2021-02-18) 11 | 12 | **Note:** Version bump only for package @opensrp/pkg-config 13 | 14 | ## 0.0.2 (2021-02-18) 15 | 16 | **Note:** Version bump only for package @opensrp/pkg-config 17 | -------------------------------------------------------------------------------- /packages/react-utils/src/components/GenericDetailsView/TabsTitle/index.css: -------------------------------------------------------------------------------- 1 | div[aria-selected="true"] { 2 | .ant-badge-count { 3 | background: var(--tab-title-count-badge-active__background); 4 | } 5 | .ant-badge-count, 6 | .current { 7 | color: var(--tab-title-count-badge-active__color); 8 | } 9 | } 10 | 11 | div[aria-selected="false"] { 12 | .ant-badge-count { 13 | background: var(--tab-title-count-badge-inactive__background); 14 | } 15 | .ant-badge-count, 16 | .current { 17 | color: var(--tab-title-count-badge-inactive__color); 18 | } 19 | } -------------------------------------------------------------------------------- /packages/fhir-group-management/src/components/CommodityAddEdit/index.tsx: -------------------------------------------------------------------------------- 1 | import { getConfig } from '@opensrp/pkg-config'; 2 | import { CommodityAddEdit as EusmCommodityAddEdit } from './Eusm'; 3 | import { CommodityAddEdit as DefaultCommodityAddEdit, GroupAddEditProps } from './Default'; 4 | import React from 'react'; 5 | 6 | export const CommodityAddEdit = (props: GroupAddEditProps) => { 7 | const projectCode = getConfig('projectCode'); 8 | 9 | if (projectCode === 'eusm') { 10 | return ; 11 | } else { 12 | return ; 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /packages/opensrp-server-service/src/tests/fixtures/session.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/naming-convention */ 2 | 3 | export const OpenSRPAPIResponse = { 4 | oAuth2Data: { 5 | access_token: 'hunter2', 6 | expires_in: '3599', 7 | state: 'opensrp', 8 | token_type: 'bearer', 9 | }, 10 | preferredName: 'Superset User', 11 | roles: ['Provider'], 12 | userName: 'superset-user', 13 | }; 14 | 15 | export const sampleErrorObj = { 16 | message: 'The server encountered an error processing the request.', 17 | status: '500 INTERNAL_SERVER_ERROR', 18 | data: null, 19 | success: false, 20 | }; 21 | -------------------------------------------------------------------------------- /packages/react-utils/src/components/BodyLayout/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { ReactNode } from 'react'; 2 | import { RichPageHeader, RichPageHeaderProps } from '../PageHeaders/RichPageHeader'; 3 | 4 | export interface BodyLayoutProps { 5 | headerProps: RichPageHeaderProps; 6 | children: ReactNode; 7 | id?: string; 8 | } 9 | 10 | export const BodyLayout = (props: BodyLayoutProps) => { 11 | const { headerProps, children } = props; 12 | return ( 13 |
14 | 15 |
{children}
16 |
17 | ); 18 | }; 19 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | **closes #** 2 | 3 | 4 | 5 | **Changes included with this PR** 6 | 7 | 10 | 11 | **Checklist** 12 | 13 | 14 | 15 | - [ ] tests are included and passing 16 | - [ ] documentation is changed or added 17 | - [ ] **Internationalization**: 18 | - [ ] Ensure all strings are internationalized. 19 | - [ ] **Role-Based Access**: 20 | - [ ] Verify that all user actions have appropriate role-based access permissions set. 21 | -------------------------------------------------------------------------------- /packages/fhir-helpers/src/constants/resourceTypes.ts: -------------------------------------------------------------------------------- 1 | export const groupResourceType = 'Group'; 2 | export const locationResourceType = 'Location'; 3 | export const listResourceType = 'List'; 4 | export const valueSetResourceType = 'ValueSet'; 5 | export const organizationAffiliationResourceType = 'OrganizationAffiliation'; 6 | export const FlagResourceType = 'Flag'; 7 | export const ListResourceType = 'List'; 8 | export const EncounterResourceType = 'Encounter'; 9 | export const ObservationResourceType = 'Observation'; 10 | export const PractitionerResourceType = 'Practitioner'; 11 | export const compositionResourceType = 'Composition'; 12 | -------------------------------------------------------------------------------- /packages/fhir-import/src/helpers/utils.tsx: -------------------------------------------------------------------------------- 1 | export interface WorkflowDescription { 2 | workflowId: string; 3 | status: JobStatus; 4 | workflowType: string; 5 | dateStarted: number; 6 | dateEnded: number; 7 | dateCreated: number; 8 | statusReason?: { stdout: string; stderr: string }; 9 | filename: string; 10 | author: string; 11 | } 12 | 13 | export type JobStatus = 'completed' | 'waiting' | 'active' | 'delayed' | 'failed' | 'paused'; 14 | 15 | /** 16 | * @param timestamp - timestamp to format 17 | */ 18 | export function formatTimestamp(timestamp: number) { 19 | return new Date(timestamp).toLocaleString(); 20 | } 21 | -------------------------------------------------------------------------------- /packages/opensrp-notifications/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## 0.0.4 (2021-02-24) 7 | 8 | **Note:** Version bump only for package @opensrp/notifications 9 | 10 | ## 0.0.3 (2021-02-18) 11 | 12 | **Note:** Version bump only for package @opensrp/notifications 13 | 14 | ## 0.0.2 (2020-11-12) 15 | 16 | **Note:** Version bump only for package @opensrp/notifications 17 | 18 | ## 0.0.1 (2020-11-05) 19 | 20 | **Note:** Version bump only for package @opensrp/notifications 21 | -------------------------------------------------------------------------------- /packages/keycloak-user-management/src/components/UserList/TableActions/tests/fixtures.ts: -------------------------------------------------------------------------------- 1 | export const keycloakUser = { 2 | id: 'cab07278-c77b-4bc7-b154-bcbf01b7d35b', 3 | createdTimestamp: 1600156317992, 4 | username: 'opensrp', 5 | enabled: true, 6 | totp: false, 7 | emailVerified: false, 8 | firstName: 'Demo', 9 | lastName: 'kenya', 10 | email: 'test@onatest.com', 11 | disableableCredentialTypes: [], 12 | requiredActions: [], 13 | notBefore: 0, 14 | access: { 15 | manageGroupMembership: true, 16 | view: true, 17 | mapRoles: true, 18 | impersonate: false, 19 | manage: true, 20 | }, 21 | }; 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | node_modules/ 5 | /.pnp 6 | .pnp.js 7 | /.idea 8 | # testing 9 | coverage/ 10 | 11 | # production 12 | build 13 | **/dist/ 14 | **/bin/ 15 | 16 | # misc 17 | .DS_Store 18 | .env 19 | .env.local 20 | .env.development.local 21 | .env.test.local 22 | .env.production.local 23 | *.db 24 | 25 | debug.log* 26 | npm-debug.log* 27 | yarn-debug.log* 28 | yarn-error.log* 29 | lerna-debug.log* 30 | 31 | #yarn 32 | .pnp.* 33 | .yarn/* 34 | !.yarn/patches 35 | !.yarn/plugins 36 | !.yarn/releases 37 | !.yarn/sdks 38 | !.yarn/versions 39 | -------------------------------------------------------------------------------- /packages/keycloak-user-management/src/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './components/UserList'; 2 | export * from './components/UserGroupsList'; 3 | export * from './components/UserRolesList'; 4 | export * from './components/CreateEditUserGroup'; 5 | export * from './components/CreateEditUser'; 6 | export * from './components/Credentials'; 7 | export * from './constants'; 8 | export * from './components/forms/UserForm/types'; 9 | export * from './components/forms/UserForm'; 10 | export { getUserTypeCode, getUserType } from './components/forms/UserForm/utils'; 11 | export * from './ducks/user'; 12 | export * as UserGroupDucks from './ducks/userGroups'; 13 | -------------------------------------------------------------------------------- /packages/fhir-healthcare-service/src/constants.tsx: -------------------------------------------------------------------------------- 1 | // url 2 | export const ADD_EDIT_HEALTHCARE_SERVICE_URL = '/healthcare/add-edit'; 3 | export const LIST_HEALTHCARE_URL = '/healthcare/list'; 4 | 5 | // 6 | // constants 7 | // 8 | export const healthCareServiceResourceType = 'HealthcareService'; 9 | 10 | // form constants 11 | export const id = 'id' as const; 12 | export const identifier = 'identifier' as const; 13 | export const name = 'name' as const; 14 | export const active = 'active' as const; 15 | export const comment = 'comment' as const; 16 | export const extraDetails = 'extraDetails' as const; 17 | export const providedBy = 'providedBy' as const; 18 | -------------------------------------------------------------------------------- /packages/rbac/README.md: -------------------------------------------------------------------------------- 1 | # Role Based Access Control (RBAC) 2 | 3 | opensrp-web's Role based access control implementation. 4 | 5 | **Dependencies** 6 | 7 | 1. The opensrp store 8 | 2. Session-reducer 9 | 3. pkg-config 10 | 11 | **Parts/Sub-modules** 12 | 13 | - The Role definition - defines how a role will be represented internally in the code. 14 | - Adapters - Utils that define how IAM-centric role information is translated to the recognized role language above. 15 | - Rbac HOC - a wrapper component that will be used to wrap around ui components that require access control. 16 | 17 | ## Installation 18 | 19 | ```sh 20 | yarn add @opensrp/rbac 21 | ``` 22 | -------------------------------------------------------------------------------- /app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "esModuleInterop": true, 12 | "allowSyntheticDefaultImports": true, 13 | "strict": true, 14 | "forceConsistentCasingInFileNames": true, 15 | "module": "esnext", 16 | "moduleResolution": "node", 17 | "resolveJsonModule": true, 18 | "isolatedModules": true, 19 | "noEmit": true, 20 | "jsx": "react-jsx", 21 | "noFallthroughCasesInSwitch": true 22 | }, 23 | "include": [ 24 | "src" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /.github/workflows/docker-docs.yml: -------------------------------------------------------------------------------- 1 | name: Update Docker Hub Documentation 2 | 3 | on: 4 | push: 5 | paths: 6 | - "docs/fhir-web-docker-deployment.md" 7 | branches: 8 | - master 9 | 10 | jobs: 11 | update-docker-hub-documentation: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | 16 | - name: Update Docker Hub ReadMe 17 | uses: peter-evans/dockerhub-description@v3 18 | with: 19 | username: ${{ secrets.DOCKER_USERNAME }} 20 | password: ${{ secrets.DOCKER_PASSWORD }} 21 | repository: opensrp/web 22 | readme-filepath: docs/fhir-web-docker-deployment.md 23 | -------------------------------------------------------------------------------- /packages/fhir-group-management/src/helpers/tests/utils.test.ts: -------------------------------------------------------------------------------- 1 | import { cloneDeep } from 'lodash'; 2 | import { firstTwentyEusmCommodities } from '../../components/CommodityList/Eusm/tests/fixtures'; 3 | import { getCharacteristicWithCoding, photoUploadCharacteristicCoding } from '../utils'; 4 | 5 | test('get characteristic with provided coding works correctly', () => { 6 | const groupResource = cloneDeep(firstTwentyEusmCommodities.entry[0].resource); 7 | 8 | const character = getCharacteristicWithCoding( 9 | groupResource.characteristic, 10 | photoUploadCharacteristicCoding 11 | ); 12 | 13 | expect(character).toEqual(groupResource.characteristic[5]); 14 | }); 15 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/react-utils/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "404": "", 3 | "Actions": "", 4 | "Class": "", 5 | "Date created": "", 6 | "Error": "", 7 | "Fetching next page": "", 8 | "Go back": "", 9 | "Go home": "", 10 | "ID": "", 11 | "Load more options": "", 12 | "No data": "", 13 | "No data available": "", 14 | "Search": "", 15 | "Showing {{recordsFetchedNum}}; {{remainingRecords}} more records.": "", 16 | "Something went wrong": "", 17 | "Sorry, the resource you requested for, does not exist": "", 18 | "Sorry, you are not authorized to access this page": "", 19 | "status": "", 20 | "Unable to load dropdown options.": "", 21 | "View details": "" 22 | } 23 | -------------------------------------------------------------------------------- /packages/fhir-client/src/helpers/testUtils.tsx: -------------------------------------------------------------------------------- 1 | import { mount, MountRendererProps } from 'enzyme'; 2 | import React from 'react'; 3 | import { QueryClient, QueryClientProvider } from 'react-query'; 4 | 5 | const queryClient = new QueryClient(); 6 | 7 | /** 8 | * wrapper to add providers when mounting components with tests 9 | * 10 | * @param component - child component 11 | * @param options - mount wrapper options 12 | */ 13 | export const mountWithProviders: typeof mount = ( 14 | component: React.ReactNode, 15 | options?: MountRendererProps 16 | ) => { 17 | return mount( 18 | {component}, 19 | options 20 | ); 21 | }; 22 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/fhir-views/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "{{val, datetime}}": "{{val, datetime}}", 3 | "Actions": "Actions", 4 | "Create questionnaire": "Create questionnaire", 5 | "date": "date", 6 | "Date authored": "Date authored", 7 | "Edit": "Edit", 8 | "Fill form": "Fill form", 9 | "Name/Id": "Name/Id", 10 | "Problem loading questionnaire": "Problem loading questionnaire", 11 | "Publisher": "Publisher", 12 | "Questionnaire list view": "Questionnaire list view", 13 | "QuestionnaireVersion": "QuestionnaireVersion", 14 | "Status": "Status", 15 | "Submission Id": "Submission Id", 16 | "Version": "Version", 17 | "View Questionnaire Responses": "View Questionnaire Responses" 18 | } 19 | -------------------------------------------------------------------------------- /app/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | %REACT_APP_WEBSITE_NAME% 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /packages/fhir-import/src/containers/ImportDetailView/tests/__snapshots__/index.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Care Teams list view renders correctly: innerDetailsText 1`] = ` 4 | "orgToLocationAssignmentcompletedID: 26aae779-0e6f-482d-82c3-a0fad1fd3689_orgToLocationAssignmentDate Created7/4/2024, 12:26:51 PMWorkflow typeorgToLocationAssignmentDate Started7/4/2024, 12:26:51 PMDate Ended7/4/2024, 12:26:53 PMAuthorLog OutputProgress::Reading csv 5 | Start time: 15:26:53 6 | Starting csv import... 7 | Reading csv file 8 | Returning records from csv file 9 | Unsupported request! 10 | { \\"final-response\\": } 11 | End time: 15:26:53 12 | Total time: 0.002815 seconds 13 | " 14 | `; 15 | -------------------------------------------------------------------------------- /packages/fhir-resources/src/QuestionnaireResponse/tests/fixtures/index.ts: -------------------------------------------------------------------------------- 1 | import { IQuestionnaireResponse } from '@smile-cdr/fhirts/dist/FHIR-R4/interfaces/IQuestionnaireResponse'; 2 | 3 | export const openChoiceQuestRes = { 4 | resourceType: 'QuestionnaireResponse', 5 | status: 'in-progress', 6 | questionnaire: 'Questionnaire/123', 7 | id: '321', 8 | item: [ 9 | { 10 | linkId: '/G1/Q4', 11 | text: 'What pizza toppings would you like?', 12 | answer: [ 13 | { 14 | item: [{ linkId: '/G1/Q4-help', text: 'Favorite toppings' }], 15 | valueCoding: { code: 'Ham', display: 'Ham' }, 16 | }, 17 | ], 18 | }, 19 | ], 20 | } as unknown as IQuestionnaireResponse; 21 | -------------------------------------------------------------------------------- /scripts/helm-envs-checker/readme.md: -------------------------------------------------------------------------------- 1 | # Helm envs checker 2 | 3 | This script uses typescript parser to extract expected envs for the codebases i.e. the react app and the express app. It then counterchecks these with the envs that are already listed on our official helm envs. 4 | 5 | It generates a report for envs that are: 6 | 7 | - in the code's repositories but not added as part of helm 8 | - Already added to helm but no longer part of the code's repositories 9 | 10 | ## Usage 11 | 12 | ```shell 13 | cd scripts/helm-envs-checker 14 | 15 | # enable corepack for better node js package manager UX 16 | corepack enable 17 | 18 | # install this script dependency 19 | yarn install 20 | 21 | # run the script 22 | ./cli.js 23 | ``` 24 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/fhir-care-team/ar.json: -------------------------------------------------------------------------------- 1 | { 2 | "Active": "", 3 | "An error occurred": "", 4 | "Are you sure you want to delete this Care Team?": "", 5 | "Cancel": "", 6 | "Create Care Team": "", 7 | "Delete": "", 8 | "Edit": "", 9 | "Edit Care Team": "", 10 | "FHIR Care Team": "", 11 | "Identifier": "", 12 | "Inactive": "", 13 | "Name": "", 14 | "Name is Required": "", 15 | "No": "", 16 | "Participant": "", 17 | "Save": "", 18 | "Saving": "", 19 | "Status": "", 20 | "Subject": "", 21 | "Successfully Added Care Teams": "", 22 | "Successfully Deleted Care Team": "", 23 | "Successfully Updated Care Teams": "", 24 | "This is a required field": "", 25 | "UUID": "", 26 | "Yes": "" 27 | } 28 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/fhir-care-team/ar.json: -------------------------------------------------------------------------------- 1 | { 2 | "Active": "", 3 | "An error occurred": "", 4 | "Are you sure you want to delete this Care Team?": "", 5 | "Cancel": "", 6 | "Create Care Team": "", 7 | "Delete": "", 8 | "Edit": "", 9 | "Edit Care Team": "", 10 | "FHIR Care Team": "", 11 | "Identifier": "", 12 | "Inactive": "", 13 | "Name": "", 14 | "Name is Required": "", 15 | "No": "", 16 | "Participant": "", 17 | "Save": "", 18 | "Saving": "", 19 | "Status": "", 20 | "Subject": "", 21 | "Successfully Added Care Teams": "", 22 | "Successfully Deleted Care Team": "", 23 | "Successfully Updated Care Teams": "", 24 | "This is a required field": "", 25 | "UUID": "", 26 | "Yes": "" 27 | } 28 | -------------------------------------------------------------------------------- /app/src/configs/utils.ts: -------------------------------------------------------------------------------- 1 | /** Returns a value in window._env_ or process.env or the defaultValue passed in. 2 | * 3 | * @param name - The configurable name that is a property of the environment/configuration. 4 | * @param defaultValue - The default value to return the value is not defined in process.env and window._env_. 5 | */ 6 | export const setEnv = (name: string, defaultValue: any) => { 7 | const { [name]: envValue } = process.env; 8 | const value = typeof envValue === 'undefined' ? defaultValue : envValue; 9 | 10 | if (typeof (window as any)._env_ === 'undefined') { 11 | return value; 12 | } 13 | const { [name]: confValue } = (window as any)._env_; 14 | 15 | return confValue === undefined ? value : confValue; 16 | }; 17 | -------------------------------------------------------------------------------- /packages/fhir-import/src/containers/ImportListView/tests/fixtures.tsx: -------------------------------------------------------------------------------- 1 | export const workflows = [ 2 | { 3 | workflowId: '26aae779-0e6f-482d-82c3-a0fad1fd3689_orgToLocationAssignment', 4 | status: 'completed', 5 | workflowType: 'orgToLocationAssignment', 6 | dateCreated: 1720096011433, 7 | dateStarted: 1720096011435, 8 | dateEnded: 1720096013898, 9 | statusReason: { 10 | stdout: 'Progress::Reading csv \n', 11 | stderr: 12 | 'Start time: 15:26:53\nStarting csv import...\nReading csv file\nReturning records from csv file\nUnsupported request!\n{ "final-response": }\nEnd time: 15:26:53\nTotal time: 0.002815 seconds\n', 13 | }, 14 | filename: 'organizations_locations.csv', 15 | }, 16 | ]; 17 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/fhir-care-team/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "Active": "", 3 | "An error occurred": "", 4 | "Are you sure you want to delete this Care Team?": "", 5 | "Cancel": "", 6 | "Create Care Team": "", 7 | "Delete": "", 8 | "Edit": "", 9 | "Edit Care Team | {{name}}": "", 10 | "FHIR Care Team": "", 11 | "Identifier": "", 12 | "Inactive": "", 13 | "Name": "", 14 | "Name is Required": "", 15 | "No": "", 16 | "Participant": "", 17 | "Save": "", 18 | "Saving": "", 19 | "Status": "", 20 | "Subject": "", 21 | "Successfully Added Care Teams": "", 22 | "Successfully Deleted Care Team": "", 23 | "Successfully Updated Care Teams": "", 24 | "This is a required field": "", 25 | "UUID": "", 26 | "Yes": "" 27 | } 28 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/fhir-views/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "{{val, datetime}}": "{{val, datetime}}", 3 | "Actions": "Actions", 4 | "Create questionnaire": "Créer un questionnaire", 5 | "date": "date", 6 | "Date authored": "Date de la création", 7 | "Edit": "Modifier", 8 | "Fill form": "Remplir le formulaire", 9 | "Name/Id": "Nom/Id", 10 | "Problem loading questionnaire": "Problème de chargement du questionnaire", 11 | "Publisher": "Éditeur", 12 | "Questionnaire list view": "Voir la liste des questionnaires", 13 | "QuestionnaireVersion": "Version du questionnaire", 14 | "Status": "Statut", 15 | "Submission Id": "Id de la soumission", 16 | "Version": "Version", 17 | "View Questionnaire Responses": "Afficher les réponses du questionnaire" 18 | } 19 | -------------------------------------------------------------------------------- /packages/opensrp-store/src/store/tests/ducks/random.ts: -------------------------------------------------------------------------------- 1 | import { AnyAction } from 'redux'; 2 | 3 | export const reducerName = 'random'; 4 | 5 | const initialState = ''; 6 | 7 | // actions 8 | export const SET_RANDOM = 'reveal-test/reducer/SET_RANDOM'; 9 | 10 | /** 11 | * 12 | * @param {initialState} state The initial value 13 | * @param {AnyAction} action - should have type or payload 14 | * @returns {Object} object be used to initialize a Redux store 15 | */ 16 | export default function reducer(state = initialState, action: AnyAction): string { 17 | switch (action.type) { 18 | case SET_RANDOM: 19 | if (action.payload) { 20 | return action.payload; 21 | } 22 | return state; 23 | default: 24 | return state; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/react-utils/src/components/Resource404/tests/index.test.tsx: -------------------------------------------------------------------------------- 1 | import { mount } from 'enzyme'; 2 | import React from 'react'; 3 | import { Resource404 } from '..'; 4 | import { createBrowserHistory } from 'history'; 5 | import { Router } from 'react-router'; 6 | 7 | const history = createBrowserHistory(); 8 | 9 | describe('broken page', () => { 10 | it('renders correctly', () => { 11 | const mockBack = jest.fn(); 12 | history.goBack = mockBack; 13 | const wrapper = mount( 14 | 15 | 16 | 17 | ); 18 | 19 | expect(wrapper.text()).toMatchInlineSnapshot( 20 | `"404Sorry, the resource you requested for, does not existGo backGo home"` 21 | ); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/fhir-flag/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "(Auto generated)": "", 3 | "Active": "", 4 | "An error occurred while fetching the inventory": "", 5 | "Close App": "", 6 | "Error Occurred When Closing Flag": "", 7 | "Error occurred while trying to fetch flag data": "", 8 | "Error occurred while trying to fetch practitioners data": "", 9 | "Flag Closed successfully": "", 10 | "How was the flag resolved?": "", 11 | "Inactive": "", 12 | "Invalid Flag": "", 13 | "Missing location field. This information is required to close the flag form.": "", 14 | "Missing Required permissions to perform this action": "", 15 | "Product": "", 16 | "Save": "", 17 | "Saving": "", 18 | "Select flag status": "", 19 | "Service Point": "", 20 | "Status": "" 21 | } 22 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/fhir-flag/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "(Auto generated)": "", 3 | "Active": "", 4 | "An error occurred while fetching the inventory": "", 5 | "Close App": "", 6 | "Error Occurred When Closing Flag": "", 7 | "Error occurred while trying to fetch flag data": "", 8 | "Error occurred while trying to fetch practitioners data": "", 9 | "Flag Closed successfully": "", 10 | "How was the flag resolved?": "", 11 | "Inactive": "", 12 | "Invalid Flag": "", 13 | "Missing location field. This information is required to close the flag form.": "", 14 | "Missing Required permissions to perform this action": "", 15 | "Product": "", 16 | "Save": "", 17 | "Saving": "", 18 | "Select flag status": "", 19 | "Service Point": "", 20 | "Status": "" 21 | } 22 | -------------------------------------------------------------------------------- /packages/react-utils/src/components/fhirDataTypes/Coding/index.tsx: -------------------------------------------------------------------------------- 1 | import { Coding as TCoding } from '@smile-cdr/fhirts/dist/FHIR-R4/classes/coding'; 2 | import { Typography } from 'antd'; 3 | import React from 'react'; 4 | 5 | const { Text } = Typography; 6 | 7 | export interface CodingProps { 8 | coding: TCoding; 9 | } 10 | 11 | export const Coding = (props: CodingProps) => { 12 | const { display, system, code } = props.coding; 13 | let valueStr = ''; 14 | 15 | if (display) { 16 | valueStr += display; 17 | } 18 | if (system) { 19 | let systemStr = system ? `${system}|` : ''; 20 | systemStr = systemStr ? `(${systemStr}${code ? code : ''})` : ''; 21 | valueStr += systemStr; 22 | } 23 | return {valueStr}; 24 | }; 25 | -------------------------------------------------------------------------------- /packages/fhir-care-team/src/index.css: -------------------------------------------------------------------------------- 1 | .bg-white { 2 | background-color: white; 3 | } 4 | 5 | .p-3 { 6 | padding: 1rem; 7 | } 8 | 9 | .p-4 { 10 | padding: 1.5rem; 11 | } 12 | 13 | .pl-3 { 14 | padding-left: 1rem; 15 | } 16 | 17 | .mb-3 { 18 | margin-bottom: 1rem; 19 | } 20 | 21 | .mb-4 { 22 | margin-bottom: 1.5rem; 23 | } 24 | 25 | .mt-4 { 26 | margin-top: 1.5rem; 27 | } 28 | 29 | .m-0 { 30 | margin: 0px; 31 | } 32 | 33 | .p-1 { 34 | padding: 0.25rem; 35 | } 36 | 37 | .d-flex { 38 | display: flex; 39 | } 40 | 41 | .justify-content-between { 42 | justify-content: space-between; 43 | } 44 | 45 | .float-right { 46 | float: right; 47 | } 48 | 49 | .font-weight-bold { 50 | font-weight: bold; 51 | } 52 | 53 | .small { 54 | font-size: 80%; 55 | font-weight: 400; 56 | } 57 | -------------------------------------------------------------------------------- /packages/react-utils/src/components/ButtonLink/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { HTMLAttributes } from 'react'; 2 | import { Button } from 'antd'; 3 | import { useHistory } from 'react-router'; 4 | 5 | /*** 6 | * Simple button, type link supposed to be used for navigation 7 | */ 8 | 9 | export interface ButtonProps extends HTMLAttributes { 10 | name: string; 11 | route: string; 12 | } 13 | 14 | const ButtonLink = (props: ButtonProps) => { 15 | const history = useHistory(); 16 | const { name, route, className } = props; 17 | 18 | const handleClick = () => { 19 | history.push(route); 20 | }; 21 | 22 | return ( 23 | 26 | ); 27 | }; 28 | 29 | export { ButtonLink }; 30 | -------------------------------------------------------------------------------- /packages/template/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## 0.0.6 (2021-02-24) 7 | 8 | **Note:** Version bump only for package @opensrp/template 9 | 10 | ## 0.0.5 (2021-02-18) 11 | 12 | **Note:** Version bump only for package @opensrp/template 13 | 14 | ## 0.0.4 (2020-11-12) 15 | 16 | **Note:** Version bump only for package @opensrp/template 17 | 18 | ## 0.0.3 (2020-11-05) 19 | 20 | **Note:** Version bump only for package @opensrp/template 21 | 22 | ## 0.0.2 (2020-11-02) 23 | 24 | **Note:** Version bump only for package @opensrp/template 25 | 26 | ## 0.0.1 (2020-11-02) 27 | 28 | **Note:** Version bump only for package @opensrp/template 29 | -------------------------------------------------------------------------------- /packages/keycloak-user-management/src/components/UserList/tests/__snapshots__/index.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`components/UserList renders user list correctly: header actions col props 1`] = `"Add UserFirst NameLast NameUsernameActionsBenjaminMwalimumwalimuEditOnakenyaonaEditOnaAdminona-adminEditDemokenyaopensrpEdit120 / page"`; 4 | 5 | exports[`components/UserList renders user list correctly: table text 1`] = `"First NameLast NameUsernameActionsBenjaminMwalimumwalimuEditOnakenyaonaEditOnaAdminona-adminEditDemokenyaopensrpEdit"`; 6 | 7 | exports[`components/UserList works correctly with store: full rendered text 1`] = `"User ManagementAdd UserFirst NameLast NameUsernameActionsBenjaminMwalimumwalimuEditOnakenyaonaEditOnaAdminona-adminEditDemokenyaopensrpEdit120 / page"`; 8 | -------------------------------------------------------------------------------- /nx.json: -------------------------------------------------------------------------------- 1 | { 2 | "tasksRunnerOptions": { 3 | "default": { 4 | "runner": "nx/tasks-runners/default", 5 | "options": { 6 | "cacheableOperations": [ 7 | "build", 8 | "test", 9 | "test:watch", 10 | "lint", 11 | "lint-snap", 12 | "tsc", 13 | "copy", 14 | "transpile", 15 | "jest" 16 | ] 17 | } 18 | } 19 | }, 20 | "targetDefaults": { 21 | "build": { 22 | "dependsOn": ["^build"], 23 | "outputs": ["{projectRoot}/build"] 24 | }, 25 | "tsc": { 26 | "outputs": ["{projectRoot}/dist"] 27 | }, 28 | "copy": { 29 | "outputs": ["{projectRoot}/dist"] 30 | }, 31 | "transpile": { 32 | "outputs": ["{projectRoot}/dist/types"] 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /packages/fhir-import/src/containers/StartImportView/tests/__snapshots__/index.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`renders correctly: textContent 1`] = `"Step by step guide for bulk uploadFollow these simple instructions to help you prepare, upload, and verify your data smoothly and efficiently1Prepare your data fileClick the button below to download the bulk upload template file(s).Download TemplateEnter your data into the template file. Ensure all required fields are filled and follow the specified format(e.g. date format)Check for any data inconsistencies or errors (e.g. missing values, incorrect data types) before uploading2Upload your data fileClick the \\"Attach\\" button to select your prepared data file.Once the file or files are selected, click \\"Start Import\\" to begin the upload"`; 4 | -------------------------------------------------------------------------------- /packages/keycloak-user-management/src/components/UserList/tests/utils.test.tsx: -------------------------------------------------------------------------------- 1 | import { getTableColumns } from '../utils'; 2 | 3 | const translator = (t) => t; 4 | 5 | describe('components/UserList/utils/getTableColumns', () => { 6 | const sortedInfo = { 7 | column: { title: 'First Name', dataIndex: 'firstName', key: 'firstName', ellipsis: true }, 8 | order: 'ascend', 9 | field: 'firstName', 10 | columnKey: 'firstName', 11 | }; 12 | 13 | it('builds table columns correctly', () => { 14 | expect(getTableColumns(translator, undefined)).toMatchSnapshot('table columns'); 15 | }); 16 | it('builds table columns correctly with sorted info', () => { 17 | expect(getTableColumns(translator, sortedInfo)).toMatchSnapshot( 18 | 'table columns with sorted info' 19 | ); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /packages/fhir-import/src/components/statusTag.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Tag } from 'antd'; 3 | import { JobStatus } from '../helpers/utils'; 4 | 5 | export const ImportStatusTag = ({ statusString }: { statusString: JobStatus }) => { 6 | const tagStatusColor = getStatusColor(statusString); 7 | return {statusString}; 8 | }; 9 | 10 | /** 11 | * @param statusString - get tag status color for a job status 12 | */ 13 | export function getStatusColor(statusString: JobStatus) { 14 | switch (statusString) { 15 | case 'completed': 16 | return 'success'; 17 | case 'active': 18 | return 'processing'; 19 | case 'failed': 20 | return 'error'; 21 | case 'paused': 22 | return 'warning'; 23 | default: 24 | return 'default'; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/fhir-import/src/containers/StartImportView/tests/__snapshots__/formInstruction.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`renders correctly: textContent 1`] = `"Step by step guide for bulk uploadFollow these simple instructions to help you prepare, upload, and verify your data smoothly and efficiently1Prepare your data fileClick the button below to download the bulk upload template file(s).Download TemplateEnter your data into the template file. Ensure all required fields are filled and follow the specified format(e.g. date format)Check for any data inconsistencies or errors (e.g. missing values, incorrect data types) before uploading2Upload your data fileClick the \\"Attach\\" button to select your prepared data file.Once the file or files are selected, click \\"Start Import\\" to begin the upload"`; 4 | -------------------------------------------------------------------------------- /packages/fhir-location-management/src/components/AddEditLocationUnit/core.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { BaseNewEditLocationUnit, BaseNewEditLocationUnitProps } from './base'; 3 | import { URL_LOCATION_UNIT, serviceType } from '../../constants'; 4 | 5 | export type NewEditLocationUnitProps = BaseNewEditLocationUnitProps; 6 | 7 | /** 8 | * renders page where user can create new location unit 9 | * 10 | * @param props - this components props 11 | */ 12 | export const NewEditLocationUnit = (props: NewEditLocationUnitProps) => { 13 | const baseNewEditViewProps = { 14 | ...props, 15 | successURLGenerator: () => URL_LOCATION_UNIT, 16 | cancelURLGenerator: () => URL_LOCATION_UNIT, 17 | hidden: [serviceType], 18 | }; 19 | 20 | return ; 21 | }; 22 | -------------------------------------------------------------------------------- /app/src/containers/ConnectedSidebar/index.tsx: -------------------------------------------------------------------------------- 1 | import { getUser, isAuthenticated, getExtraData } from '@onaio/session-reducer'; 2 | import { connect } from 'react-redux'; 3 | import { Store } from 'redux'; 4 | import Sidebar from '../../components/page/Sidebar'; 5 | 6 | /** Connect the component to the store */ 7 | 8 | /** map state to props */ 9 | const mapStateToProps = (state: Partial) => { 10 | const result = { 11 | authenticated: isAuthenticated(state), 12 | user: getUser(state), 13 | extraData: getExtraData(state), 14 | }; 15 | return result; 16 | }; 17 | 18 | const mapDispatchToProps = {}; 19 | 20 | /** create connected component */ 21 | 22 | /** Connected Sidebar component 23 | */ 24 | const ConnectedSidebar = connect(mapStateToProps, mapDispatchToProps)(Sidebar); 25 | 26 | export default ConnectedSidebar; 27 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/team-management/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "Active": "", 3 | "An error occurred": "", 4 | "Assigned Locations": "", 5 | "Assigning Practitioners": "", 6 | "Cancel": "", 7 | "Create": "", 8 | "Create Team": "", 9 | "Edit": "", 10 | "Edit Team | {{name}}": "", 11 | "Enter a team name": "", 12 | "Identifier": "", 13 | "Inactive": "", 14 | "Name": "", 15 | "No team members": "", 16 | "Save": "", 17 | "Saving": "", 18 | "Select users (practitioners only)": "", 19 | "Status": "", 20 | "Successfully Added Teams": "", 21 | "Successfully Assigned Practitioners": "", 22 | "Successfully Updated Teams": "", 23 | "Team Members": "", 24 | "Team Name": "", 25 | "Teams": "", 26 | "This is a required field": "", 27 | "This team is not assigned to any Location": "", 28 | "View details": "" 29 | } 30 | -------------------------------------------------------------------------------- /packages/react-utils/src/components/GenericDetailsView/index.css: -------------------------------------------------------------------------------- 1 | .details-section { 2 | display: flex; 3 | flex-direction: column; 4 | align-items: flex-start; 5 | padding: 16px; 6 | gap: 16px; 7 | background: #FAFAFA; 8 | border-radius: 6px; 9 | } 10 | 11 | .details-section .header-top { 12 | display: flex; 13 | flex-direction: row; 14 | justify-content: space-between; 15 | } 16 | 17 | .header-top .title { 18 | font-size: 16px; 19 | font-weight: 600; 20 | } 21 | 22 | .header-top .status { 23 | padding: 2px 6px; 24 | margin-left: 8px; 25 | } 26 | 27 | .details-section .header-bottom { 28 | display: flex; 29 | flex-direction: row; 30 | gap: 32px; 31 | justify-content: space-between; 32 | width: 100%; 33 | } 34 | 35 | .details-section .divider { 36 | margin: 0; 37 | } -------------------------------------------------------------------------------- /packages/i18n/locales/core/team-management/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "Actions": "", 3 | "Active": "", 4 | "An error occurred": "", 5 | "Assigned Locations": "", 6 | "Assigning Practitioners": "", 7 | "Cancel": "", 8 | "Create": "", 9 | "Create Team": "", 10 | "Edit": "", 11 | "Edit Team | {{name}}": "", 12 | "Enter a team name": "", 13 | "Identifier": "", 14 | "Inactive": "", 15 | "Name": "", 16 | "No team members": "", 17 | "Save": "", 18 | "Saving": "", 19 | "Select users (practitioners only)": "", 20 | "Status": "", 21 | "Successfully Added Teams": "", 22 | "Successfully Assigned Practitioners": "", 23 | "Successfully Updated Teams": "", 24 | "Team Members": "", 25 | "Team Name": "", 26 | "Teams": "", 27 | "This is a required field": "", 28 | "This team is not assigned to any Location": "", 29 | "View details": "" 30 | } 31 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/team-management/ar.json: -------------------------------------------------------------------------------- 1 | { 2 | "Actions": "", 3 | "Active": "", 4 | "An error occurred": "", 5 | "Assigned Locations": "", 6 | "Assigning Practitioners": "", 7 | "Cancel": "", 8 | "Create": "", 9 | "Create Team": "", 10 | "Edit": "", 11 | "Edit Team": "", 12 | "Enter a team name": "", 13 | "Identifier": "", 14 | "Inactive": "", 15 | "Name": "", 16 | "No team members": "", 17 | "Save": "", 18 | "Saving": "", 19 | "Search": "", 20 | "Select user (practitioners only)": "", 21 | "Status": "", 22 | "Successfully Added Teams": "", 23 | "Successfully Assigned Practitioners": "", 24 | "Successfully Updated Teams": "", 25 | "Team Members": "", 26 | "Team Name": "", 27 | "Teams": "", 28 | "This is a required field": "", 29 | "This team is not assigned to any Location": "", 30 | "View details": "" 31 | } 32 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/team-management/ar.json: -------------------------------------------------------------------------------- 1 | { 2 | "Actions": "", 3 | "Active": "", 4 | "An error occurred": "", 5 | "Assigned Locations": "", 6 | "Assigning Practitioners": "", 7 | "Cancel": "", 8 | "Create": "", 9 | "Create Team": "", 10 | "Edit": "", 11 | "Edit Team": "", 12 | "Enter a team name": "", 13 | "Identifier": "", 14 | "Inactive": "", 15 | "Name": "", 16 | "No team members": "", 17 | "Save": "", 18 | "Saving": "", 19 | "Search": "", 20 | "Select user (practitioners only)": "", 21 | "Status": "", 22 | "Successfully Added Teams": "", 23 | "Successfully Assigned Practitioners": "", 24 | "Successfully Updated Teams": "", 25 | "Team Members": "", 26 | "Team Name": "", 27 | "Teams": "", 28 | "This is a required field": "", 29 | "This team is not assigned to any Location": "", 30 | "View details": "" 31 | } 32 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/team-management/vi.json: -------------------------------------------------------------------------------- 1 | { 2 | "Actions": "", 3 | "Active": "", 4 | "An error occurred": "", 5 | "Assigned Locations": "", 6 | "Assigning Practitioners": "", 7 | "Cancel": "", 8 | "Create": "", 9 | "Create Team": "", 10 | "Edit": "", 11 | "Edit Team": "", 12 | "Enter a team name": "", 13 | "Identifier": "", 14 | "Inactive": "", 15 | "Name": "", 16 | "No team members": "", 17 | "Save": "", 18 | "Saving": "", 19 | "Search": "", 20 | "Select user (practitioners only)": "", 21 | "Status": "", 22 | "Successfully Added Teams": "", 23 | "Successfully Assigned Practitioners": "", 24 | "Successfully Updated Teams": "", 25 | "Team Members": "", 26 | "Team Name": "", 27 | "Teams": "", 28 | "This is a required field": "", 29 | "This team is not assigned to any Location": "", 30 | "View details": "" 31 | } 32 | -------------------------------------------------------------------------------- /packages/fhir-client/src/components/PatientDetails/PopulatedTableTabs/tests/__snapshots__/index.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Condition tab renders correctly 1`] = `"77386006confirmedID: 349d8947-3009-4fb3-b3d5-99ff30aa5614CategorystageOnset dateClinical statusactiveView full details"`; 4 | 5 | exports[`Patient encounter tab renders correctly 1`] = `"AMBfinishedID: a1f3a048-8863-42b7-9d2e-2e9efbbca9a8ReasonPeriodInvalid Date-Invalid DateService Type581Episode of careView full details"`; 6 | 7 | exports[`Task tab renders correctly 1`] = `"Hygiene VisitcompletedID: 14205Period9/30/2021-10/1/2021PriorityStatuscompletedIntentorderView full details"`; 8 | 9 | exports[`immunization encounter tab renders correctly 1`] = `"SARSCoV2 mRNA vaccinecompletedID: 979Date recorded7/29/2021protocol applied1statuscompletedReasonView full details"`; 10 | -------------------------------------------------------------------------------- /packages/keycloak-user-management/src/components/UserGroupsList/tests/__snapshots__/index.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`components/UserGroupsList renders user list correctly: full table body has 4 user group entries 1`] = `"AdminEditNew GroupEditSuper UserEditTest User GroupEdit"`; 4 | 5 | exports[`components/UserGroupsList renders user list correctly: header actions col props 1`] = `"New User GroupNameActionsAdminEditNew GroupEditSuper UserEditTest User GroupEdit15 / page"`; 6 | 7 | exports[`components/UserGroupsList renders user list correctly: table text 1`] = `"NameActionsAdminEditNew GroupEditSuper UserEditTest User GroupEdit"`; 8 | 9 | exports[`components/UserGroupsList works correctly with store: full rendered text 1`] = `"User GroupsNew User GroupNameActionsAdminEditNew GroupEditSuper UserEditTest User GroupEdit15 / page"`; 10 | -------------------------------------------------------------------------------- /packages/fhir-client/src/components/PatientDetails/ResourceSchema/MedicationStatement.tsx: -------------------------------------------------------------------------------- 1 | import { IMedicationStatement } from '@smile-cdr/fhirts/dist/FHIR-R4/interfaces/IMedicationStatement'; 2 | import { get } from 'lodash'; 3 | import type { TFunction } from '@opensrp/i18n'; 4 | 5 | export const parseMedicationStatement = (obj: IMedicationStatement) => { 6 | return { 7 | status: get(obj, 'status'), 8 | id: get(obj, 'id'), 9 | dateAsserted: get(obj, 'dateAsserted'), 10 | }; 11 | }; 12 | 13 | export type MedicationStatementTableData = ReturnType; 14 | 15 | export const columns = (t: TFunction) => [ 16 | { 17 | title: 'Id', 18 | dataIndex: 'id', 19 | }, 20 | { 21 | title: 'Status', 22 | dataIndex: 'status', 23 | }, 24 | { 25 | title: t('Date asserted'), 26 | dataIndex: 'dateAsserted', 27 | }, 28 | ]; 29 | -------------------------------------------------------------------------------- /packages/error-boundary-fallback/README.md: -------------------------------------------------------------------------------- 1 | # Error Boundary Fallback 2 | 3 | This package provides a fallback component which you can use as an error boundary fallback. 4 | 5 | ## Installation 6 | 7 | ```node 8 | yarn add @opensrp/error-boundary-fallback 9 | ``` 10 | 11 | ## Usage 12 | 13 | `error-boundary-fallback` makes use of the following options 14 | 15 | - **homeUrl:**(string) 16 | - **required** 17 | - URL to redirect after clicking on back to home button 18 | 19 | #### Code example 20 | 21 | ```javascript 22 | import App from '..'; 23 | import * as Sentry from '@sentry/react'; 24 | import { ErrorBoundaryFallback } from '@opensrp/error-boundary-fallback'; 25 | 26 | ReactDOM.render( 27 | }> 28 | 29 | , 30 | document.getElementById('root') 31 | ); 32 | ``` 33 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/app/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "404!": "", 3 | "Administration": "", 4 | "All Locations": "", 5 | "Care Teams Management": "", 6 | "Commodity Management": "", 7 | "Data Imports": "", 8 | "Group Management": "", 9 | "Healthcare Services": "", 10 | "Hierarchy": "", 11 | "Location Management": "", 12 | "Login": "", 13 | "Logout": "", 14 | "Manage account": "", 15 | "Missing the required permissions to view data on this page": "", 16 | "OpenSRP Web": "", 17 | "Organization Assignment": "", 18 | "Organization Management": "", 19 | "Organizations": "", 20 | "Patients": "", 21 | "Questionnaire Management": "", 22 | "Service Points Inventory": "", 23 | "There was a problem logging out. Please try again.": "", 24 | "User Groups": "", 25 | "User Management": "", 26 | "User Roles": "", 27 | "Users": "", 28 | "Welcome to OpenSRP": "" 29 | } 30 | -------------------------------------------------------------------------------- /packages/fhir-location-management/src/ducks/tests/location-tree-state.test.ts: -------------------------------------------------------------------------------- 1 | import { reducerName, reducer, setSelectedNode, getSelectedNode } from '../location-tree-state'; 2 | import reducerRegistry from '@onaio/redux-reducer-registry'; 3 | import { convertApiResToTree } from '../../helpers/utils'; 4 | import { fhirHierarchy } from '../tests/fixtures'; 5 | import { store } from '@opensrp/store'; 6 | 7 | reducerRegistry.register(reducerName, reducer); 8 | 9 | const node = convertApiResToTree(fhirHierarchy); 10 | 11 | describe('src/ducks/location-state', () => { 12 | it('selects the correct data', () => { 13 | let result = getSelectedNode(store.getState()); 14 | expect(result).toBeUndefined(); 15 | 16 | store.dispatch(setSelectedNode(node)); 17 | result = getSelectedNode(store.getState()); 18 | expect(result.model.node.name).toEqual('Root FHIR Location'); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /packages/react-utils/src/components/NoData/tests/index.test.tsx: -------------------------------------------------------------------------------- 1 | import { render } from '@testing-library/react'; 2 | import { NoData } from '..'; 3 | import React from 'react'; 4 | 5 | const props = { description: 'descriptive text' }; 6 | 7 | test('Component renders correctly', () => { 8 | const { getByText, getByTitle } = render(); 9 | 10 | expect(getByTitle(/Empty raw svg icon/)).toBeInTheDocument(); 11 | expect(getByText(/No data available/)).toBeInTheDocument(); 12 | expect(getByText(/descriptive text/i)).toBeInTheDocument(); 13 | }); 14 | 15 | test('Component Renders with children', () => { 16 | const { getByText } = render( 17 | 18 |
Additional children
19 |
20 | ); 21 | 22 | expect(getByText(/No data available/)).toBeInTheDocument(); 23 | expect(getByText(/Additional children/)).toBeInTheDocument(); 24 | }); 25 | -------------------------------------------------------------------------------- /packages/fhir-team-management/src/index.css: -------------------------------------------------------------------------------- 1 | .bg-white { 2 | background-color: white; 3 | } 4 | 5 | .p-3 { 6 | padding: 1rem; 7 | } 8 | 9 | .p-4 { 10 | padding: 1.5rem; 11 | } 12 | 13 | .pl-3 { 14 | padding-left: 1rem; 15 | } 16 | 17 | .mb-3 { 18 | margin-bottom: 1rem; 19 | } 20 | 21 | .mb-4 { 22 | margin-bottom: 1.5rem; 23 | } 24 | 25 | .mt-4 { 26 | margin-top: 1.5rem; 27 | } 28 | 29 | .m-0 { 30 | margin: 0px; 31 | } 32 | 33 | .p-1 { 34 | padding: 0.25rem; 35 | } 36 | 37 | .d-flex { 38 | display: flex; 39 | } 40 | 41 | .justify-content-between { 42 | justify-content: space-between; 43 | } 44 | 45 | .float-right { 46 | float: right; 47 | } 48 | 49 | .font-weight-bold { 50 | font-weight: bold; 51 | } 52 | 53 | .small { 54 | font-size: 80%; 55 | font-weight: 400; 56 | } 57 | 58 | .action-button{ 59 | padding: 4px 0 60 | } 61 | 62 | .full-width{ 63 | width: 100%; 64 | } 65 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/fhir-healthcare-service/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "{{val, datetime}}": "", 3 | 4 | "active": "", 5 | "Active": "", 6 | "Cancel": "", 7 | "Comment": "", 8 | "Create Care Service": "", 9 | "Create team": "", 10 | "Edit": "", 11 | "Edit team | {{name}}": "", 12 | "Enter comment": "", 13 | "Enter extra details": "", 14 | "Extra details": "", 15 | "Failed to refresh data, please refresh the page": "", 16 | "Health care service updated successfully": "", 17 | "HealthCare service list": "", 18 | "Id": "", 19 | "Identifier": "", 20 | "Inactive": "", 21 | "Last Updated": "", 22 | "Must be a valid string": "", 23 | "Name": "", 24 | "Provided by": "", 25 | "Provided By": "", 26 | "Required": "", 27 | "save": "", 28 | "Saving": "", 29 | "Select organization": "", 30 | "Status": "", 31 | "Unable to fetch organizations": "", 32 | "View Details": "" 33 | } 34 | -------------------------------------------------------------------------------- /packages/error-boundary-fallback/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## [0.0.7](https://github.com/OpenSRP/web/compare/@opensrp/error-boundary-fallback@0.0.5...@opensrp/error-boundary-fallback@0.0.7) (2021-07-26) 7 | 8 | **Note:** Version bump only for package @opensrp/error-boundary-fallback 9 | 10 | ## 0.0.4 (2021-02-24) 11 | 12 | **Note:** Version bump only for package @opensrp/error-boundary-fallback 13 | 14 | ## [0.0.3](https://github.com/OpenSRP/web/compare/@opensrp/error-boundary-fallback@0.0.2...@opensrp/error-boundary-fallback@0.0.3) (2021-02-18) 15 | 16 | **Note:** Version bump only for package @opensrp/error-boundary-fallback 17 | 18 | ## 0.0.2 (2021-02-18) 19 | 20 | **Note:** Version bump only for package @opensrp/error-boundary-fallback 21 | ` 22 | -------------------------------------------------------------------------------- /packages/fhir-location-management/src/components/AllLocationListFlat/tests/__snapshots__/index.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`location-management/src/components/AllLocationListFlat Show data as expected: table data 1`] = `"Good Health Clinic"`; 4 | 5 | exports[`location-management/src/components/AllLocationListFlat Show data as expected: table data 2`] = `""`; 6 | 7 | exports[`location-management/src/components/AllLocationListFlat Show data as expected: table data 3`] = `"Building"`; 8 | 9 | exports[`location-management/src/components/AllLocationListFlat Show data as expected: table data 4`] = `"active"`; 10 | 11 | exports[`location-management/src/components/AllLocationListFlat Show data as expected: table data 5`] = `"Edit"`; 12 | 13 | exports[`location-management/src/components/AllLocationListFlat Show data as expected: table header 1`] = `"NameParentPhysical TypeStatusActions"`; 14 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/fhir-healthcare-service/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "{{val, datetime}}": "", 3 | "Actions": "", 4 | "active": "", 5 | "Active": "", 6 | "Cancel": "", 7 | "Comment": "", 8 | "Create Care Service": "", 9 | "Create organization": "", 10 | "Edit": "", 11 | "Edit organization | {{name}}": "", 12 | "Enter comment": "", 13 | "Enter extra details": "", 14 | "Extra details": "", 15 | "Failed to refresh data, please refresh the page": "", 16 | "Health care service updated successfully": "", 17 | "HealthCare service list": "", 18 | "Id": "", 19 | "Identifier": "", 20 | "Inactive": "", 21 | "Last Updated": "", 22 | "Must be a valid string": "", 23 | "Name": "", 24 | "Provided by": "", 25 | "Provided By": "", 26 | "Required": "", 27 | "save": "", 28 | "Saving": "", 29 | "Select organization": "", 30 | "Status": "", 31 | "Unable to fetch organizations": "", 32 | "View Details": "" 33 | } 34 | -------------------------------------------------------------------------------- /app/src/containers/ConnectedHeader/index.tsx: -------------------------------------------------------------------------------- 1 | import { getUser, isAuthenticated, logOutUser, getExtraData } from '@onaio/session-reducer'; 2 | import { connect } from 'react-redux'; 3 | import { Store } from 'redux'; 4 | import Header from '../../components/page/Header'; 5 | 6 | /** Connect the component to the store */ 7 | 8 | /** map state to props 9 | * 10 | * @param {Partial} state - the redux store 11 | * @returns {Object} - the states 12 | */ 13 | const mapStateToProps = (state: Partial) => { 14 | const result = { 15 | authenticated: isAuthenticated(state), 16 | user: getUser(state), 17 | extraData: getExtraData(state), 18 | }; 19 | return result; 20 | }; 21 | 22 | const mapDispatchToProps = { logOutUser }; 23 | 24 | /** create connected component */ 25 | 26 | /** Connected Header component 27 | */ 28 | const ConnectedHeader = connect(mapStateToProps, mapDispatchToProps)(Header); 29 | 30 | export default ConnectedHeader; 31 | -------------------------------------------------------------------------------- /packages/fhir-import/src/constants.ts: -------------------------------------------------------------------------------- 1 | export const DATA_IMPORT_LIST_URL = '/import'; 2 | export const DATA_IMPORT_DETAIL_URL = '/importDetail'; 3 | export const DATA_IMPORT_CREATE_URL = '/importCreate'; 4 | 5 | export const IMPORT_ENDPOINT = '/$import'; 6 | export const IMPORT_DOMAIN_URI = ''; 7 | export const IMPORT_TEMPLATE_ENDPOINT = `${IMPORT_ENDPOINT}/templates`; 8 | 9 | export const dataImportRQueryKey = 'dataImport'; 10 | export const locations = 'locations' as const; 11 | export const users = 'users' as const; 12 | export const organizations = 'organizations' as const; 13 | export const careteams = 'careTeams' as const; 14 | export const inventories = 'inventories' as const; 15 | export const orgToLocationAssignment = 'orgToLocationAssignment' as const; 16 | export const userToOrganizationAssignment = 'userToOrganizationAssignment' as const; 17 | export const products = 'products' as const; 18 | 19 | export const defaultImportTemplateName = 'import-template'; 20 | -------------------------------------------------------------------------------- /app/src/App/App.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Helmet } from 'react-helmet'; 3 | import { Layout } from 'antd'; 4 | import { WEBSITE_NAME } from '../configs/env'; 5 | import ConnectedHeader from '../containers/ConnectedHeader'; 6 | import ConnectedSidebar from '../containers/ConnectedSidebar'; 7 | import './App.css'; 8 | import { FHIRApps } from './fhir-apps'; 9 | import { AntdLocaleProvider } from '../components/antdLocaleProvider'; 10 | 11 | const { Content } = Layout; 12 | 13 | const App: React.FC = () => { 14 | return ( 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 |
25 |
26 |
27 | ); 28 | }; 29 | 30 | export default App; 31 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/fhir-keycloak-user-management/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "active": "", 3 | "Add User": "", 4 | "Are you sure you want to delete this user?": "", 5 | "Credentials": "", 6 | "Delete": "", 7 | "Edit": "", 8 | "Email": "", 9 | "Failed to update data, please refresh the page to see the most recent changes": "", 10 | "Failed to update practitioner": "", 11 | "Fetching linked care teams": "", 12 | "Fetching linked practitioner": "", 13 | "First name": "", 14 | "inactive": "", 15 | "Last name": "", 16 | "No": "", 17 | "Practitioner created successfully": "", 18 | "Practitioner deactivated": "", 19 | "Practitioner Id": "", 20 | "Practitioner is not assigned to a care team": "", 21 | "Practitioner status": "", 22 | "Practitioner updated successfully": "", 23 | "User deleted successfully": "", 24 | "User does not have a linked practitioner": "", 25 | "User Management": "", 26 | "Username": "", 27 | "View Details": "", 28 | "Yes": "" 29 | } 30 | -------------------------------------------------------------------------------- /packages/fhir-import/src/containers/ImportDetailView/index.css: -------------------------------------------------------------------------------- 1 | .terminal-output { 2 | color: #cccccc; 3 | font-family: 'Courier New', Courier, monospace; 4 | background-color: #1e1e1e; 5 | border: 1px solid #555555; 6 | border-radius: 5px; 7 | padding: 20px; 8 | margin: 20px auto; 9 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); 10 | overflow: auto; 11 | max-height: 600px; 12 | } 13 | 14 | .terminal-output pre { 15 | white-space: pre-wrap; 16 | /* Makes sure that text wraps within the pre element */ 17 | word-wrap: break-word; 18 | word-break: break-all; 19 | /* Ensures long words will wrap and not overflow the container */ 20 | margin: 0; 21 | color: #fff; 22 | /* Color for the terminal text */ 23 | } 24 | 25 | .view-details-container { 26 | display: flex; 27 | flex-direction: column; 28 | align-items: flex-start; 29 | padding: 16px; 30 | gap: 14px; 31 | background: #FFF; 32 | border-radius: 12px; 33 | } 34 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/react-utils/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "404": "404", 3 | "Actions": "Actions", 4 | "Class": "", 5 | "Date created": "", 6 | "Error": "Error", 7 | "Fetching next page": "Fetching next page", 8 | "Go back": "Go back", 9 | "Go home": "Go home", 10 | "ID": "", 11 | "Load more options": "Load more options", 12 | "No data": "No data", 13 | "No data available": "No data available", 14 | "Search": "Search", 15 | "Showing {{recordsFetchedNum}}; {{remainingRecords}} more records.": "Showing {{recordsFetchedNum}}; {{remainingRecords}} more records.", 16 | "Something went wrong": "Something went wrong", 17 | "Sorry, the resource you requested for, does not exist": "Sorry, the resource you requested for, does not exist", 18 | "Sorry, you are not authorized to access this page": "Sorry, you are not authorized to access this page", 19 | "status": "", 20 | "Unable to load dropdown options.": "Unable to load dropdown options.", 21 | "View details": "View details" 22 | } 23 | -------------------------------------------------------------------------------- /packages/fhir-client/src/components/PatientDetails/ResourceSchema/DiagnosticReport.tsx: -------------------------------------------------------------------------------- 1 | import { IDiagnosticReport } from '@smile-cdr/fhirts/dist/FHIR-R4/interfaces/IDiagnosticReport'; 2 | import { get } from 'lodash'; 3 | import type { TFunction } from '@opensrp/i18n'; 4 | import { sorterFn } from '../../../helpers/utils'; 5 | 6 | export const parseDiagnosticReport = (obj: IDiagnosticReport) => { 7 | return { 8 | issued: get(obj, 'issued'), 9 | id: get(obj, 'id'), 10 | conclusion: get(obj, 'conclusion'), 11 | }; 12 | }; 13 | 14 | export type DiagnosticReportTableData = ReturnType; 15 | 16 | const issuedSorter = sorterFn('issued', true); 17 | 18 | export const columns = (t: TFunction) => [ 19 | { 20 | title: t('Id'), 21 | dataIndex: 'id', 22 | }, 23 | { 24 | title: t('Conclusion'), 25 | dataIndex: 'conclusion', 26 | }, 27 | { 28 | title: t('Date issued'), 29 | dataIndex: 'issued', 30 | sorter: issuedSorter, 31 | }, 32 | ]; 33 | -------------------------------------------------------------------------------- /packages/error-boundary-fallback/src/components/ErrorBoundaryFallback/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Result, Button } from 'antd'; 3 | import { useTranslation } from '../../mls'; 4 | interface Props { 5 | homeUrl?: string; 6 | } 7 | 8 | const ErrorBoundaryFallback = (props: Props) => { 9 | const { homeUrl } = props; 10 | const { t } = useTranslation(); 11 | return ( 12 | (window.location.href = homeUrl ? homeUrl : '/')} 23 | type="primary" 24 | > 25 | {t('Back Home')} 26 | 27 | } 28 | /> 29 | ); 30 | }; 31 | 32 | export { ErrorBoundaryFallback }; 33 | -------------------------------------------------------------------------------- /packages/fhir-location-management/src/components/ViewDetails/tests/__snapshots__/viewDetails.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`renders correctly: breadcrumb path link 1`] = ` 4 |
  • 5 | 6 | Root FHIR Location 7 | 8 |
  • 9 | `; 10 | 11 | exports[`renders correctly: breadcrumb path link 2`] = ` 12 | 18 | `; 19 | 20 | exports[`renders correctly: breadcrumb path link 3`] = ` 21 |
  • 22 | 25 | True Kenya 26 | 27 |
  • 28 | `; 29 | 30 | exports[`renders correctly: breadcrumb path link 4`] = ` 31 | 37 | `; 38 | 39 | exports[`renders correctly: breadcrumb path link 5`] = ` 40 |
  • 41 | 42 | Central Province 43 | 44 |
  • 45 | `; 46 | -------------------------------------------------------------------------------- /packages/react-utils/src/hooks/tests/__snapshots__/useServerSideActionDataGrid.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`pagination and search work correctly: Search 1 page 1 1`] = ` 4 | 7 | Birth Notification CRVS sample 8 | 9 | `; 10 | 11 | exports[`pagination and search work correctly: table row 1 page 1 1`] = ` 12 | 15 | NSW Government My Personal Health Record 16 | 17 | `; 18 | 19 | exports[`pagination and search work correctly: table row 1 page 2 1`] = ` 20 | 23 | 426 - title 24 | 25 | `; 26 | 27 | exports[`pagination and search work correctly: table row 2 page 1 1`] = ` 28 | 31 | 219 - title 32 | 33 | `; 34 | 35 | exports[`pagination and search work correctly: table row 2 page 2 1`] = ` 36 | 39 | NSW Government My Personal Health Record 40 | 41 | `; 42 | -------------------------------------------------------------------------------- /packages/fhir-keycloak-user-management/src/constants.ts: -------------------------------------------------------------------------------- 1 | import { URL_USER } from '@opensrp/user-management'; 2 | 3 | export const practitionerResourceType = 'Practitioner'; 4 | export const careTeamResourceType = 'CareTeam'; 5 | export const organizationResourceType = 'Organization'; 6 | export const groupResourceType = 'Group'; 7 | export const practitionerRoleResourceType = 'PractitionerRole'; 8 | export const keycloakRoleMappingsEndpoint = 'role-mappings'; 9 | export const practitionerDetailsResourceType = 'PractitionerDetail'; 10 | 11 | // keycloak endpoints strings 12 | export const keycloakCountEndpoint = 'count'; 13 | export const keycloakGroupEndpoint = 'groups'; 14 | export const keycloakMembersEndpoint = 'members'; 15 | 16 | // router urls 17 | export const USER_DETAILS_URL = `${URL_USER}/details`; 18 | 19 | // form field names 20 | export const NATIONAL_ID_FORM_FIELD = 'nationalId'; 21 | export const PHONE_NUMBER_FORM_FIELD = 'phoneNumber'; 22 | 23 | export const renderExtraFields = [NATIONAL_ID_FORM_FIELD, PHONE_NUMBER_FORM_FIELD]; 24 | -------------------------------------------------------------------------------- /packages/keycloak-user-management/src/components/CreateEditUserGroup/tests/fixtures.ts: -------------------------------------------------------------------------------- 1 | import { KeycloakUserGroup } from '../../../ducks/userGroups'; 2 | 3 | export const userGroups: KeycloakUserGroup[] = [ 4 | { id: '283c5d6e-9b83-4954-9f3b-4c2103e4370c', name: 'Admin', path: '/Admin', subGroups: [] }, 5 | { 6 | id: '4dd15e66-7132-429b-8939-d1e601611464', 7 | name: 'New Group', 8 | path: '/New Group', 9 | subGroups: [], 10 | }, 11 | { 12 | id: '580c7fbf-c201-4dad-9172-1df9faf24936', 13 | name: 'Super User', 14 | path: '/Super User', 15 | subGroups: [], 16 | }, 17 | { 18 | id: '2fffbc6a-528d-4cec-aa44-97ef65b9bba2', 19 | name: 'Test User Group', 20 | path: '/Test User Group', 21 | subGroups: [], 22 | }, 23 | ]; 24 | 25 | export const userGroup: KeycloakUserGroup = { 26 | id: '283c5d6e-9b83-4954-9f3b-4c2103e4370c', 27 | name: 'Admin', 28 | path: '/Admin', 29 | subGroups: [], 30 | }; 31 | 32 | export const value = { 33 | id: '', 34 | name: 'Admin', 35 | path: '/Admin', 36 | }; 37 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "sourceMap": false, 5 | "lib": ["dom", "dom.iterable", "esnext", "es6"], 6 | "allowJs": true, 7 | "skipLibCheck": true, 8 | "esModuleInterop": true, 9 | "isolatedModules": true, 10 | "allowSyntheticDefaultImports": true, 11 | "strict": true, 12 | "forceConsistentCasingInFileNames": true, 13 | "module": "esnext", 14 | "moduleResolution": "node", 15 | "resolveJsonModule": true, 16 | "emitDeclarationOnly": true, 17 | "noEmitOnError": true, 18 | "jsx": "preserve", 19 | "baseUrl": "packages", 20 | "declaration": true, 21 | "declarationMap": false, 22 | "listEmittedFiles": true 23 | }, 24 | "include": [ 25 | "packages/", 26 | "app/src", 27 | "jest.config.js", 28 | "babel.config.js", 29 | "setupTests.js", 30 | "i18next-parser.config.js", 31 | "__mocks__/", 32 | "./jest-setup.ts" 33 | ], 34 | "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts"] 35 | } 36 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/app/vi.json: -------------------------------------------------------------------------------- 1 | { 2 | "Active": "", 3 | "Add inventory via CSV": "", 4 | "Administration": "", 5 | "An error occurred": "", 6 | "Card Support": "", 7 | "Care Teams Management": "", 8 | "Complete": "", 9 | "Download Client Data": "", 10 | "Draft": "", 11 | "Draft Files": "", 12 | "Form Configuration": "", 13 | "Inventory": "", 14 | "JSON Validators": "", 15 | "Location Management": "", 16 | "Location unit group": "", 17 | "Hierarchy": "", 18 | "Login": "", 19 | "Logout": "", 20 | "Manage account": "", 21 | "Manifest Releases": "", 22 | "Missions": "", 23 | "Plans": "", 24 | "Please log in with one of the following providers": "", 25 | "Product Catalogue": "", 26 | "Questionnaire": "", 27 | "Retired": "", 28 | "Server Settings": "", 29 | "Service point inventory": "", 30 | "Team Assignment": "", 31 | "Team Management": "", 32 | "Teams": "", 33 | "User Groups": "", 34 | "User Management": "", 35 | "User Roles": "", 36 | "Users": "", 37 | "Welcome to OpenSRP": "" 38 | } 39 | -------------------------------------------------------------------------------- /packages/fhir-import/src/containers/StartImportView/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Helmet } from 'react-helmet'; 3 | import { ImporterFormInstructions } from './formInstructions'; 4 | import { BodyLayout } from '@opensrp/react-utils'; 5 | import { Row, Col } from 'antd'; 6 | import { DataImportForm } from './form'; 7 | import { useTranslation } from '../../mls'; 8 | 9 | export const StartDataImport = () => { 10 | const { t } = useTranslation(); 11 | const pageTitle = t('Data imports'); 12 | const headerProps = { 13 | pageHeaderProps: { 14 | title: pageTitle, 15 | onBack: undefined, 16 | }, 17 | }; 18 | return ( 19 | <> 20 | 21 | 22 | {pageTitle} 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | ); 33 | }; 34 | -------------------------------------------------------------------------------- /packages/react-utils/src/components/fhirDataTypes/CodeableConcept/index.tsx: -------------------------------------------------------------------------------- 1 | import { CodeableConcept as TCodeableConcept } from '@smile-cdr/fhirts/dist/FHIR-R4/classes/codeableConcept'; 2 | import { Tooltip } from 'antd'; 3 | import { Coding } from '../Coding'; 4 | import { Typography } from 'antd'; 5 | import React, { Fragment } from 'react'; 6 | 7 | const { Text } = Typography; 8 | 9 | export interface CodeableConceptProps { 10 | concept: TCodeableConcept; 11 | } 12 | 13 | export const CodeableConcept = (props: CodeableConceptProps) => { 14 | const { concept } = props; 15 | const { coding, text } = concept; 16 | 17 | const codingsTitle = ( 18 | <> 19 | {(coding ?? []).map((coding, index) => ( 20 | 21 | ,{' '} 22 | 23 | ))} 24 | 25 | ); 26 | return ( 27 | 28 | {text ? {text} : codingsTitle} 29 | 30 | ); 31 | }; 32 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/keycloak-user-management/ar.json: -------------------------------------------------------------------------------- 1 | { 2 | "An error occurred": "", 3 | "First Name is required": "", 4 | "Last Name is required": "", 5 | "Username is required": "", 6 | "Confirm Password is required": "", 7 | "Password is required": "", 8 | "The two passwords that you entered do not match!": "", 9 | "User deleted successfully": "", 10 | "User edited successfully": "", 11 | "User created successfully": "", 12 | "Credentials updated successfully": "", 13 | "Practitioner created successfully": "", 14 | "Practitioner updated successfully": "", 15 | "No Data Found": "", 16 | "User Credentials": "", 17 | "Set password": "", 18 | "Edit User": "", 19 | "Add User": "", 20 | "Cancel": "", 21 | "User Management": "", 22 | "Temporary": "", 23 | "Password": "", 24 | "Confirm Password": "", 25 | "First Name": "", 26 | "Last Name": "", 27 | "Email": "", 28 | "Username": "", 29 | "Mark as Practitioner": "", 30 | "Required Actions": "", 31 | "Please select": "", 32 | "Save": "", 33 | "Saving": "" 34 | } 35 | -------------------------------------------------------------------------------- /app/src/App/tests/fixtures.tsx: -------------------------------------------------------------------------------- 1 | export const expressAPIResponse = { 2 | gatekeeper: { 3 | result: { 4 | oAuth2Data: { 5 | access_token: 'hunter2', 6 | expires_in: 1142, 7 | refresh_token: 'iloveoov', 8 | scope: 'read write', 9 | token_type: 'bearer', 10 | }, 11 | preferredName: 'Superset User', 12 | roles: ['Provider', 'ROLE_VIEW_KEYCLOAK_USERS'], 13 | username: 'superset-user', 14 | }, 15 | success: true, 16 | }, 17 | session: { 18 | authenticated: true, 19 | extraData: { 20 | oAuth2Data: { 21 | access_token: 'hunter2', 22 | expires_in: 1142, 23 | refresh_token: 'iloveoov', 24 | scope: 'read write', 25 | token_type: 'bearer', 26 | }, 27 | preferredName: 'Superset User', 28 | roles: ['Provider', 'ROLE_VIEW_KEYCLOAK_USERS'], 29 | username: 'superset-user', 30 | }, 31 | user: { 32 | email: '', 33 | gravatar: '', 34 | name: '', 35 | username: 'superset-user', 36 | }, 37 | }, 38 | }; 39 | -------------------------------------------------------------------------------- /packages/fhir-group-management/src/components/CommodityList/index.tsx: -------------------------------------------------------------------------------- 1 | import { getConfig } from '@opensrp/pkg-config'; 2 | import { EusmCommodityList } from './Eusm/List'; 3 | import { DefaultCommodityList, GroupListProps } from './Default/List'; 4 | import React from 'react'; 5 | import { useTranslation } from '../../mls'; 6 | import { Alert } from 'antd'; 7 | 8 | export const CommodityList = (props: GroupListProps) => { 9 | const { t } = useTranslation(); 10 | const { listId } = props; 11 | const projectCode = getConfig('projectCode'); 12 | 13 | if (!listId) { 14 | return ( 15 | 24 | ); 25 | } 26 | 27 | if (projectCode === 'eusm') { 28 | return ; 29 | } else { 30 | return ; 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /packages/fhir-care-team/src/components/CreateEditCareTeam/tests/__snapshots__/index.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`renders correctly for create care team: name field 1`] = ` 4 | 11 | `; 12 | 13 | exports[`renders correctly for create care team: uuid field 1`] = ` 14 | 20 | `; 21 | 22 | exports[`renders correctly for edit care team: name field 1`] = ` 23 | 30 | `; 31 | 32 | exports[`renders correctly for edit care team: uuid field 1`] = ` 33 | 39 | `; 40 | -------------------------------------------------------------------------------- /packages/fhir-helpers/src/utils/tests/fixtures.ts: -------------------------------------------------------------------------------- 1 | export const characteristics = [ 2 | { 3 | code: { 4 | coding: [ 5 | { 6 | system: 'http://smartregister.org/', 7 | code: '98734231', 8 | display: 'Unicef Section', 9 | }, 10 | ], 11 | }, 12 | valueCodeableConcept: { 13 | coding: [ 14 | { 15 | system: 'http://smartregister.org/CodeSystem/eusm-unicef-sections', 16 | code: 'Health', 17 | display: 'Health', 18 | }, 19 | ], 20 | text: 'Health', 21 | }, 22 | }, 23 | { 24 | code: { 25 | coding: [ 26 | { 27 | system: 'http://smartregister.org/', 28 | code: '45647484', 29 | display: 'Donor', 30 | }, 31 | ], 32 | }, 33 | valueCodeableConcept: { 34 | coding: [ 35 | { 36 | system: 'http://smartregister.org/CodeSystem/eusm-donors', 37 | code: 'GAVI', 38 | display: 'GAVI', 39 | }, 40 | ], 41 | text: 'GAVI', 42 | }, 43 | }, 44 | ]; 45 | -------------------------------------------------------------------------------- /packages/react-utils/src/components/GenericDetailsView/ResourceItemLoader/index.tsx: -------------------------------------------------------------------------------- 1 | import { IResource } from '@smile-cdr/fhirts/dist/FHIR-R4/interfaces/IResource'; 2 | import { Spin } from 'antd'; 3 | import React from 'react'; 4 | import { UseQueryOptions, useQuery } from 'react-query'; 5 | 6 | export interface ResourceItemLoaderProps { 7 | resourceQueryParams: UseQueryOptions; 8 | itemGetter: (resource: ResourceType) => React.ReactNode; 9 | } 10 | 11 | /** 12 | * Component to help load a single resource item 13 | * Used when loading related resources 14 | * 15 | * @param props - ResourceItemLoader component props 16 | */ 17 | export function ResourceItemLoader(props: ResourceItemLoaderProps) { 18 | const { resourceQueryParams, itemGetter } = props; 19 | const { data, isLoading, error } = useQuery(resourceQueryParams); 20 | if (isLoading) { 21 | return ; 22 | } 23 | if (error || !data) { 24 | return null; 25 | } 26 | const item = itemGetter(data); 27 | return <>{item}; 28 | } 29 | -------------------------------------------------------------------------------- /packages/fhir-location-management/src/components/LocationTree/tests/__snapshots__/index.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`location-management/src/components/LocationTree works correctly: langata search value 1`] = ` 4 | 7 | 8 | 11 | laNgaTa 12 | 13 | 14 | 15 | `; 16 | 17 | exports[`location-management/src/components/LocationTree works correctly: search input 1`] = ` 18 | 24 | `; 25 | 26 | exports[`location-management/src/components/LocationTree works correctly: single top record 1`] = ` 27 | 31 | 34 | 37 | Ona Office Sub Location 38 | 39 | 40 | 41 | `; 42 | -------------------------------------------------------------------------------- /packages/fhir-client/src/components/PatientDetails/ResourceSchema/Practitioner.tsx: -------------------------------------------------------------------------------- 1 | import { IPractitioner } from '@smile-cdr/fhirts/dist/FHIR-R4/interfaces/IPractitioner'; 2 | import { get } from 'lodash'; 3 | import { sorterFn } from '../../../helpers/utils'; 4 | import { parseFhirHumanName } from '@opensrp/react-utils'; 5 | import type { TFunction } from '@opensrp/i18n'; 6 | 7 | export const parsePractitioner = (obj: IPractitioner) => { 8 | return { 9 | name: parseFhirHumanName(get(obj, 'name.0')), 10 | gender: get(obj, 'gender'), 11 | active: get(obj, 'active'), 12 | }; 13 | }; 14 | 15 | export type CarePlanTableData = ReturnType; 16 | 17 | const nameSorterFn = sorterFn('name'); 18 | 19 | export const columns = (t: TFunction) => [ 20 | { 21 | title: t('Name'), 22 | dataIndex: 'name', 23 | sorter: nameSorterFn, 24 | }, 25 | { 26 | title: t('Gender'), 27 | dataIndex: 'gender', 28 | }, 29 | { 30 | title: t('Status'), 31 | dataIndex: 'active', 32 | render: (value: boolean) => (value === true ? 'Active' : 'Inacitve'), 33 | }, 34 | ]; 35 | -------------------------------------------------------------------------------- /packages/fhir-group-management/src/components/LocationInventory/types.ts: -------------------------------------------------------------------------------- 1 | import { IGroup } from '@smile-cdr/fhirts/dist/FHIR-R4/interfaces/IGroup'; 2 | import { 3 | product, 4 | quantity, 5 | deliveryDate, 6 | accountabilityEndDate, 7 | expiryDate, 8 | unicefSection, 9 | serialNumber, 10 | donor, 11 | PONumber, 12 | id, 13 | active, 14 | name, 15 | type, 16 | actual, 17 | } from '../../constants'; 18 | import { Group } from '@smile-cdr/fhirts/dist/FHIR-R4/classes/group'; 19 | import { Dayjs } from 'dayjs'; 20 | 21 | export interface CommonGroupFormFields { 22 | [id]?: string; 23 | [active]?: boolean; 24 | [actual]?: boolean; 25 | [name]?: string; 26 | [type]?: Group.TypeEnum; 27 | [quantity]?: number; 28 | [deliveryDate]: Dayjs; 29 | [accountabilityEndDate]: Dayjs; 30 | [expiryDate]?: Dayjs; 31 | [serialNumber]: string; 32 | [PONumber]: string; 33 | [donor]?: string; 34 | [unicefSection]: string; 35 | [product]: string; 36 | } 37 | 38 | export interface GroupFormFields extends CommonGroupFormFields { 39 | initialObject?: InitialObjects; 40 | } 41 | -------------------------------------------------------------------------------- /packages/template/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@opensrp/template", 3 | "version": "0.0.6", 4 | "description": "", 5 | "main": "dist/index.js", 6 | "types": "dist/types", 7 | "files": [ 8 | "dist" 9 | ], 10 | "publishConfig": { 11 | "access": "public" 12 | }, 13 | "repository": "https://github.com/opensrp/web", 14 | "scripts": { 15 | "test": "run -T test $INIT_CWD --verbose", 16 | "tsc": "run -T tsc", 17 | "lint": "run -T eslint ./**/*.{js,jsx,ts,tsx}", 18 | "copy": "run -T copyfiles -u 1 \"./src/**/*.{css,html}\" \"./dist/\"", 19 | "build": "run tsc && run transpile && run copy", 20 | "transpile": "run -T babel src -d dist --root-mode upward --extensions .ts,.tsx --ignore '**/*.test.ts,**/*.test.tsx,**/tests,**/__tests__'" 21 | }, 22 | "jest": { 23 | "automock": false, 24 | "setupFiles": [ 25 | "../../setupTests" 26 | ] 27 | }, 28 | "bugs": { 29 | "url": "https://github.com/opensrp/web/issues" 30 | }, 31 | "peerDependencies": { 32 | "react": "^17.0.0 " 33 | }, 34 | "author": "OpenSRP Engineering", 35 | "license": "Apache-2.0" 36 | } 37 | -------------------------------------------------------------------------------- /packages/fhir-helpers/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@opensrp/fhir-helpers", 3 | "version": "0.0.1", 4 | "description": "", 5 | "main": "dist/index.js", 6 | "types": "dist/types", 7 | "files": [ 8 | "dist" 9 | ], 10 | "publishConfig": { 11 | "access": "public" 12 | }, 13 | "repository": "https://github.com/opensrp/web", 14 | "scripts": { 15 | "test": "run -T test $INIT_CWD --verbose", 16 | "tsc": "run -T tsc", 17 | "lint": "run -T eslint ./**/*.{js,jsx,ts,tsx}", 18 | "copy": "run -T copyfiles -u 1 \"./src/**/*.{css,html}\" \"./dist/\"", 19 | "build": "run tsc && run transpile && run copy", 20 | "transpile": "run -T babel src -d dist --root-mode upward --extensions .ts,.tsx --ignore '**/*.test.ts,**/*.test.tsx,**/tests,**/__tests__'" 21 | }, 22 | "jest": { 23 | "automock": false, 24 | "setupFiles": [ 25 | "../../setupTests" 26 | ] 27 | }, 28 | "bugs": { 29 | "url": "https://github.com/opensrp/web/issues" 30 | }, 31 | "dependencies": { 32 | "lodash": "^4.17.21" 33 | }, 34 | "author": "OpenSRP Engineering", 35 | "license": "Apache-2.0" 36 | } 37 | -------------------------------------------------------------------------------- /packages/fhir-location-management/src/components/EditLink/tests/fixtures.ts: -------------------------------------------------------------------------------- 1 | import { ILocation } from '@smile-cdr/fhirts/dist/FHIR-R4/interfaces/ILocation'; 2 | 3 | export const Location: ILocation = { 4 | resourceType: 'Location', 5 | id: '303', 6 | meta: { 7 | versionId: '4', 8 | lastUpdated: '2021-10-14T13:12:22.740+00:00', 9 | source: '#13bbc7f09daa1751', 10 | }, 11 | identifier: [{ use: 'official', value: '93bc9c3d-6321-41b0-9b93-1275d7114e22' }], 12 | status: 'active', 13 | name: 'Yosemite', 14 | description: 'The Sub location', 15 | partOf: { reference: 'Location/2252', display: 'Root FHIR Location' }, 16 | type: [ 17 | { 18 | coding: [ 19 | { 20 | system: 'http://terminology.hl7.org/CodeSystem/location-physical-type', 21 | code: 'bu', 22 | display: 'Building', 23 | }, 24 | ], 25 | }, 26 | ], 27 | physicalType: { 28 | coding: [ 29 | { 30 | system: 'http://terminology.hl7.org/CodeSystem/location-physical-type', 31 | code: 'bu', 32 | display: 'Building', 33 | }, 34 | ], 35 | }, 36 | }; 37 | -------------------------------------------------------------------------------- /packages/i18n/locales/eusm/react-utils/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "404": "404", 3 | "Actions": "Actions", 4 | "Class": "Catégorie", 5 | "Date created": "Date de création", 6 | "Error": "Erreur", 7 | "Fetching next page": "Consultation de la page suivante", 8 | "Go back": "Retour", 9 | "Go home": "Retour à l'accueil", 10 | "ID": "ID", 11 | "Load more options": "Charger plus d'options", 12 | "No data": "Aucune donnée", 13 | "No data available": "Pas de données disponibles", 14 | "Search": "Recherche", 15 | "Showing {{recordsFetchedNum}}; {{remainingRecords}} more records.": "Afficher {{recordsFetchedNum}} ; {{remainingRecords}} plus d'enregistrements.", 16 | "Something went wrong": "Quelque chose n'a pas fonctionné", 17 | "Sorry, the resource you requested for, does not exist": "Désolé, la ressource demandée n'existe pas.", 18 | "Sorry, you are not authorized to access this page": "Désolé, vous n'êtes pas autorisé à accéder à cette page", 19 | "status": "Statut", 20 | "Unable to load dropdown options.": "Impossible de charger les options de la liste déroulante.", 21 | "View details": "Voir les détails" 22 | } 23 | -------------------------------------------------------------------------------- /packages/fhir-import/src/containers/StartImportView/tests/index.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { StartDataImport } from '..'; 3 | import nock from 'nock'; 4 | import { render, cleanup, screen } from '@testing-library/react'; 5 | import * as reactQuery from 'react-query'; 6 | 7 | const { QueryClient, QueryClientProvider } = reactQuery; 8 | 9 | const queryClient = new QueryClient({ 10 | defaultOptions: { 11 | queries: { 12 | retry: false, 13 | cacheTime: 0, 14 | }, 15 | }, 16 | }); 17 | 18 | beforeAll(() => { 19 | nock.disableNetConnect(); 20 | }); 21 | 22 | afterAll(() => { 23 | nock.enableNetConnect(); 24 | }); 25 | 26 | afterEach(() => { 27 | jest.resetAllMocks(); 28 | jest.clearAllMocks(); 29 | jest.restoreAllMocks(); 30 | cleanup(); 31 | }); 32 | 33 | test('renders correctly', async () => { 34 | render( 35 | 36 | 37 | 38 | ); 39 | const formInstruction = screen.getByTestId('form-instructions'); 40 | expect(formInstruction.textContent).toMatchSnapshot('textContent'); 41 | }); 42 | -------------------------------------------------------------------------------- /packages/fhir-keycloak-user-management/src/components/UserList/Viewdetails/ViewDetailResources/tests/practitionerDetails.test.tsx: -------------------------------------------------------------------------------- 1 | import { PractitionerDetailsView } from '../PractitionerDetails'; 2 | import { render } from '@testing-library/react'; 3 | import { practitionerDetailsBundle } from './fixtures'; 4 | import React from 'react'; 5 | import { getResourcesFromBundle } from '@opensrp/react-utils'; 6 | import { PractitionerDetail } from '../../types'; 7 | 8 | const practitionerDetails = 9 | getResourcesFromBundle(practitionerDetailsBundle)[0].fhir; 10 | 11 | test('renders without crashing', () => { 12 | const props = { 13 | loading: false, 14 | practitionerDetails, 15 | }; 16 | render(); 17 | 18 | const tableRows = document.querySelectorAll('table tr'); 19 | const text = [...tableRows].map((tr) => tr.textContent); 20 | expect(text).toEqual([ 21 | 'IdNameActiveUser TypePractitioner Role Coding', 22 | '3a801d6e-7bd3-4a5f-bc9c-64758fbb3dadtest1147 1147ActivepractitionerAssigned practitioner(http://snomed.info/sct|405623001), ', 23 | ]); 24 | }); 25 | -------------------------------------------------------------------------------- /waypoint.hcl: -------------------------------------------------------------------------------- 1 | # The name of your project. A project typically maps 1:1 to a VCS repository. 2 | # This name must be unique for your Waypoint server. If you're running in 3 | # local mode, this must be unique to your machine. 4 | project = "opensrp-web" 5 | 6 | # Labels can be specified for organizational purposes. 7 | # labels = { "foo" = "bar" } 8 | 9 | # An application to deploy. 10 | app "web" { 11 | # Build specifies how an application should be deployed. In this case, 12 | # we'll build using a Dockerfile and keeping it in a local registry. 13 | build { 14 | use "docker" {} 15 | 16 | # Uncomment below to use a remote docker registry to push your built images. 17 | # 18 | # registry { 19 | # use "docker" { 20 | # image = "registry.example.com/image" 21 | # tag = "latest" 22 | # } 23 | # } 24 | 25 | } 26 | 27 | # Deploy to Docker 28 | deploy { 29 | use "docker" { 30 | service_port = 3000 31 | } 32 | } 33 | 34 | # URL service 35 | url { 36 | auto_hostname = true 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/configs/settings.ts: -------------------------------------------------------------------------------- 1 | import { Providers } from '@onaio/gatekeeper'; 2 | import { 3 | ENABLE_OPENSRP_OAUTH, 4 | OPENSRP_ACCESS_TOKEN_URL, 5 | OPENSRP_AUTHORIZATION_URL, 6 | OPENSRP_CLIENT_ID, 7 | DOMAIN_NAME, 8 | OPENSRP_OAUTH_STATE, 9 | OPENSRP_USER_URL, 10 | OPENSRP_OAUTH_SCOPES, 11 | ENABLE_FHIR_USER_MANAGEMENT, 12 | ENABLE_FHIR_TEAMS, 13 | ENABLE_FHIR_LOCATIONS, 14 | } from './env'; 15 | 16 | /** Authentication Configs */ 17 | const providers: Providers = {}; 18 | if (ENABLE_OPENSRP_OAUTH) { 19 | providers.OpenSRP = { 20 | accessTokenUri: OPENSRP_ACCESS_TOKEN_URL, 21 | authorizationUri: OPENSRP_AUTHORIZATION_URL, 22 | clientId: OPENSRP_CLIENT_ID, 23 | redirectUri: `${DOMAIN_NAME}/oauth/callback/OpenSRP/`, 24 | scopes: OPENSRP_OAUTH_SCOPES, 25 | state: OPENSRP_OAUTH_STATE, 26 | userUri: OPENSRP_USER_URL, 27 | }; 28 | } 29 | 30 | export { providers }; 31 | 32 | export const COMPOSITE_ENABLE_USER_MANAGEMENT = ENABLE_FHIR_USER_MANAGEMENT; 33 | export const COMPOSITE_ENABLE_TEAM_MANAGEMENT = ENABLE_FHIR_TEAMS; 34 | export const COMPOSITE_ENABLE_LOCATIONS_MANAGEMENT = ENABLE_FHIR_LOCATIONS; 35 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/app/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "404!": "", 3 | "Active": "", 4 | "Add inventory via CSV": "", 5 | "Administration": "", 6 | "An error occurred": "", 7 | "Card Support": "", 8 | "Care Teams Management": "", 9 | "Complete": "", 10 | "District report": "", 11 | "Download Client Data": "", 12 | "Draft": "", 13 | "Draft Files": "", 14 | "Form Configuration": "", 15 | "Group management": "", 16 | "Healthcare Services": "", 17 | "Inventory": "", 18 | "JSON Validators": "", 19 | "Location Management": "", 20 | "Location Unit Group": "", 21 | "Hierarchy": "", 22 | "Login": "", 23 | "Logout": "", 24 | "Manage account": "", 25 | "Manifest Releases": "", 26 | "OpenSRP Web": "", 27 | "Patients": "", 28 | "Plans": "", 29 | "Product Catalogue": "", 30 | "Questionnaire": "", 31 | "Reports": "", 32 | "Retired": "", 33 | "Server Settings": "", 34 | "Service point inventory": "", 35 | "Team Assignment": "", 36 | "Team Management": "", 37 | "Teams": "", 38 | "User Groups": "", 39 | "User Management": "", 40 | "User Roles": "", 41 | "Users": "", 42 | "Welcome to OpenSRP": "" 43 | } 44 | -------------------------------------------------------------------------------- /packages/fhir-client/src/components/PatientDetails/ResourceSchema/MedicationAdministration.tsx: -------------------------------------------------------------------------------- 1 | import { IMedicationAdministration } from '@smile-cdr/fhirts/dist/FHIR-R4/interfaces/IMedicationAdministration'; 2 | import { get } from 'lodash'; 3 | import type { TFunction } from '@opensrp/i18n'; 4 | import { sorterFn } from '../../../helpers/utils'; 5 | 6 | export const parseMedicationAdministration = (obj: IMedicationAdministration) => { 7 | return { 8 | status: get(obj, 'status'), 9 | id: get(obj, 'id'), 10 | occurenceDateTime: get(obj, 'occurenceDateTime'), 11 | }; 12 | }; 13 | 14 | export type MedicationAdminTableData = ReturnType; 15 | 16 | const statusSorterFn = sorterFn('status'); 17 | 18 | export const columns = (t: TFunction) => [ 19 | { 20 | title: t('Id'), 21 | dataIndex: 'id', 22 | }, 23 | { 24 | title: t('Status'), 25 | dataIndex: 'status', 26 | sorter: statusSorterFn, 27 | }, 28 | { 29 | title: t('Occurence Date'), 30 | dataIndex: 'occurenceDateTime', 31 | render: (value: string) => t('{{val, datetime}}', { val: new Date(value) }), 32 | }, 33 | ]; 34 | -------------------------------------------------------------------------------- /packages/react-utils/src/components/UtilPageExtra/tests/index.test.tsx: -------------------------------------------------------------------------------- 1 | import { mount } from 'enzyme'; 2 | import React from 'react'; 3 | import { ExtraLinks } from '..'; 4 | import { createBrowserHistory } from 'history'; 5 | import { Router } from 'react-router'; 6 | import { HOME_URL } from '../../../constants'; 7 | 8 | const history = createBrowserHistory(); 9 | 10 | describe('ExtraLinks util component', () => { 11 | it('works correctly', () => { 12 | const mockBack = jest.fn(); 13 | history.goBack = mockBack; 14 | const wrapper = mount( 15 | 16 | 17 | 18 | ); 19 | 20 | // click go back 21 | expect(wrapper.find('button').first().text()).toMatchInlineSnapshot(`"Go back"`); 22 | wrapper.find('button').first().simulate('click'); 23 | 24 | expect(mockBack).toHaveBeenCalled(); 25 | 26 | // click go back 27 | expect(wrapper.find('button').last().text()).toMatchInlineSnapshot(`"Go home"`); 28 | wrapper.find('button').last().simulate('click'); 29 | 30 | expect(history.location.pathname).toEqual(HOME_URL); 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /docs/publishing.md: -------------------------------------------------------------------------------- 1 | # Publishing packages to NPM 2 | 3 | ## Pre-requisites 4 | 5 | - npm credentials 6 | - GH_TOKEN: this should be set as an environement variable that can be obtained by following this [guide](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token). This is required in the versioning step, so that lerna can be able to push tags to github and create-releases with the generated tags. 7 | 8 | ## Steps 9 | 10 | 1. run `lerna:version` script 11 | 12 | - this will find the changed packages, update the package.json files, create tags, create releases for those tags. 13 | - you will need to set the `GH_TOKEN` env variable for this step. 14 | 15 | 2. run `lerna:publish` 16 | 17 | - One needs to be already logged into npm for this step. 18 | - This will call the prepublish lifecycle script and then push the versioned packages to npm 19 | 20 | ### Other added scripts 21 | 22 | - run `lerna:prepublish` script. 23 | - This runs build script in each of the package, generating the dist folder. 24 | - One can target a specific package by passing in `--scope` flag e.g. `--scope @opensrp/opensrp-store` 25 | -------------------------------------------------------------------------------- /app/src/components/Logout/tests/__snapshots__/index.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`components/Logout renders logout component 1`] = ` 4 | 5 | 9 | 10 | 16 |
    21 | 24 | 27 | 30 | 33 | 36 | 37 |
    38 |
    39 |
    40 |
    41 | `; 42 | -------------------------------------------------------------------------------- /packages/keycloak-user-management/src/components/UserRolesList/utils.tsx: -------------------------------------------------------------------------------- 1 | import { sendErrorNotification } from '@opensrp/notifications'; 2 | import { KeycloakService } from '@opensrp/keycloak-service'; 3 | import { store } from '@opensrp/store'; 4 | import { KEYCLOAK_URL_USER_ROLES } from '../../constants'; 5 | import { fetchKeycloakUserRoles, KeycloakUserRole } from '../../ducks/userRoles'; 6 | import type { TFunction } from '@opensrp/i18n'; 7 | 8 | /** 9 | * Fetch all realm roles 10 | * 11 | * @param keycloakBaseURL - keycloak API base URL 12 | * @param dispatch method to dispatch action to store 13 | * @param t - translator function 14 | */ 15 | export const fetchAllRoles = async ( 16 | keycloakBaseURL: string, 17 | dispatch: typeof store.dispatch, 18 | t: TFunction 19 | ) => { 20 | const keycloakService = new KeycloakService(KEYCLOAK_URL_USER_ROLES, keycloakBaseURL); 21 | 22 | await keycloakService 23 | .list() 24 | .then((response: KeycloakUserRole[]) => { 25 | dispatch(fetchKeycloakUserRoles(response)); 26 | }) 27 | .catch((_: Error) => { 28 | sendErrorNotification(t('There was a problem fetching realm roles')); 29 | }); 30 | }; 31 | -------------------------------------------------------------------------------- /packages/opensrp-server-service/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@opensrp/server-service", 3 | "version": "0.0.17", 4 | "description": "Wrapper around OpenSRP Server REST API", 5 | "publishConfig": { 6 | "access": "public" 7 | }, 8 | "repository": "https://github.com/OpenSRP/web", 9 | "scripts": { 10 | "test": "run -T test $INIT_CWD --verbose", 11 | "tsc": "run -T tsc", 12 | "lint": "run -T eslint ./**/*.{js,jsx,ts,tsx}", 13 | "copy": "run -T copyfiles -u 1 \"./src/**/*.{css,html}\" \"./dist/\"", 14 | "build": "run tsc && run transpile && run copy", 15 | "transpile": "run -T babel src -d dist --root-mode upward --extensions .ts,.tsx --ignore '**/*.test.ts,**/*.test.tsx,**/tests,**/__tests__'" 16 | }, 17 | "jest": { 18 | "automock": false, 19 | "setupFiles": [ 20 | "../../setupTests" 21 | ] 22 | }, 23 | "bugs": { 24 | "url": "https://github.com/OpenSRP/web/issues" 25 | }, 26 | "author": "Ona Engineering", 27 | "license": "Apache-2.0", 28 | "main": "dist/index.js", 29 | "types": "dist/types", 30 | "files": [ 31 | "dist" 32 | ], 33 | "dependencies": { 34 | "@onaio/utils": "^0.0.1" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/i18n/locales/core/fhir-team-management/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "active": "", 3 | "Add Organization": "", 4 | "Alias": "", 5 | "An Error occurred": "", 6 | "Assign/Unassign Teams | {{locationName}}": "", 7 | "Assigned teams": "", 8 | "Cancel": "", 9 | "Create team": "", 10 | "Edit": "", 11 | "Edit team | {{teamName}}": "", 12 | "Enter team alias": "", 13 | "Enter team name": "", 14 | "Failed to refresh assignments, Please Refresh the page to see the changes": "", 15 | "Failed to refresh data, please refresh the page": "", 16 | "Id": "", 17 | "Identifier": "", 18 | "Inactive": "", 19 | "Must be a valid string": "", 20 | "Name": "", 21 | "Organization list": "", 22 | "Organization updated successfully": "", 23 | "Practitioner assignments updated successfully": "", 24 | "Practitioners": "", 25 | "Required": "", 26 | "save": "", 27 | "Saving": "", 28 | "Select teams": "", 29 | "Select user (practitioners only)": "", 30 | "Team Assignment": "", 31 | "Team assignments updated successfully": "", 32 | "Team name": "", 33 | "Type": "", 34 | "Unable to load teams or teams assignments at the moment": "", 35 | "View Details": "" 36 | } 37 | -------------------------------------------------------------------------------- /packages/fhir-healthcare-service/src/components/HealthCareAddEdit/tests/__snapshots__/index.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`renders correctly for edit resource: comment field 1`] = ` 4 | 12 | `; 13 | 14 | exports[`renders correctly for edit resource: name field 1`] = ` 15 | 23 | `; 24 | 25 | exports[`renders correctly for new resource: comment field 1`] = ` 26 |