Skip to content

Commit

Permalink
Merge branch 'develop' into issues/10129/button_width
Browse files Browse the repository at this point in the history
  • Loading branch information
modamaan authored Jan 27, 2025
2 parents 7713c93 + 4ae8e8b commit 8c09547
Show file tree
Hide file tree
Showing 61 changed files with 1,983 additions and 986 deletions.
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
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;
}
}
24 changes: 22 additions & 2 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@
"add_new_patient": "Add New Patient",
"add_new_user": "Add New User",
"add_notes": "Add notes",
"add_notes_about_diagnosis": "Add notes about the diagnosis...",
"add_notes_about_symptom": "Add notes about the symptom...",
"add_organizations": "Add Organizations",
"add_patient_updates": "Add Patient Updates",
"add_policy": "Add Insurance Policy",
Expand Down Expand Up @@ -385,6 +387,7 @@
"allow_transfer": "Allow Transfer",
"allowed_formats_are": "Allowed formats are {{formats}}.",
"already_a_member": "Already a member?",
"already_marked_as_error": "Already marked as error",
"alternate_phone_number": "Alternate Phone Number",
"ambulance_driver_name": "Name of ambulance driver",
"ambulance_number": "Ambulance No",
Expand Down Expand Up @@ -490,6 +493,7 @@
"bed_type__500": "Others",
"before": "before",
"beta": "beta",
"biologic": "Biologic",
"bladder": "Bladder",
"blood_group": "Blood Group",
"blood_group_is_required": "Blood group is required",
Expand Down Expand Up @@ -984,9 +988,9 @@
"enter_valid_dob": "Enter a valid date of birth",
"enter_valid_dob_age": "Please enter an age greater than 15 years",
"enter_year_of_birth_to_verify": "Enter year of birth to verify",
"entered-in-error": "Entered in error",
"entered_in_error": "Entered in Error",
"entered_in_error_warning": "This action cannot be undone. The appointment will be marked as entered in error and removed from the system.",
"environment": "Environment",
"error_404": "Error 404",
"error_deleting_shifting": "Error while deleting Shifting record",
"error_fetching_facility_data": "Error while fetching facility data",
Expand Down Expand Up @@ -1076,6 +1080,7 @@
"filter_by_date": "Filter by Date",
"filters": "Filters",
"first_name": "First Name",
"food": "Food",
"footer_body": "Open Healthcare Network is an open-source public utility designed by a multi-disciplinary team of innovators and volunteers. Open Healthcare Network CARE is a Digital Public Good recognised by the United Nations.",
"forget_password": "Forgot password?",
"forget_password_instruction": "Enter your username, and if it exists, we will send you a link to reset your password.",
Expand Down Expand Up @@ -1127,7 +1132,7 @@
"hearing": "We are hearing you...",
"help_confirmed": "There is sufficient diagnostic and/or clinical evidence to treat this as a confirmed condition.",
"help_differential": "One of a set of potential (and typically mutually exclusive) diagnoses asserted to further guide the diagnostic process and preliminary treatment.",
"help_entered-in-error": "The statement was entered in error and is not valid.",
"help_entered_in_error": "The statement was entered in error and is not valid.",
"help_provisional": "This is a tentative diagnosis - still a candidate that is under consideration.",
"help_refuted": "This condition has been ruled out by subsequent diagnostic and clinical evidence.",
"help_unconfirmed": "There is not sufficient diagnostic and/or clinical evidence to treat this as a confirmed condition.",
Expand All @@ -1140,6 +1145,7 @@
"hi__record_not_fetched_title": "This record hasn't been fetched yet",
"hi__waiting_for_record": "Waiting for the Host HIP to send the record.",
"hide": "Hide",
"hide_notes": "Hide notes",
"high": "High",
"history": "History",
"home_facility": "Home Facility",
Expand All @@ -1154,6 +1160,7 @@
"icmr_specimen_referral_form": "ICMR Specimen Referral Form",
"immunisation-records": "Immunisation",
"in_consultation": "In-Consultation",
"inactive": "Inactive",
"incomplete_patient_details_warning": "Patient details are incomplete. Please update the details before proceeding.",
"inconsistent_dosage_units_error": "Dosage units must be same",
"indian_mobile": "Indian Mobile",
Expand Down Expand Up @@ -1336,6 +1343,7 @@
"middleware_hostname": "Middleware Hostname",
"middleware_hostname_example": "e.g. example.ohc.network",
"middleware_hostname_sourced_from": "Middleware hostname sourced from {{ source }}",
"mild": "Mild",
"min_char_length_error": "Must be at least {{ min_length }} characters",
"min_password_len_8": "Minimum password length 8",
"min_time_bw_doses": "Min. time b/w doses",
Expand All @@ -1349,6 +1357,7 @@
"mobile_otp_send_success": "OTP has been sent to the given mobile number.",
"mobile_otp_verify_error": "Failed to verify mobile number. Please try again later.",
"mobile_otp_verify_success": "Mobile number has been verified successfully.",
"moderate": "Moderate",
"modification_caution_note": "No modifications possible once added",
"modified": "Modified",
"modified_date": "Modified Date",
Expand Down Expand Up @@ -1730,6 +1739,7 @@
"record_has_been_deleted_successfully": "Record has been deleted successfully.",
"record_updates": "Record Updates",
"recording": "Recording",
"recurrence": "Recurrence",
"redirected_to_create_consultation": "Note: You will be redirected to create consultation form. Please complete the form to finish the transfer process",
"reference_no": "Reference No",
"referral_letter": "Referral Letter",
Expand All @@ -1742,13 +1752,17 @@
"register_patient": "Register Patient",
"reject": "Reject",
"rejected": "Rejected",
"relapse": "Relapse",
"related_person": "Related Person",
"reload": "Reload",
"remarks": "Remarks",
"remarks_placeholder": "Enter remarks",
"remission": "Remission",
"remove": "Remove",
"remove_diagnosis": "Remove Diagnosis",
"remove_medication": "Remove Medication",
"remove_medication_confirmation": "Are you sure you want to remove {{medication}}?",
"remove_symptom": "Remove Symptom",
"remove_user": "Remove User",
"remove_user_organization": "Remove User from Organization",
"remove_user_warn": "Are you sure you want to remove {{firstName}} {{lastName}} from this organization? This action cannot be undone.",
Expand Down Expand Up @@ -1789,6 +1803,7 @@
"reset": "Reset",
"reset_password": "Reset Password",
"reset_password_note_self": "Enter your current password, then create and confirm your new password",
"resolved": "Resolved",
"resource": "Resource",
"resource_approving_facility": "Resource approving facility",
"resource_created_successfully": "Request created successfully",
Expand Down Expand Up @@ -1870,7 +1885,9 @@
"search_by_phone_number": "Search by Phone Number",
"search_by_username": "Search by username",
"search_encounters": "Search Encounters",
"search_for_diagnoses_to_add": "Search for diagnoses to add",
"search_for_facility": "Search for Facility",
"search_for_symptoms_to_add": "Search for symptoms to add",
"search_icd11_placeholder": "Search for ICD-11 Diagnoses",
"search_investigation_placeholder": "Search Investigation & Groups",
"search_medication": "Search Medication",
Expand Down Expand Up @@ -1958,6 +1975,7 @@
"set_home_facility": "Set as home facility",
"set_your_local_language": "Set your local language",
"settings_and_filters": "Settings and Filters",
"severe": "Severe",
"severity": "Severity",
"severity_of_breathlessness": "Severity of Breathlessness",
"sex": "Sex",
Expand Down Expand Up @@ -2094,6 +2112,7 @@
"type_to_search": "Type to search",
"type_your_comment": "Type your comment",
"type_your_reason_here": "Type your reason here",
"unable_to_assess": "Unable to Assess",
"unable_to_get_current_position": "Unable to get current position.",
"unable_to_get_location: ": "Unable to get location: ",
"unassign": "Unassign",
Expand Down Expand Up @@ -2245,6 +2264,7 @@
"video_conference_link": "Video Conference Link",
"view": "View",
"view_abdm_records": "View ABDM Records",
"view_all": "view all",
"view_all_details": "View All Details",
"view_and_manage_patient_encounters": "View and manage patient encounters",
"view_asset": "View Assets",
Expand Down
4 changes: 2 additions & 2 deletions public/locale/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@
"encounter_suggestion_edit_disallowed": "संपादन परामर्श में इस विकल्प पर स्विच करने की अनुमति नहीं है",
"enter_file_name": "फ़ाइल का नाम दर्ज करें",
"enter_valid_age": "कृपया वैध आयु दर्ज करें",
"entered-in-error": "त्रुटिवश प्रविष्ट हुआ",
"entered_in_error": "त्रुटिवश प्रविष्ट हुआ",
"error_404": "त्रुटि 404",
"error_deleting_shifting": "शिफ्टिंग रिकॉर्ड हटाते समय त्रुटि",
"error_while_deleting_record": "रिकॉर्ड हटाते समय त्रुटि हुई",
Expand Down Expand Up @@ -392,7 +392,7 @@
"goal": "हमारा लक्ष्य डिजिटल उपकरणों का उपयोग करके सार्वजनिक स्वास्थ्य सेवाओं की गुणवत्ता और पहुंच में निरंतर सुधार करना है।",
"help_confirmed": "इस स्थिति को पुष्ट मानने के लिए पर्याप्त नैदानिक और/या नैदानिक साक्ष्य मौजूद हैं।",
"help_differential": "संभावित (और आमतौर पर परस्पर अनन्य) निदानों के एक समूह में से एक, जो निदान प्रक्रिया और प्रारंभिक उपचार को आगे बढ़ाने के लिए निर्देशित किया जाता है।",
"help_entered-in-error": "यह कथन गलती से दर्ज किया गया है और मान्य नहीं है।",
"help_entered_in_error": "यह कथन गलती से दर्ज किया गया है और मान्य नहीं है।",
"help_provisional": "यह एक अस्थायी निदान है - अभी भी इस पर विचार किया जा रहा है।",
"help_refuted": "बाद के निदानात्मक और नैदानिक साक्ष्यों से इस स्थिति को खारिज कर दिया गया है।",
"help_unconfirmed": "इसे एक पुष्ट स्थिति मानने के लिए पर्याप्त नैदानिक और/या नैदानिक साक्ष्य उपलब्ध नहीं हैं।",
Expand Down
4 changes: 2 additions & 2 deletions public/locale/kn.json
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@
"encounter_suggestion_edit_disallowed": "ಸಂಪಾದನೆ ಸಮಾಲೋಚನೆಯಲ್ಲಿ ಈ ಆಯ್ಕೆಗೆ ಬದಲಾಯಿಸಲು ಅನುಮತಿಸಲಾಗುವುದಿಲ್ಲ",
"enter_file_name": "ಫೈಲ್ ಹೆಸರನ್ನು ನಮೂದಿಸಿ",
"enter_valid_age": "ದಯವಿಟ್ಟು ಮಾನ್ಯವಾದ ವಯಸ್ಸನ್ನು ನಮೂದಿಸಿ",
"entered-in-error": "ತಪ್ಪಾಗಿ ನಮೂದಿಸಲಾಗಿದೆ",
"entered_in_error": "ತಪ್ಪಾಗಿ ನಮೂದಿಸಲಾಗಿದೆ",
"error_404": "ದೋಷ 404",
"error_deleting_shifting": "ಶಿಫ್ಟಿಂಗ್ ರೆಕಾರ್ಡ್ ಅನ್ನು ಅಳಿಸುವಾಗ ದೋಷ",
"error_while_deleting_record": "ದಾಖಲೆಯನ್ನು ಅಳಿಸುವಾಗ ದೋಷ",
Expand Down Expand Up @@ -394,7 +394,7 @@
"goal": "ಡಿಜಿಟಲ್ ಉಪಕರಣಗಳನ್ನು ಬಳಸಿಕೊಂಡು ಸಾರ್ವಜನಿಕ ಆರೋಗ್ಯ ಸೇವೆಗಳ ಗುಣಮಟ್ಟ ಮತ್ತು ಪ್ರವೇಶವನ್ನು ನಿರಂತರವಾಗಿ ಸುಧಾರಿಸುವುದು ನಮ್ಮ ಗುರಿಯಾಗಿದೆ",
"help_confirmed": "ಇದನ್ನು ದೃಢಪಡಿಸಿದ ಸ್ಥಿತಿ ಎಂದು ಪರಿಗಣಿಸಲು ಸಾಕಷ್ಟು ರೋಗನಿರ್ಣಯ ಮತ್ತು/ಅಥವಾ ಕ್ಲಿನಿಕಲ್ ಪುರಾವೆಗಳಿವೆ.",
"help_differential": "ರೋಗನಿರ್ಣಯ ಪ್ರಕ್ರಿಯೆ ಮತ್ತು ಪ್ರಾಥಮಿಕ ಚಿಕಿತ್ಸೆಯನ್ನು ಮತ್ತಷ್ಟು ಮಾರ್ಗದರ್ಶನ ಮಾಡಲು ಸಮರ್ಥಿಸಲಾದ ಸಂಭಾವ್ಯ (ಮತ್ತು ಸಾಮಾನ್ಯವಾಗಿ ಪರಸ್ಪರ ಪ್ರತ್ಯೇಕವಾದ) ರೋಗನಿರ್ಣಯಗಳ ಒಂದು ಸೆಟ್.",
"help_entered-in-error": "ಹೇಳಿಕೆಯನ್ನು ತಪ್ಪಾಗಿ ನಮೂದಿಸಲಾಗಿದೆ ಮತ್ತು ಮಾನ್ಯವಾಗಿಲ್ಲ.",
"help_entered_in_error": "ಹೇಳಿಕೆಯನ್ನು ತಪ್ಪಾಗಿ ನಮೂದಿಸಲಾಗಿದೆ ಮತ್ತು ಮಾನ್ಯವಾಗಿಲ್ಲ.",
"help_provisional": "ಇದು ತಾತ್ಕಾಲಿಕ ರೋಗನಿರ್ಣಯ - ಇನ್ನೂ ಪರಿಗಣನೆಯಲ್ಲಿರುವ ಅಭ್ಯರ್ಥಿ.",
"help_refuted": "ನಂತರದ ರೋಗನಿರ್ಣಯ ಮತ್ತು ಕ್ಲಿನಿಕಲ್ ಪುರಾವೆಗಳಿಂದ ಈ ಸ್ಥಿತಿಯನ್ನು ತಳ್ಳಿಹಾಕಲಾಗಿದೆ.",
"help_unconfirmed": "ಇದನ್ನು ದೃಢಪಡಿಸಿದ ಸ್ಥಿತಿ ಎಂದು ಪರಿಗಣಿಸಲು ಸಾಕಷ್ಟು ರೋಗನಿರ್ಣಯ ಮತ್ತು/ಅಥವಾ ವೈದ್ಯಕೀಯ ಪುರಾವೆಗಳಿಲ್ಲ.",
Expand Down
4 changes: 2 additions & 2 deletions public/locale/ml.json
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@
"enter_valid_dob": "ഒരു സാധുവായ ജനനത്തീയതി നൽകുക",
"enter_valid_dob_age": "ദയവായി 15 വയസ്സിൽ കൂടുതലുള്ള ഒരു പ്രായം നൽകുക",
"enter_year_of_birth_to_verify": "സ്ഥിരീകരിക്കാൻ ജനന വർഷം നൽകുക",
"entered-in-error": "തെറ്റായി നൽകി",
"entered_in_error": "തെറ്റായി നൽകി",
"entered_in_error": "പിശകിൽ പ്രവേശിച്ചു",
"error_404": "പിശക് 404",
"error_deleting_shifting": "ഷിഫ്റ്റിംഗ് റെക്കോർഡ് ഇല്ലാതാക്കുന്നതിൽ പിശക്",
Expand Down Expand Up @@ -1015,7 +1015,7 @@
"hearing": "ഞങ്ങൾ പറയുന്നത് കേൾക്കുന്നു...",
"help_confirmed": "ഇത് ഒരു സ്ഥിരീകരിച്ച അവസ്ഥയായി കണക്കാക്കാൻ മതിയായ ഡയഗ്നോസ്റ്റിക് കൂടാതെ/അല്ലെങ്കിൽ ക്ലിനിക്കൽ തെളിവുകൾ ഉണ്ട്.",
"help_differential": "രോഗനിർണ്ണയ പ്രക്രിയയ്ക്കും പ്രാഥമിക ചികിത്സയ്ക്കും കൂടുതൽ മാർഗ്ഗനിർദ്ദേശം നൽകുന്നതിന് സാധ്യതയുള്ള (സാധാരണയായി പരസ്പരവിരുദ്ധമായ) രോഗനിർണയങ്ങളിൽ ഒന്ന്.",
"help_entered-in-error": "പ്രസ്‌താവന തെറ്റായി നൽകിയതിനാൽ സാധുതയില്ല.",
"help_entered_in_error": "പ്രസ്‌താവന തെറ്റായി നൽകിയതിനാൽ സാധുതയില്ല.",
"help_provisional": "ഇതൊരു താൽക്കാലിക രോഗനിർണയമാണ് - ഇപ്പോഴും പരിഗണനയിലിരിക്കുന്ന ഒരു സ്ഥാനാർത്ഥി.",
"help_refuted": "തുടർന്നുള്ള ഡയഗ്നോസ്റ്റിക്, ക്ലിനിക്കൽ തെളിവുകൾ വഴി ഈ അവസ്ഥ ഒഴിവാക്കിയിട്ടുണ്ട്.",
"help_unconfirmed": "ഇത് ഒരു സ്ഥിരീകരിച്ച അവസ്ഥയായി കണക്കാക്കാൻ മതിയായ ഡയഗ്നോസ്റ്റിക് കൂടാതെ/അല്ലെങ്കിൽ ക്ലിനിക്കൽ തെളിവുകൾ ഇല്ല.",
Expand Down
Loading

0 comments on commit 8c09547

Please sign in to comment.