Skip to content

Commit

Permalink
Merge branch 'develop' into doctors-notes
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 authored Sep 24, 2024
2 parents 953421c + e9e262d commit 4c376a8
Show file tree
Hide file tree
Showing 61 changed files with 1,614 additions and 1,200 deletions.
1 change: 1 addition & 0 deletions .github/runner-files/jwks.b64.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eyJrZXlzIjogW3sibiI6ICJ4X21fNGNKQ3NHTHN4WkFIa2VCbFZQa2ZqNFNSckdHN3UySERFM3VLX3dFNERhTWhHQ2lxTXFsaTFDM2pxSE5JTVhuWV9ab1M5R3pHbnJpdGg1UUZGVDlLMGtBdF9YaXBJNnV1djcwOWtOV2FFNXZrYks4VlFRcFd2UFp4NUJSeTBGay0wU2lxZG1xOTNJRXdUTnNTLUpETnRXQm5VX0F1cjU0UXptQmI3SmhfOGttRDAtaHhROVZVejRpSUU3QTlySU5vQXNHSHhfdGtuNXd6YmpPR3F2Q3JqRi1RWXo0OGJXVkZzVVliNkFqUlFrZER2RWVwQlpNSHZsNVUxQlZxOVdRTTJGTmRUR0tJb3ZYeDRuTDFybUVONHpxbEpqWmc2bEZiODVuOUhkc01VblFiSXhkUjVlVl8wWmNVaHBrQWc0NldrejRZWkxMNm5NaGR0RmFTMXciLCAiZSI6ICJBUUFCIiwgImQiOiAiRXo4T3dDZ2xxZnREWlhwSXVEbjhGck1KWGhNNHZfb0NDdlZNUko1QjBPd3BuR3BrWDRKZWF4VFJYYkZ5OVQzdkowX2VXZjRQcl9XZUloMk5HZnpkaGw5NmtJUzd5R2JxQkhSY0U3a2ZhVWFkbHlDTVdnZDV5TEk1aWVOQUw5N2w4X1o2N0w5NHRIX3VlUF80Q1pXV0hGVTNieXJ4bHVzSld6NmZ5SFVPczlVSDFxV284V1RNOVp0RndqV0cxOWpkUXZ1RkQ0Z0x4UEJYZEk5ZV9zdTNwbmZHR0ZkN0xfMDFwcEFkQ2Y5eHhNTWFEel8wZ0xXM0NENFhnW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ThHZGdLU3pMd2dCWTdEeUE3MkR2UG9CUHQtODgiLCAicWkiOiAiSlF0UUJERXdnQVVMcWJFRWoybmdyXy02aV9pUmdRWmJTQ0hXNGdpZG5fdHlwdUJWS2R0ZW1jT3J6M3NnTnk0ekZrZElTbUZfbmdnbFlJb080TjNza1NNUXdGY1B0S1kzWUVlT2ZGNzMzRDZaTVJtSTFTby12QU54YVBDUkREbnUwTWk1TnUzbS02SkhGSFF5RDU2ZTFsQUlwUS1lakpuTWR6MXQ0aUplbEFzIiwgImt0eSI6ICJSU0EiLCAia2lkIjogIlhjckcyVS0tR3B4SVhORXpKOWNWREdRaEUzeXlIamREMDN1aDZmYXpRX2siLCAiYWxnIjogIlJTMjU2In1dfQ==
3 changes: 3 additions & 0 deletions .github/workflows/cypress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ jobs:
cd care
echo DISABLE_RATELIMIT=True >> docker/.prebuilt.env
echo "CORS_ALLOWED_ORIGINS=\"[\\\"http://localhost:4000\\\"]\"" >> docker/.prebuilt.env
echo JWKS_BASE64=\"$(cat ../.github/runner-files/jwks.b64.txt)\" >> docker/.prebuilt.env
make docker_config_file=docker-compose.pre-built.yaml up
make docker_config_file=docker-compose.pre-built.yaml load-dummy-data
cd ..
env:
JWKS_BASE64: ${{ secrets.JWKS_BASE64 }}

- name: Wait for care to be up ♻
uses: nick-fields/retry@v2
Expand Down
1 change: 1 addition & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ export default defineConfig({
},
env: {
API_URL: process.env.REACT_CARE_API_URL ?? "http://localhost:9000",
ENABLE_HCX: process.env.REACT_ENABLE_HCX ?? false,
},
});
1 change: 1 addition & 0 deletions cypress/e2e/assets_spec/AssetHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ describe("Asset Tab", () => {

it("Export asset", () => {
assetPage.selectassetimportbutton();
cy.wait(2000);
assetPage.selectjsonexportbutton();
assetPage.selectassetimportbutton();
assetPage.selectcsvexportbutton();
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/facility_spec/FacilityCreation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ describe("Facility Creation", () => {
facilityPage.submitForm();
cy.closeNotification();
// create multiple bed capacity and verify card reflection
facilityPage.selectBedType("Oxygen beds");
facilityPage.selectBedType("Oxygen Supported Bed");
facilityPage.fillTotalCapacity(bedCapacity);
facilityPage.fillCurrentlyOccupied(bedOccupancy);
facilityPage.clickbedcapcityaddmore();
Expand Down Expand Up @@ -216,7 +216,7 @@ describe("Facility Creation", () => {
facilityPage.fillPhoneNumber(facilityNumber);
facilityPage.submitForm();
// add the bed capacity
facilityPage.selectBedType("Oxygen beds");
facilityPage.selectBedType("Oxygen Supported Bed");
facilityPage.fillTotalCapacity(oxygenCapacity);
facilityPage.fillCurrentlyOccupied(oxygenExpected);
facilityPage.saveAndExitBedCapacityForm();
Expand Down
21 changes: 8 additions & 13 deletions cypress/e2e/facility_spec/FacilityHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ describe("Facility Homepage Function", () => {
const userPage = new UserPage();
const assetPagination = new AssetPagination();
const facilitiesAlias = "downloadFacilitiesCSV";
const capacitiesAlias = "downloadCapacitiesCSV";
const doctorsAlias = "downloadDoctorsCSV";
const triagesAlias = "downloadTriagesCSV";
const facilityName = "Dummy Facility 40";
Expand Down Expand Up @@ -91,30 +90,26 @@ describe("Facility Homepage Function", () => {
});

it("Verify Facility Export Functionality", () => {
// Download the Facilities CSV
// Verify Facility Export
facilityHome.csvDownloadIntercept(facilitiesAlias, "");
facilityHome.clickExportButton();
facilityHome.clickMenuItem("Facilities");
facilityHome.verifyDownload(facilitiesAlias);
facilityHome.clickSearchButton(); // to avoid flaky test, as sometimes, the test is unable to focus on the object
// Download the Capacities CSV
facilityHome.csvDownloadIntercept(capacitiesAlias, "&capacity");
facilityHome.clickExportButton();
facilityHome.clickMenuItem("Capacities");
facilityHome.verifyDownload(capacitiesAlias);
facilityHome.clickSearchButton();
// Download the Doctors CSV
// Verify Doctor Export
facilityHome.csvDownloadIntercept(doctorsAlias, "&doctors");
facilityHome.clickExportButton();
facilityHome.clickMenuItem("Doctors");
facilityHome.verifyDownload(doctorsAlias);
facilityHome.clickSearchButton();
// Download the Triages CSV
// Verify Triage Export
facilityHome.csvDownloadIntercept(triagesAlias, "&triage");
facilityHome.clickExportButton();
facilityHome.clickMenuItem("Triages");
facilityHome.verifyDownload(triagesAlias);
facilityHome.clickSearchButton();
});

it("Verify Capacity Export Functionality", () => {
facilityHome.clickExportButton();
facilityHome.clickMenuItem("Capacities");
});

it("Verify Facility Detail page redirection to CNS and Live Minitoring ", () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/facility_spec/FacilityManage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ describe("Facility Manage Functions", () => {
it("Modify bed capacity in Facility detail page", () => {
// add multiple new bed capacity
facilityManage.clickFacilityAddBedTypeButton();
facilityPage.selectBedType("Oxygen beds");
facilityPage.selectBedType("Isolation Bed");
facilityPage.fillTotalCapacity(totalCapacity);
facilityPage.fillCurrentlyOccupied(currentOccupied);
facilityPage.saveAndExitBedCapacityForm();
Expand Down
232 changes: 119 additions & 113 deletions cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
const patientLogupdate = new PatientLogupdate();
const patientInvestigation = new PatientInvestigation();
const patientPrescription = new PatientPrescription();
const domicilaryPatient = "Dummy Patient 11";
const patientCategory = "Moderate";
const additionalSymptoms = "Fever";
const physicalExamination = "physical examination details";
const otherExamination = "Other";
const patientSystolic = "119";
const patientDiastolic = "150";
const patientModifiedSystolic = "120";
const patientModifiedDiastolic = "145";
const patientSystolic = "149";
const patientDiastolic = "119";
const patientModifiedSystolic = "145";
const patientModifiedDiastolic = "120";
const patientPulse = "152";
const patientTemperature = "96.6";
const patientRespiratory = "140";
Expand All @@ -33,6 +32,13 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
const patientInsulinDosage = "56";
const patientFluidBalance = "500";
const patientNetBalance = "1000";
const patientOne = "Dummy Patient 9";
const bedOne = "Dummy Bed 5";
const patientTwo = "Dummy Patient 10";
const bedTwo = "Dummy Bed 2";
const patientThree = "Dummy Patient 8";
const bedThree = "Dummy Bed 3";
const domicilaryPatient = "Dummy Patient 11";

before(() => {
loginPage.loginAsDisctrictAdmin();
Expand All @@ -45,15 +51,110 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.awaitUrl("/patients");
});

it("Create a basic critical care log update for a admitted patient and edit it", () => {
patientPage.visitPatient("Dummy Patient 10");
it("Create a new TeleIcu log update for a domicilary care patient", () => {
patientPage.visitPatient(domicilaryPatient);
patientConsultationPage.clickEditConsultationButton();
patientConsultationPage.selectPatientSuggestion("Domiciliary Care");
cy.submitButton("Update Consultation");
cy.verifyNotification("Consultation updated successfully");
cy.closeNotification();
patientLogupdate.clickLogupdate();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.selectRoundType("Tele-medicine Log");
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typeOtherDetails(otherExamination);
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.typeSystolic(patientSystolic);
patientLogupdate.typeDiastolic(patientDiastolic);
patientLogupdate.typePulse(patientPulse);
patientLogupdate.typeTemperature(patientTemperature);
patientLogupdate.typeRespiratory(patientRespiratory);
patientLogupdate.typeSpo2(patientSpo2);
patientLogupdate.selectRhythm(patientRhythmType);
patientLogupdate.typeRhythm(patientRhythm);
cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
cy.submitButton("Save");
cy.verifyNotification("Tele-medicine Log created successfully");
});

it("Create a new Progress log update for a admitted patient and edit it", () => {
patientPage.visitPatient(patientOne);
patientLogupdate.clickLogupdate();
cy.verifyNotification("Please assign a bed to the patient");
patientLogupdate.selectBed("Dummy Bed 2");
patientLogupdate.selectBed(bedOne);
cy.closeNotification();
patientLogupdate.clickLogupdate();
// Only will be using random non-unique progress note fields
patientLogupdate.selectRoundType("Progress Note");
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.typeTemperature(patientTemperature);
// add diagnosis
patientConsultationPage.selectPatientDiagnosis(
"1A06",
"add-icd11-diagnosis-as-differential",
);
// add a investigation for the patient
patientInvestigation.clickAddInvestigation();
patientInvestigation.selectInvestigation("Vitals (GROUP)");
patientInvestigation.clickInvestigationCheckbox();
patientInvestigation.selectInvestigationFrequency("6");
// add a medicine for the patient
patientPrescription.clickAddPrescription();
patientPrescription.interceptMedibase();
patientPrescription.selectMedicinebox();
patientPrescription.selectMedicine("DOLO");
patientPrescription.enterDosage("4");
patientPrescription.selectDosageFrequency("Twice daily");
cy.submitButton("Submit");
cy.verifyNotification("Medicine prescribed");
cy.closeNotification();
// Submit the doctors log update
cy.submitButton("Save and Continue");
cy.verifyNotification("Progress Note created successfully");
cy.closeNotification();
// modify the relevant critical care log update
patientLogupdate.selectCriticalCareSection("Neurological Monitoring");
cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
cy.get("#left_pupil_light_reaction-option-FIXED").click();
cy.submitButton("Update Details");
cy.verifyNotification(
"Neurological Monitoring details succesfully updated.",
);
cy.closeNotification();
// Final Submission of the form
cy.submitButton("Complete");
cy.verifyNotification("Progress Note Log Update filed successfully");
cy.closeNotification();
// Verify the data reflection
cy.contains("button", "Daily Rounds").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
patientCategory,
);
cy.verifyContentPresence("#consultation-preview", [
patientCategory,
patientTemperature,
]);
// verify the edit functionality
patientLogupdate.clickUpdateDetail();
patientLogupdate.typeSystolic(patientModifiedSystolic);
patientLogupdate.typeDiastolic(patientModifiedDiastolic);
cy.submitButton("Continue");
cy.verifyNotification("Progress Note updated successfully");
});

it("Create a basic critical care log update for a admitted patient and edit it", () => {
patientPage.visitPatient(patientTwo);
patientLogupdate.clickLogupdate();
cy.verifyNotification("Please assign a bed to the patient");
patientLogupdate.selectBed(bedTwo);
cy.closeNotification();
patientLogupdate.clickLogupdate();
patientLogupdate.selectRoundType("Detailed Update");
patientLogupdate.selectPatientCategory(patientCategory);
cy.submitButton("Save and Continue");
cy.verifyNotification("Detailed Update created successfully");
cy.closeNotification();
Expand Down Expand Up @@ -127,88 +228,19 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
]);
});

it("Create a new Progress log update for a admitted patient and edit it", () => {
patientPage.visitPatient("Dummy Patient 12");
it("Create a new Normal update for a admission patient and verify its reflection in cards", () => {
patientPage.visitPatient(patientThree);
patientLogupdate.clickLogupdate();
cy.verifyNotification("Please assign a bed to the patient");
patientLogupdate.selectBed("Dummy Bed 4");
cy.closeNotification();
patientLogupdate.clickLogupdate();
// Only will be using random non-unique progress note fields
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.selectRoundType("Progress Note");
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.typeTemperature(patientTemperature);
// add diagnosis
patientConsultationPage.selectPatientDiagnosis(
"1A06",
"add-icd11-diagnosis-as-differential",
);
// add a investigation for the patient
patientInvestigation.clickAddInvestigation();
patientInvestigation.selectInvestigation("Vitals (GROUP)");
patientInvestigation.clickInvestigationCheckbox();
patientInvestigation.selectInvestigationFrequency("6");
// add a medicine for the patient
patientPrescription.clickAddPrescription();
patientPrescription.interceptMedibase();
patientPrescription.selectMedicinebox();
patientPrescription.selectMedicine("DOLO");
patientPrescription.enterDosage("4");
patientPrescription.selectDosageFrequency("Twice daily");
cy.submitButton("Submit");
cy.verifyNotification("Medicine prescribed");
cy.closeNotification();
// Submit the doctors log update
cy.submitButton("Save and Continue");
cy.verifyNotification("Progress Note created successfully");
cy.closeNotification();
// modify the relevant critical care log update
patientLogupdate.selectCriticalCareSection("Neurological Monitoring");
cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
cy.get("#left_pupil_light_reaction-option-FIXED").click();
cy.submitButton("Update Details");
cy.verifyNotification(
"Neurological Monitoring details succesfully updated.",
);
cy.closeNotification();
// Final Submission of the form
cy.submitButton("Complete");
cy.verifyNotification("Progress Note Log Update filed successfully");
cy.closeNotification();
// Verify the data reflection
cy.contains("button", "Daily Rounds").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
patientCategory,
);
cy.verifyContentPresence("#consultation-preview", [
patientCategory,
patientTemperature,
]);
// verify the edit functionality
patientLogupdate.clickUpdateDetail();
patientLogupdate.typeSystolic(patientModifiedSystolic);
patientLogupdate.typeDiastolic(patientModifiedDiastolic);
cy.submitButton("Continue");
cy.verifyNotification("Progress Note updated successfully");
});

it("Create a new TeleIcu log update for a domicilary care patient", () => {
patientPage.visitPatient("Dummy Patient 11");
patientConsultationPage.clickEditConsultationButton();
patientConsultationPage.selectPatientSuggestion("Domiciliary Care");
cy.submitButton("Update Consultation");
cy.verifyNotification("Consultation updated successfully");
patientLogupdate.selectBed(bedThree);
cy.closeNotification();
patientLogupdate.clickLogupdate();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.selectRoundType("Tele-medicine Log");
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typeOtherDetails(otherExamination);
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.clickAddSymptom();
patientLogupdate.typeSystolic(patientSystolic);
patientLogupdate.typeDiastolic(patientDiastolic);
patientLogupdate.typePulse(patientPulse);
Expand All @@ -219,7 +251,11 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typeRhythm(patientRhythm);
cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
cy.submitButton("Save");
cy.verifyNotification("Tele-medicine Log created successfully");
cy.wait(2000);
cy.verifyNotification("Brief Update created successfully");
// Verify the card content
cy.get("#basic-information").scrollIntoView();
cy.verifyContentPresence("#encounter-symptoms", [additionalSymptoms]);
});

it("Create a new Normal Log update for a domicilary care patient and edit it", () => {
Expand Down Expand Up @@ -283,36 +319,6 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
]);
});

it("Create a new Normal update for a admission patient and verify its reflection in cards", () => {
patientPage.visitPatient("Dummy Patient 13");
patientLogupdate.clickLogupdate();
cy.verifyNotification("Please assign a bed to the patient");
patientLogupdate.selectBed("Dummy Bed 6");
cy.closeNotification();
patientLogupdate.clickLogupdate();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.typeOtherDetails(otherExamination);
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.clickAddSymptom();
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typeSystolic(patientSystolic);
patientLogupdate.typeDiastolic(patientDiastolic);
patientLogupdate.typePulse(patientPulse);
patientLogupdate.typeTemperature(patientTemperature);
patientLogupdate.typeRespiratory(patientRespiratory);
patientLogupdate.typeSpo2(patientSpo2);
patientLogupdate.selectRhythm(patientRhythmType);
patientLogupdate.typeRhythm(patientRhythm);
cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
cy.submitButton("Save");
cy.wait(2000);
cy.verifyNotification("Brief Update created successfully");
// Verify the card content
cy.get("#basic-information").scrollIntoView();
cy.verifyContentPresence("#encounter-symptoms", [additionalSymptoms]);
});

it("Create a Normal Log update to verify MEWS Score Functionality", () => {
patientPage.visitPatient(domicilaryPatient);
patientConsultationPage.clickEditConsultationButton();
Expand Down
Loading

0 comments on commit 4c376a8

Please sign in to comment.