Skip to content

Commit

Permalink
Merge branch 'develop' into fix#6607
Browse files Browse the repository at this point in the history
  • Loading branch information
konavivekramakrishna authored Nov 22, 2023
2 parents b6a87cc + c1c4e56 commit 72a63e0
Show file tree
Hide file tree
Showing 39 changed files with 1,504 additions and 1,077 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
- master
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
IMAGE_NAME: care_fe
AWS_DEFAULT_REGION: ap-south-1
Expand Down
7 changes: 3 additions & 4 deletions cypress/e2e/patient_spec/patient_crud.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ describe("Patient Creation with consultation", () => {
updatePatientPage.visitConsultationPage();
patientPage.verifyStatusCode();
patientConsultationPage.fillIllnessHistory("history");
patientConsultationPage.selectConsultationStatus("Out-patient (walk in)");
patientConsultationPage.selectConsultationStatus(
"Outpatient/Emergency Room"
);
patientConsultationPage.selectSymptoms("ASYMPTOMATIC");

patientConsultationPage.enterConsultationDetails(
Expand Down Expand Up @@ -140,9 +142,6 @@ describe("Patient Creation with consultation", () => {
updatePatientPage.visitUpdatedPatient();
patientConsultationPage.visitEditConsultationPage();
patientConsultationPage.fillIllnessHistory("editted");
patientConsultationPage.selectConsultationStatus(
"Referred from other hospital"
);
patientConsultationPage.updateSymptoms("FEVER");
patientConsultationPage.setSymptomsDate("01082023");
patientConsultationPage.updateConsultation();
Expand Down
8 changes: 4 additions & 4 deletions cypress/pageobject/Patient/PatientConsultation.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export class PatientConsultationPage {
selectConsultationStatus(status: string) {
cy.get("#consultation_status").scrollIntoView();
cy.get("#consultation_status").should("be.visible");
cy.get("#consultation_status")
cy.get("#route_to_facility").scrollIntoView();
cy.get("#route_to_facility").should("be.visible");
cy.get("#route_to_facility")
.click()
.then(() => {
cy.get("[role='option']").contains(status).click();
Expand Down Expand Up @@ -60,7 +60,7 @@ export class PatientConsultationPage {
cy.get("#principal-diagnosis-select [role='option']").first().click();

cy.get("#consultation_notes").click().type(consulationNotes);
cy.get("#verified_by")
cy.get("#treating_physician")
.click()
.type(verificationBy)
.then(() => {
Expand Down
6 changes: 3 additions & 3 deletions src/CAREUI/misc/PaginatedList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ PaginatedList.Refresh = Refresh;

interface ItemsProps<TItem> {
className?: string;
children: (item: TItem) => JSX.Element | JSX.Element[];
children: (item: TItem, items: TItem[]) => JSX.Element | JSX.Element[];
shimmer?: JSX.Element;
shimmerCount?: number;
}
Expand All @@ -137,9 +137,9 @@ const Items = <TItem extends object>(props: ItemsProps<TItem>) => {
{props.shimmer}
</li>
))
: items.map((item, index) => (
: items.map((item, index, items) => (
<li key={index} className="w-full">
{props.children(item)}
{props.children(item, items)}
</li>
))}
</ul>
Expand Down
8 changes: 0 additions & 8 deletions src/Common/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,14 +332,6 @@ export const CONSULTATION_SUGGESTION = [
{ id: "DD", text: "Declare Death" },
];

export const CONSULTATION_STATUS = [
{ id: "1", text: "Brought Dead" },
{ id: "2", text: "Transferred from ward" },
{ id: "3", text: "Transferred from ICU" },
{ id: "4", text: "Referred from other hospital" },
{ id: "5", text: "Out-patient (walk in)" },
];

export const ADMITTED_TO = [
{ id: "1", text: "Isolation" },
{ id: "2", text: "ICU" },
Expand Down
3 changes: 1 addition & 2 deletions src/Components/ABDM/ConfigureHealthFacility.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { lazy, useReducer, useState } from "react";
import * as Notification from "../../Utils/Notifications.js";
import { navigate } from "raviger";
import { Cancel, Submit } from "../Common/components/ButtonV2";
import { Submit } from "../Common/components/ButtonV2";
import TextFormField from "../Form/FormFields/TextFormField";
import { classNames } from "../../Utils/utils";
import useQuery from "../../Utils/request/useQuery";
Expand Down Expand Up @@ -218,7 +218,6 @@ export const ConfigureHealthFacility = (props: any) => {
</div>
</div>
<div className="flex flex-col gap-3 sm:flex-row sm:justify-end">
<Cancel onClick={() => navigate(`/facility/${facilityId}`)} />
<Submit
onClick={handleSubmit}
disabled={
Expand Down
31 changes: 31 additions & 0 deletions src/Components/Common/RouteToFacilitySelect.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { SelectFormField } from "../Form/FormFields/SelectFormField";
import {
FormFieldBaseProps,
useFormFieldPropsResolver,
} from "../Form/FormFields/Utils";

export const ROUTE_TO_FACILITY_OPTIONS = {
10: "Outpatient/Emergency Room",
20: "Referred from another facility",
30: "Internal Transfer within the facility",
};

export type RouteToFacility = keyof typeof ROUTE_TO_FACILITY_OPTIONS;

export const keys = Object.keys(ROUTE_TO_FACILITY_OPTIONS).map((key) =>
parseInt(key)
) as RouteToFacility[];

type Props = FormFieldBaseProps<keyof typeof ROUTE_TO_FACILITY_OPTIONS>;

export default function RouteToFacilitySelect(props: Props) {
const field = useFormFieldPropsResolver(props as any);

return (
<SelectFormField
{...field}
options={keys}
optionLabel={(key) => ROUTE_TO_FACILITY_OPTIONS[key]}
/>
);
}
6 changes: 3 additions & 3 deletions src/Components/Facility/ConsultationDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -434,14 +434,14 @@ export const ConsultationDetails = (props: any) => {
diagnoses={consultationData.diagnoses || []}
/>

{(consultationData.verified_by_object ||
{(consultationData.treating_physician_object ||
consultationData.deprecated_verified_by) && (
<div className="mt-2 text-sm">
<span className="font-semibold leading-relaxed">
Treating Physician:{" "}
</span>
{consultationData.verified_by_object
? `${consultationData.verified_by_object.first_name} ${consultationData.verified_by_object.last_name}`
{consultationData.treating_physician_object
? `${consultationData.treating_physician_object.first_name} ${consultationData.treating_physician_object.last_name}`
: consultationData.deprecated_verified_by}
<i className="fas fa-check ml-2 fill-current text-lg text-green-500"></i>
</div>
Expand Down
Loading

0 comments on commit 72a63e0

Please sign in to comment.