Skip to content

Commit

Permalink
Merge branch 'ohcnetwork:develop' into issue/#10071/selection-slot
Browse files Browse the repository at this point in the history
  • Loading branch information
AnveshNalimela authored Jan 27, 2025
2 parents 3ed6f5b + a481488 commit 794e109
Show file tree
Hide file tree
Showing 69 changed files with 2,222 additions and 1,315 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/combine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- name: Combine dependencies
id: combine-dependencies
uses: github/combine-prs@v5.0.0
uses: github/combine-prs@v5.2.0
with:
pr_title: Combined dependencies # The title of the pull request to create
select_label: dependencies # The label which marks PRs that should be combined.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/comment-p1-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
issues: write
steps:
- name: Add comment
uses: actions/github-script@v6.3.3
uses: actions/github-script@v6.4.1
with:
script: |
const body = ':warning: **Refrain from assigning this issue to yourself if you have another `P1` issue assigned that is not yet closed.**'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/issue-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
if: github.repository == 'ohcnetwork/care_fe' && github.event_name == 'issues' && github.event.action == 'opened' || github.event.action == 'reopened'
steps:
- name: 'Move issue to "Triage"'
uses: leonsteinhaeuser/project-beta-automations@v1.2.1
uses: leonsteinhaeuser/project-beta-automations@v1.3.0
with:
gh_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
organization: ohcnetwork
Expand All @@ -26,7 +26,7 @@ jobs:
if: github.repository == 'ohcnetwork/care_fe' && github.event_name == 'issues' && github.event.action == 'closed'
steps:
- name: 'Moved issue to "Done"'
uses: leonsteinhaeuser/project-beta-automations@v1.2.1
uses: leonsteinhaeuser/project-beta-automations@v1.3.0
with:
gh_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
organization: ohcnetwork
Expand All @@ -39,7 +39,7 @@ jobs:
if: github.repository == 'ohcnetwork/care_fe' && github.event_name == 'issues' && github.event.action == 'assigned'
steps:
- name: 'Move issue to "In Progress"'
uses: leonsteinhaeuser/project-beta-automations@v1.2.1
uses: leonsteinhaeuser/project-beta-automations@v1.3.0
with:
gh_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
organization: ohcnetwork
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/thank-you.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
contents: write
steps:
- name: Add thankyou note
uses: actions/github-script@v6.3.3
uses: actions/github-script@v6.4.1
with:
script: |
const thankyouNote = 'Your efforts have helped advance digital healthcare and TeleICU systems. :rocket: Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! :raised_hands:';
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"useTabs": false,
"tabWidth": 2,
"semi": true,
"endOfLine": "lf",
"endOfLine": "auto",
"jsxSingleQuote": false,
"arrowParens": "always",
"tailwindFunctions": ["classNames"],
Expand Down
29 changes: 25 additions & 4 deletions care.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,31 @@ const careConfig = {
},

careApps: env.REACT_ENABLED_APPS
? env.REACT_ENABLED_APPS.split(",").map((app) => ({
branch: app.split("@")[1],
package: app.split("@")[0],
}))
? env.REACT_ENABLED_APPS.split(",").map((app) => {
const [module, cdn] = app.split("@");
const [org, repo] = module.split("/");

if (!org || !repo) {
throw new Error(
`Invalid plug configuration: ${module}. Expected 'org/repo@url'.`,
);
}

let url = "";
if (!cdn) {
url = `https://${org}.github.io/${repo}`;
}

if (!url.startsWith("http")) {
url = `${cdn.includes("localhost") ? "http" : "https"}://${cdn}`;
}

return {
url: new URL(url).toString(),
name: repo,
package: module,
};
})
: [],

plotsConfigUrl:
Expand Down
31 changes: 31 additions & 0 deletions cypress/e2e/patient_spec/patient_encounter.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { PatientEncounter } from "pageObject/Patients/PatientEncounter";
import { FacilityCreation } from "pageObject/facility/FacilityCreation";

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

describe("Patient Encounter Questionnaire", () => {
beforeEach(() => {
// Login and set up any necessary test state
cy.visit("/login");
});

it("Create a new ABG questionnaire and verify the values", () => {
const abgValues = {
pco2: "120",
po2: "80",
};
cy.loginByApi("devnurse");
facilityCreation.selectFacility("GHC Trikaripur");

// Chain the methods instead of multiple separate calls
patientEncounter
.navigateToEncounters()
.openFirstEncounterDetails()
.clickUpdateEncounter()
.addQuestionnaire("Arterial Blood Gas")
.fillQuestionnaire(abgValues)
.submitQuestionnaire()
.verifyOverviewValues(Object.values(abgValues));
});
});
4 changes: 4 additions & 0 deletions cypress/fixtures/users.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@
"staff": {
"username": "nihalstaff",
"password": "Test@123"
},
"devnurse": {
"username": "dev-nurse",
"password": "Test@123"
}
}
72 changes: 72 additions & 0 deletions cypress/pageObject/Patients/PatientEncounter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
export class PatientEncounter {
// Navigation
navigateToEncounters() {
cy.get('[data-sidebar="content"]').contains("Encounters").click();
return this;
}

openFirstEncounterDetails() {
cy.get('[data-cy="encounter-list-cards"]')
.first()
.contains("View Details")
.click();
return this;
}

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

// Questionnaire actions
addQuestionnaire(questionnaireName: string) {
cy.get('[data-cy="add-questionnaire-button"]').click();
cy.get('[role="dialog"] input')
.should("be.visible")
.type(questionnaireName);
cy.get('[role="dialog"] button')
.contains(questionnaireName)
.should("be.visible")
.click();
return this;
}

fillQuestionnaire(answers: Record<string, string>) {
Object.entries(answers).forEach(([field, value]) => {
// Handle both text inputs and select dropdowns
cy.get(`[data-cy="question-${field}"]`).then(($el) => {
if ($el.is("select")) {
cy.wrap($el).select(value);
} else {
cy.wrap($el).type(value);
}
});
});
return this;
}

submitQuestionnaire() {
this.clickSubmitQuestionnaire();
this.verifyQuestionnaireSubmission();
return this;
}

clickSubmitQuestionnaire() {
cy.clickSubmitButton("Submit");
return this;
}

verifyQuestionnaireSubmission() {
cy.verifyNotification("Questionnaire submitted successfully");
return this;
}

verifyOverviewValues(expectedValues: string[]) {
cy.verifyContentPresence('[data-cy="encounter-overview"]', expectedValues);
return this;
}
}
Loading

0 comments on commit 794e109

Please sign in to comment.