Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into keralacare-fix-s…
Browse files Browse the repository at this point in the history
…ync-conflicts
  • Loading branch information
rithviknishad committed Feb 27, 2025
2 parents 6af87cb + 6c95ea4 commit f190163
Show file tree
Hide file tree
Showing 309 changed files with 28,783 additions and 25,599 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ REACT_APP_META_DESCRIPTION="Revolutionizing EMR with AI: Open Healthcare Network
REACT_APP_COVER_IMAGE=https://cdn.ohc.network/care_logo.svg
REACT_APP_COVER_IMAGE_ALT=https://cdn.ohc.network/care_logo.svg
REACT_PUBLIC_URL=https://care.ohc.network
HEADERS="/*\n Strict-Transport-Security: max-age=63072000; includeSubDomains; preload\n X-XSS-Protection: 1; mode=block\n X-Frame-Options: SAMEORIGIN\n X-Content-Type-Options: nosniff\n Referrer-Policy: strict-origin-when-cross-origin\n Permissions-Policy: geolocation=(self), microphone=()"
REACT_RECAPTCHA_SITE_KEY=6LcedK8qAAAAAM2PpuqlqhZUxQpmIqHqluL74dDs
REACT_SENTRY_DSN="https://8801155bd0b848a09de9ebf6f387ebc8@sentry.io/5183632"
REACT_SENTRY_ENVIRONMENT="kerala-care-gov"
REACT_CUSTOM_LOGO={"light": "https://kerala.care/kerala-light_custom_logo.svg","dark": "https://kerala.care/kerala-dark_custom_logo.svg"}
REACT_STATE_LOGO={"light": "https://kerala.care/kerala-light_state_logo.png","dark": "https://kerala.care/kerala-dark_state_logo.png"}


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

Expand Down
13 changes: 0 additions & 13 deletions .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ REACT_CUSTOM_DESCRIPTION=
# Google Maps API key
REACT_GMAPS_API_KEY=

# Government data API key
REACT_GOV_DATA_API_KEY=

# reCAPTCHA site key
REACT_RECAPTCHA_SITE_KEY=

Expand All @@ -47,19 +44,9 @@ REACT_SENTRY_DSN=
# Sentry environment (default: staging)
REACT_SENTRY_ENVIRONMENT=

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

# Camera feed, still watching idle timeout (in seconds; default: 180)
REACT_STILL_WATCHING_IDLE_TIMEOUT=

# Camera feed, still watching prompt duration (in seconds; default: 30)
REACT_STILL_WATCHING_PROMPT_DURATION=

# Feature flags
REACT_ENABLE_HCX=true
REACT_ENABLE_ABDM=true
REACT_WARTIME_SHIFTING=true

# JWT token refresh interval (in milliseconds) (default: 5 minutes)
REACT_JWT_TOKEN_REFRESH_INTERVAL=
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label-merge-conflict.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ jobs:
wait_ms: 15000
detect_merge_changes: false
conflict_comment: |
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.
Conflicts have been detected against the base branch. Please merge the base branch into your branch.
cc: @${author}
> _See: https://docs.ohc.network/docs/contributing#how-to-resolve-merge-conflicts_
3 changes: 3 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ jobs:

- name: Run lint
run: npm run lint -- --quiet

- name: Run unimported
run: npm run unimported
2 changes: 1 addition & 1 deletion .github/workflows/ossar-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

# Run open source static analysis tools
- name: Run OSSAR
uses: github/ossar-action@fae13e456b9973657a670eef6bccc3a4c2b5153d
uses: github/ossar-action@v1
id: ossar

# Upload results to the Security tab
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ src/pluginMap.ts
# Federation Temp files
/.__mf__temp
public/sbom/*
public/_headers
54 changes: 54 additions & 0 deletions .unimportedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"ignorePatterns": [
"node_modules/**",
"**/*.d.ts"
],
"ignoreUnimported": [
"src/Locale/update_locale.js",
"src/PluginRegistry.ts",
"src/pluginTypes.ts",
"src/service-worker.ts"
],
"ignoreUnused": [
"@fontsource/figtree",
"@originjs/vite-plugin-federation",
"@vitejs/plugin-react",
"browserslist-useragent-regexp",
"cross-env",
"postcss-loader"
],
"ignoreUnresolved": [
[
"./pluginMap",
[
"src/pluginTypes.ts"
]
],
[
"@/supportedBrowsers",
[
"src/components/ErrorPages/BrowserWarning.tsx"
]
],
[
"tsx/cjs",
[
"node_modules/find-cypress-specs/src/index.js"
]
],
[
"virtual:pwa-register",
[
"src/index.tsx"
]
]
],
"respectGitignore": true,
"entry": [
"src/index.tsx",
"vite.config.mts",
"tailwind.config.js",
"cypress.config.ts",
"scripts/**"
]
}
22 changes: 1 addition & 21 deletions care.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,7 @@ const careConfig = {
gmapsApiKey:
env.REACT_GMAPS_API_KEY || "AIzaSyDsBAc3y7deI5ZO3NtK5GuzKwtUzQNJNUk",

govDataApiKey:
env.REACT_GOV_DATA_API_KEY ||
"579b464db66ec23bdd000001cdd3946e44ce4aad7209ff7b23ac571b",
reCaptchaSiteKey:
env.REACT_RECAPTCHA_SITE_KEY || "6LdvxuQUAAAAADDWVflgBqyHGfq-xmvNJaToM0pN",

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

wartimeShifting: boolean("REACT_WARTIME_SHIFTING"),

stillWatching: {
idleTimeout: env.REACT_STILL_WATCHING_IDLE_TIMEOUT
? parseInt(env.REACT_STILL_WATCHING_IDLE_TIMEOUT)
: 3 * 60,
promptDuration: env.REACT_STILL_WATCHING_PROMPT_DURATION
? parseInt(env.REACT_STILL_WATCHING_PROMPT_DURATION)
: 30,
},
reCaptchaSiteKey: env.REACT_RECAPTCHA_SITE_KEY,

auth: {
tokenRefreshInterval: env.REACT_JWT_TOKEN_REFRESH_INTERVAL
Expand Down
14 changes: 8 additions & 6 deletions cypress/e2e/patient_spec/patient_creation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
PatientFormData,
patientCreation,
} from "@/pageObject/Patients/PatientCreation";
import { patientDashboard } from "@/pageObject/Patients/PatientDashboard";
import { PatientEncounter } from "@/pageObject/Patients/PatientEncounter";
import { patientVerify } from "@/pageObject/Patients/PatientVerify";
import { FacilityCreation } from "@/pageObject/facility/FacilityCreation";
Expand All @@ -18,6 +17,7 @@ const patientEncounter = new PatientEncounter();
const ENCOUNTER_TYPE = "Observation";
const ENCOUNTER_STATUS = "In Progress";
const ENCOUNTER_PRIORITY = "ASAP";
const ORGANIZATION_NAME = "Administration";

describe("Patient Management", () => {
const TEST_PHONE = "9495031234";
Expand Down Expand Up @@ -107,7 +107,7 @@ describe("Patient Management", () => {

patientTestCases.forEach(({ description, data }) => {
it(`creates a new ${description} and verifies registration`, () => {
facilityCreation.selectFacility("GHC Trikaripur");
facilityCreation.selectFacility("GHC payyanur");
patientCreation
.clickSearchPatients()
.clickCreateNewPatient()
Expand All @@ -123,10 +123,11 @@ describe("Patient Management", () => {
.selectEncounterType(ENCOUNTER_TYPE)
.selectEncounterStatus(ENCOUNTER_STATUS)
.selectEncounterPriority(ENCOUNTER_PRIORITY)
.selectOrganization(ORGANIZATION_NAME)
.clickSubmitEncounter()
.assertEncounterCreationSuccess();

patientDashboard.verifyEncounterPatientInfo([
patientEncounter.verifyEncounterPatientInfo([
ENCOUNTER_TYPE,
ENCOUNTER_STATUS,
ENCOUNTER_PRIORITY,
Expand All @@ -135,7 +136,7 @@ describe("Patient Management", () => {
});

it("Search patient with phone number and create a new encounter", () => {
facilityCreation.selectFacility("GHC Trikaripur");
facilityCreation.selectFacility("GHC payyanur");
patientCreation
.clickSearchPatients()
.searchPatient(TEST_PHONE)
Expand All @@ -151,10 +152,11 @@ describe("Patient Management", () => {
.selectEncounterType(ENCOUNTER_TYPE)
.selectEncounterStatus(ENCOUNTER_STATUS)
.selectEncounterPriority(ENCOUNTER_PRIORITY)
.selectOrganization(ORGANIZATION_NAME)
.clickSubmitEncounter()
.assertEncounterCreationSuccess();

patientDashboard.verifyEncounterPatientInfo([
patientEncounter.verifyEncounterPatientInfo([
ENCOUNTER_TYPE,
ENCOUNTER_STATUS,
ENCOUNTER_PRIORITY,
Expand All @@ -168,7 +170,7 @@ describe("Patient Management", () => {
address: generateAddress(true),
};

facilityCreation.selectFacility("GHC Trikaripur");
facilityCreation.selectFacility("GHC payyanur");
patientEncounter
.navigateToEncounters()
.openFirstEncounterDetails()
Expand Down
35 changes: 35 additions & 0 deletions cypress/e2e/patient_spec/patient_details.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { PatientDetails } from "@/pageObject/Patients/PatientDetails";
import { PatientEncounter } from "@/pageObject/Patients/PatientEncounter";
import { FacilityCreation } from "@/pageObject/facility/FacilityCreation";

const facilityCreation = new FacilityCreation();
const patientEncounter = new PatientEncounter();
const patientDetails = new PatientDetails();

describe("Patient Management", () => {
beforeEach(() => {
cy.loginByApi("devdoctor");
cy.visit("/");
});

it("Assign users to a patient", () => {
const userName = "nihal-nurse";
const userRole = "Nurse";
facilityCreation.selectFacility("GHC payyanur");
patientEncounter
.navigateToEncounters()
.openFirstEncounterDetails()
.clickPatientDetailsButton();
patientDetails
.clickUsersTab()
.clickAssignUserButton()
.selectUserToAssign(userName)
.selectUserRole(userRole)
.confirmUserAssignment()
.verifyUserAssignmentSuccess()
.verifyUserContent([userName])
.clickRemoveUserButton()
.confirmUserRemoval()
.verifyUserRemovalSuccess();
});
});
2 changes: 1 addition & 1 deletion cypress/e2e/patient_spec/patient_encounter.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe("Patient Encounter Questionnaire", () => {
pco2: "120",
po2: "80",
};
facilityCreation.selectFacility("GHC Trikaripur");
facilityCreation.selectFacility("GHC payyanur");

// Chain the methods instead of multiple separate calls
patientEncounter
Expand Down
4 changes: 4 additions & 0 deletions cypress/fixtures/users.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@
"devnurse": {
"username": "dev-nurse",
"password": "Test@123"
},
"devdoctor": {
"username": "developdoctor",
"password": "Test@123"
}
}
8 changes: 0 additions & 8 deletions cypress/pageObject/Patients/PatientDashboard.ts

This file was deleted.

61 changes: 61 additions & 0 deletions cypress/pageObject/Patients/PatientDetails.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
export class PatientDetails {
clickUsersTab() {
cy.verifyAndClickElement('[data-cy="tab-users"]', "Users");
return this;
}

clickAssignUserButton() {
cy.verifyAndClickElement('[data-cy="assign-user-button"]', "Assign User");
return this;
}

selectUserToAssign(username: string) {
cy.typeAndSelectOption(
'[data-cy="patient-user-selector-container"]',
username,
false,
);
return this;
}

selectUserRole(role: string) {
cy.clickAndSelectOption('[data-cy="patient-user-role-select"]', role);
return this;
}

confirmUserAssignment() {
cy.verifyAndClickElement(
'[data-cy="patient-user-assign-button"]',
"Assign to Patient",
);
return this;
}

verifyUserAssignmentSuccess() {
cy.verifyNotification("User added to patient successfully");
return this;
}

clickRemoveUserButton() {
cy.get('[data-cy="patient-user-remove-button"]').first().click();
return this;
}

confirmUserRemoval() {
cy.verifyAndClickElement(
'[data-cy="patient-user-remove-confirm-button"]',
"Remove",
);
return this;
}

verifyUserContent(expectedTexts: string[]) {
cy.verifyContentPresence('[data-cy="patient-users"]', expectedTexts);
return this;
}

verifyUserRemovalSuccess() {
cy.verifyNotification("User removed successfully");
return this;
}
}
14 changes: 9 additions & 5 deletions cypress/pageObject/Patients/PatientEncounter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ export class PatientEncounter {
}

clickUpdateEncounter() {
cy.verifyAndClickElement('[data-cy="update-encounter-button"]', "Update");
cy.verifyAndClickElement(
'[data-cy="update-encounter-option"]',
"Update Encounter",
);
return this;
}

verifyEncounterPatientInfo(contents: string[]) {
cy.verifyContentPresence("#patient-infobadges", contents);
return this;
}

// Questionnaire actions
addQuestionnaire(questionnaireName: string) {
cy.get('[data-cy="add-questionnaire-button"]').click();
Expand Down Expand Up @@ -71,10 +75,10 @@ export class PatientEncounter {
}

clickPatientDetailsButton() {
cy.verifyAndClickElement(
'[data-cy="patient-details-button"]',
"Patient Details",
);
cy.get('[data-cy="patient-details-button"]')
.filter(":visible")
.first()
.click();
return this;
}

Expand Down
Loading

0 comments on commit f190163

Please sign in to comment.