diff --git a/cypress/e2e/users_spec/user_creation.cy.ts b/cypress/e2e/users_spec/user_creation.cy.ts
index d9b3e52ddaf..33fd7cb958d 100644
--- a/cypress/e2e/users_spec/user_creation.cy.ts
+++ b/cypress/e2e/users_spec/user_creation.cy.ts
@@ -37,7 +37,7 @@ describe("User Creation", () => {
"Please select the User Type",
"Please enter valid phone number",
"Please enter the username",
- "Please enter date in YYYY/MM/DD format",
+ "Please enter date in DD/MM/YYYY format",
"Please enter the password",
"Confirm password is required",
"First Name is required",
@@ -52,10 +52,7 @@ describe("User Creation", () => {
const EXPECTED_PROFILE_ERROR_MESSAGES = [
"Field is required",
"Field is required",
- "This field is required",
"Please enter valid phone number",
- "This field is required",
- "This field is required",
];
before(() => {
@@ -81,7 +78,6 @@ describe("User Creation", () => {
"District Editted"
);
userCreationPage.typeIntoElementByIdPostClear("lastName", "Cypress");
- userCreationPage.typeIntoElementByIdPostClear("age", "22");
userCreationPage.selectDropdownOption("gender", "Male");
userCreationPage.typeIntoElementByIdPostClear(
"phoneNumber",
@@ -93,6 +89,10 @@ describe("User Creation", () => {
);
userCreationPage.typeIntoElementByIdPostClear("email", "test@test.com");
userCreationPage.typeIntoElementByIdPostClear("weekly_working_hours", "14");
+ userCreationPage.typeIntoElementByIdPostClearDob(
+ "date_of_birth",
+ "01011998"
+ );
userCreationPage.clickElementById("submit");
userCreationPage.verifyElementContainsText(
"contactno-profile-details",
@@ -110,7 +110,10 @@ describe("User Creation", () => {
"lastname-profile-details",
"Cypress"
);
- userCreationPage.verifyElementContainsText("age-profile-details", "22");
+ userCreationPage.verifyElementContainsText(
+ "date_of_birth-profile-details",
+ "01/01/1998"
+ );
userCreationPage.verifyElementContainsText(
"emailid-profile-details",
"test@test.com"
@@ -130,7 +133,6 @@ describe("User Creation", () => {
userCreationPage.clickElementById("edit-cancel-profile-button");
userCreationPage.clearIntoElementById("firstName");
userCreationPage.clearIntoElementById("lastName");
- userCreationPage.clearIntoElementById("age");
userCreationPage.clearIntoElementById("phoneNumber");
userCreationPage.clearIntoElementById("altPhoneNumber");
userCreationPage.clearIntoElementById("weekly_working_hours");
diff --git a/cypress/e2e/users_spec/user_profile.cy.ts b/cypress/e2e/users_spec/user_profile.cy.ts
index 3f3202eb423..3cbc2e91404 100644
--- a/cypress/e2e/users_spec/user_profile.cy.ts
+++ b/cypress/e2e/users_spec/user_profile.cy.ts
@@ -8,7 +8,7 @@ describe("Manage User Profile", () => {
const userProfilePage = new UserProfilePage();
const manageUserPage = new ManageUserPage();
- const age = "30";
+ const date_of_birth = "01011999";
const gender = "Male";
const email = "test@example.com";
const phone = "+918899887788";
@@ -32,10 +32,10 @@ describe("Manage User Profile", () => {
cy.awaitUrl("/user/profile");
});
- it("Set Age, Gender, Email, Phone and Working Hours for a user and verify its reflection in user profile", () => {
+ it("Set Dob, Gender, Email, Phone and Working Hours for a user and verify its reflection in user profile", () => {
userProfilePage.clickEditProfileButton();
- userProfilePage.typeAge(age);
+ userProfilePage.typedate_of_birth(date_of_birth);
userProfilePage.selectGender(gender);
userProfilePage.typeEmail(email);
userProfilePage.typePhone(phone);
@@ -49,7 +49,7 @@ describe("Manage User Profile", () => {
cy.verifyNotification("Details updated successfully");
- userProfilePage.assertAge(age);
+ userProfilePage.assertdate_of_birth("01/01/1999");
userProfilePage.assertGender(gender);
userProfilePage.assertEmail(email);
userProfilePage.assertPhone(phone);
diff --git a/cypress/pageobject/Users/UserCreation.ts b/cypress/pageobject/Users/UserCreation.ts
index 32127ffcb90..c10d853f706 100644
--- a/cypress/pageobject/Users/UserCreation.ts
+++ b/cypress/pageobject/Users/UserCreation.ts
@@ -17,7 +17,10 @@ export class UserCreationPage {
.click()
.type(value);
}
-
+ typeIntoElementByIdPostClearDob(elementId: string, value: string) {
+ cy.get("#" + elementId).click();
+ cy.get("#date-input").clear().type(value);
+ }
clearIntoElementById(elementId: string) {
cy.get("#" + elementId)
.click()
diff --git a/cypress/pageobject/Users/UserProfilePage.ts b/cypress/pageobject/Users/UserProfilePage.ts
index 3f71a29181b..cb5f6d11f1c 100644
--- a/cypress/pageobject/Users/UserProfilePage.ts
+++ b/cypress/pageobject/Users/UserProfilePage.ts
@@ -1,3 +1,5 @@
+import { cy } from "local-cypress";
+
export default class UserProfilePage {
assertVideoConnectLink(link: string) {
cy.get("#videoconnectlink-profile-details").should("contain.text", link);
@@ -15,8 +17,10 @@ export default class UserProfilePage {
cy.get("#submit").click();
}
- typeAge(age: string) {
- cy.get("#age").click().clear().type(age);
+ typedate_of_birth(date_of_birth: string) {
+ //check
+ cy.get("#date_of_birth").click();
+ cy.get("#date-input").clear().type(date_of_birth);
}
selectGender(gender: string) {
@@ -55,8 +59,11 @@ export default class UserProfilePage {
.type(medicalCouncilRegistration);
};
- assertAge(age: string) {
- cy.get("#age-profile-details").should("contain.text", age);
+ assertdate_of_birth(date_of_birth: string) {
+ cy.get("#date_of_birth-profile-details").should(
+ "contain.text",
+ date_of_birth
+ );
}
assertGender(gender: string) {
diff --git a/plugins/treeShakeCareIcons.mts b/plugins/treeShakeCareIcons.mts
new file mode 100644
index 00000000000..bf1713a0625
--- /dev/null
+++ b/plugins/treeShakeCareIcons.mts
@@ -0,0 +1,94 @@
+import { Plugin } from "vite";
+import * as fs from "fs";
+import * as path from "path";
+import * as glob from "glob";
+
+/**
+ * Interface defining options for the treeShakeUniconPathsPlugin.
+ *
+ * @interface TreeShakeUniconPathsPluginOptions
+ * @property {string[]} iconWhitelist - An array of icon names to always include, even if not found in code.
+ */
+
+export interface TreeShakeCareIconsOptions {
+ iconWhitelist: string[];
+}
+
+/**
+ * Creates a Webpack plugin that tree-shakes unused Unicon paths from UniconPaths.json in production builds.
+ *
+ * @param {TreeShakeCareIconsOptions} [options] - Optional configuration options. Defaults to an empty iconWhitelist.
+ * @returns {Plugin} Webpack plugin object.
+ */
+
+export function treeShakeCareIcons(
+ options: TreeShakeCareIconsOptions = { iconWhitelist: [] }
+): Plugin {
+ const rootDir = path.resolve(__dirname, ".."); // update this if moving this code to a different file
+ const lineIconNameRegex = /"l-[a-z]+(?:-[a-z]+)*"/g;
+ const allUniconPaths = JSON.parse(
+ fs.readFileSync(
+ path.resolve(rootDir, "src/CAREUI/icons/UniconPaths.json"),
+ "utf8"
+ )
+ );
+
+ // Extracts icon names from a given file's content.
+ // Returns an array of icon names like ["l-eye", "l-sync", "l-hearbeat"]
+ function extractCareIconNames(file: string): string[] {
+ const fileContent = fs.readFileSync(file, "utf8");
+
+ const lineIconNameMatches = fileContent.match(lineIconNameRegex) || [];
+
+ const lineIconNames = lineIconNameMatches.map(
+ (lineIconName) => lineIconName.slice(1, -1) // remove quotes
+ );
+
+ return lineIconNames;
+ }
+ // Finds all used icon names within the project's source files (`.tsx` or `.res` extensions).
+ function getAllUsedIconNames() {
+ const files = glob.sync(path.resolve(rootDir, "src/**/*.{tsx,res}"));
+ const usedIconsArray: string[] = [];
+
+ files.forEach((file) => {
+ const iconNames = extractCareIconNames(file);
+ usedIconsArray.push(...iconNames);
+ });
+
+ return new Set(usedIconsArray);
+ }
+ // Generates a map of used icon names to their paths from UniconPaths.json, including any whitelisted icons.
+ function getTreeShakenUniconPaths() {
+ const usedIcons = [...getAllUsedIconNames(), ...options.iconWhitelist];
+ const treeshakenCareIconPaths = {};
+
+ for (const iconName of usedIcons) {
+ const path = allUniconPaths[iconName];
+ if (path === undefined) {
+ throw new Error(`Icon ${iconName} is not found in UniconPaths.json`);
+ } else {
+ treeshakenCareIconPaths[iconName] = path;
+ }
+ }
+
+ return treeshakenCareIconPaths;
+ }
+
+ return {
+ name: "tree-shake-care-icons",
+ transform(_src, id) {
+ if (process.env.NODE_ENV !== "production") {
+ return;
+ }
+
+ // Replace the UniconPaths with the tree-shaken version
+ if (id.endsWith("UniconPaths.json")) {
+ return {
+ code: `export default ${JSON.stringify(getTreeShakenUniconPaths())}`,
+ map: null,
+ };
+ }
+ },
+ };
+}
diff --git a/src/CAREUI/display/RecordMeta.tsx b/src/CAREUI/display/RecordMeta.tsx
index 5e1e117f9d6..662c61fd73f 100644
--- a/src/CAREUI/display/RecordMeta.tsx
+++ b/src/CAREUI/display/RecordMeta.tsx
@@ -44,7 +44,7 @@ const RecordMeta = ({
{user && !inlineUser && (
by
-
-
-
{
-
{props.user.user_type}
{t("sign_out")}
Updated successfully
diff --git a/src/Components/Common/components/ButtonV2.tsx b/src/Components/Common/components/ButtonV2.tsx
index 2f3d3002451..4dc6c71ac82 100644
--- a/src/Components/Common/components/ButtonV2.tsx
+++ b/src/Components/Common/components/ButtonV2.tsx
@@ -171,7 +171,7 @@ export const Submit = ({ label = "Submit", ...props }: CommonButtonProps) => {
type="submit"
children={
<>
-
@@ -673,7 +673,10 @@ const AssetCreate = (props: AssetProps) => {
className="ml-1 mt-1 flex h-10 cursor-pointer items-center justify-self-end rounded border border-gray-400 px-4 hover:bg-gray-200"
onClick={() => setIsScannerActive(true)}
>
-
{diagnosis.label}
//Discharge patient from CARE
-Caution: this action is irreversible.
Select a doctor to connect via video
- {[ - { - title: "Doctors", - user_type: "Doctor", - home: true, - }, - { - title: "Nurse", - user_type: "Nurse", - home: true, - }, - { - title: "TeleICU Hub", - user_type: "Doctor", - home: false, - }, - ].map((type, i) => ( +
-
- {user.first_name} {user.last_name}
+ {skill.name} {skill.name}
+
A Triage already exist on this date
} diff --git a/src/Components/Facility/models.tsx b/src/Components/Facility/models.tsx index 58386bef3a4..1e590797f83 100644 --- a/src/Components/Facility/models.tsx +++ b/src/Components/Facility/models.tsx @@ -7,6 +7,7 @@ import { ConsultationDiagnosis, CreateDiagnosis } from "../Diagnosis/types"; import { NormalPrescription, PRNPrescription } from "../Medicine/models"; import { AssignedToObjectModel, DailyRoundsModel } from "../Patient/models"; import { UserBareMinimum } from "../Users/models"; +import { ConsentRecord } from "./ConsultationForm"; export interface LocalBodyModel { id: number; @@ -164,6 +165,7 @@ export interface ConsultationModel { is_readmission?: boolean; medico_legal_case?: boolean; investigation?: InvestigationType[]; + consent_records?: ConsentRecord[]; } export interface PatientStatsModel { diff --git a/src/Components/Form/AutoCompleteAsync.tsx b/src/Components/Form/AutoCompleteAsync.tsx index 4ad68e96d73..762c9f2d136 100644 --- a/src/Components/Form/AutoCompleteAsync.tsx +++ b/src/Components/Form/AutoCompleteAsync.tsx @@ -109,7 +109,8 @@ const AutoCompleteAsync = (props: Props) => { {hasSelection && !loading && !required && (Add Patient Details
@@ -801,7 +804,7 @@ export const PatientManager = () => { setShowDoctors(true); }} > -Doctor Connect
)} @@ -831,7 +834,7 @@ export const PatientManager = () => { }} className="mr-5 w-full lg:w-fit" > -Log Update
@@ -537,8 +540,8 @@ export default function PatientInfoCard(props: { <>
Link ABHA Number
Track Shifting
Shift Patient
{t("discharge_summary")}
@@ -1208,7 +1211,7 @@ export const PatientRegister = (props: PatientRegisterProps) => {
setQuery({ extId: "" }, { replace: true });
}}
>
-
Linked Facilities
Linked Skills
Set Average weekly working hours
{asset?.name}