Skip to content

Commit

Permalink
Merge pull request #9262 from ohcnetwork/form-field-v1
Browse files Browse the repository at this point in the history
Add base for fhir forms
  • Loading branch information
bodhish authored Dec 31, 2024
2 parents e34f178 + ea19afa commit c2ce66e
Show file tree
Hide file tree
Showing 393 changed files with 40,338 additions and 26,493 deletions.
1 change: 1 addition & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ General Guidelines

- Care uses TanStack Query for data fetching from the API along with query and mutate utilities for the queryFn and mutationFn. (Docs @ /Utils/request/README.md)
- APIs are defined in the api.tsx file.
- Use raviger for routing.
6 changes: 4 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ REACT_APP_COVER_IMAGE_ALT=https://cdn.ohc.network/care_logo.svg
REACT_PUBLIC_URL=https://care.ohc.network

# Care API URL without the /api prefix
REACT_CARE_API_URL=https://careapi.ohc.network
REACT_CARE_API_URL=https://care-api.do.ohc.network

# Dev envs
ESLINT_NO_DEV_ERRORS=true
CARE_CDN_URL="https://egov-s3-facility-10bedicu.s3.amazonaws.com https://egov-s3-patient-data-10bedicu.s3.amazonaws.com http://localhost:4566"
REACT_ALLOWED_LOCALES="en,hi,ta,ml,mr,kn"

REACT_ENABLED_APPS=""
REACT_ENABLED_APPS=""

REACT_KERALA_GEO_ID=b04b9efa-5972-419a-892d-26169c1eac8a
7 changes: 1 addition & 6 deletions .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ REACT_SENTRY_DSN=
# Sentry environment (default: staging)
REACT_SENTRY_ENVIRONMENT=

# KASP settings
REACT_KASP_ENABLED=true
REACT_KASP_STRING=KASP
REACT_KASP_FULL_STRING=Karunya Arogya Suraksha Padhathi

# Sample format file paths
REACT_SAMPLE_FORMAT_ASSET_IMPORT=/asset-import-template.xlsx

Expand All @@ -79,4 +74,4 @@ REACT_JWT_TOKEN_REFRESH_INTERVAL=
REACT_MIN_ENCOUNTER_DATE=

# Available languages to switch between (2 Digit language code seperated by comas. See src->Locale->config.ts for available codes)
REACT_ALLOWED_LOCALES="en,hi,ta,ml,mr,kn"
REACT_ALLOWED_LOCALES="en,hi,ta,ml,mr,kn"
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,7 @@ cypress/fixtures/token.json
# Care Apps
/apps/*
src/pluginMap.ts
/apps_backup/*
/apps_backup/*

# Federation Temp files
/.__mf__temp
33 changes: 22 additions & 11 deletions care.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ interface ILogo {
dark: string;
}

const boolean = (key: string, fallback = false) => {
if (env[key] === "true") return true;
if (env[key] === "false") return false;
return fallback;
};

const logo = (value?: string, fallback?: ILogo) => {
if (!value) {
return fallback;
Expand All @@ -13,10 +19,10 @@ const logo = (value?: string, fallback?: ILogo) => {
try {
return JSON.parse(value) as ILogo;
} catch {
// TODO: define vite plugin to validate care.config.ts during build step
return fallback;
}
};

const careConfig = {
apiUrl: env.REACT_CARE_API_URL,

Expand Down Expand Up @@ -51,19 +57,12 @@ const careConfig = {
reCaptchaSiteKey:
env.REACT_RECAPTCHA_SITE_KEY || "6LdvxuQUAAAAADDWVflgBqyHGfq-xmvNJaToM0pN",

kasp: {
enabled: env.REACT_KASP_ENABLED === "true",
string: env.REACT_KASP_STRING || "KASP",
fullString:
env.REACT_KASP_FULL_STRING || "Karunya Arogya Suraksha Padhathi",
},

sampleFormats: {
assetImport:
env.REACT_SAMPLE_FORMAT_ASSET_IMPORT || "/asset-import-template.xlsx",
},

wartimeShifting: env.REACT_WARTIME_SHIFTING === "true",
wartimeShifting: boolean("REACT_WARTIME_SHIFTING"),

stillWatching: {
idleTimeout: env.REACT_STILL_WATCHING_IDLE_TIMEOUT
Expand Down Expand Up @@ -97,11 +96,19 @@ const careConfig = {
},

hcx: {
enabled: env.REACT_ENABLE_HCX === "true",
enabled: boolean("REACT_ENABLE_HCX"),
},

abdm: {
enabled: (env.REACT_ENABLE_ABDM ?? "true") === "true",
enabled: boolean("REACT_ENABLE_ABDM", true),
},

appointments: {
// Kill switch in-case the heatmap API doesn't scale as expected
useAvailabilityStatsAPI: boolean(
"REACT_APPOINTMENTS_USE_AVAILABILITY_STATS_API",
true,
),
},

careApps: env.REACT_ENABLED_APPS
Expand All @@ -110,6 +117,10 @@ const careConfig = {
package: app.split("@")[0],
}))
: [],

plotsConfigUrl:
env.REACT_OBSERVATION_PLOTS_CONFIG_URL || "/config/plots.json",
keralaGeoId: env.REACT_KERALA_GEO_ID || "",
} as const;

export default careConfig;
5 changes: 2 additions & 3 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[build]
publish = "build/"
publish = "build"
command = "CI='' npm run build"

[build.environment]
NODE_VERSION = "20.12.0"
NPM_FLAGS = "--legacy-peer-deps"
NODE_VERSION = "22.11.0"
NODE_OPTIONS = "--max_old_space_size=4096"

[[redirects]]
Expand Down
Loading

0 comments on commit c2ce66e

Please sign in to comment.