Skip to content

Commit

Permalink
Merge branch 'issues/8926/add-sample-test' of https://github.com/Javi…
Browse files Browse the repository at this point in the history
…dSumra/care_fe into pr/8977
  • Loading branch information
nihal467 committed Nov 18, 2024
2 parents a38fab3 + 6369c15 commit 1ec01aa
Show file tree
Hide file tree
Showing 6 changed files with 196 additions and 46 deletions.
5 changes: 5 additions & 0 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"APPETITE__NO_TASTE_FOR_FOOD": "No taste for food",
"APPETITE__REDUCED": "Reduced",
"APPETITE__SATISFACTORY": "Satisfactory",
"APPROVED": "Approved",
"AUTOMATED": "Automated",
"BED_WITH_OXYGEN_SUPPORT": "Bed with Oxygen Support",
"BLADDER_DRAINAGE__CONDOM_CATHETER": "Condom Catheter",
Expand Down Expand Up @@ -140,6 +141,7 @@
"OXYGEN_MODALITY__NON_REBREATHING_MASK_short": "NRM",
"OXYGEN_MODALITY__SIMPLE_FACE_MASK": "Simple Face Mask",
"OXYGEN_MODALITY__SIMPLE_FACE_MASK_short": "SFM",
"PENDING": "Pending",
"PRESCRIPTION_FREQUENCY_BD": "Twice daily",
"PRESCRIPTION_FREQUENCY_HS": "Night only",
"PRESCRIPTION_FREQUENCY_OD": "Once daily",
Expand Down Expand Up @@ -205,6 +207,7 @@
"SORT_OPTIONS__taken_at": "Oldest taken date first",
"Submit": "Submit",
"TELEMEDICINE": "Telemedicine",
"TRANSPORTATION TO BE ARRANGED": "Transportation",
"URINATION_FREQUENCY__DECREASED": "Decreased",
"URINATION_FREQUENCY__INCREASED": "Increased",
"URINATION_FREQUENCY__NORMAL": "Normal",
Expand Down Expand Up @@ -905,6 +908,7 @@
"no_log_update_delta": "No changes since previous log update",
"no_log_updates": "No log updates found",
"no_notices_for_you": "No notices for you.",
"no_patients_found": "No Patients Found",
"no_patients_to_show": "No patients to show.",
"no_policy_added": "No Insurance Policy Added",
"no_policy_found": "No Insurance Policy Found for this Patient",
Expand Down Expand Up @@ -1102,6 +1106,7 @@
"resource_approving_facility": "Resource approving facility",
"resource_origin_facility": "Origin Facility",
"resource_request": "Resource Request",
"resource_status": "Resource Status",
"result": "Result",
"result_date": "Result Date",
"result_details": "Result details",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Common/AvatarEditModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ const AvatarEditModal = ({
<ButtonV2
id="save-cover-image"
onClick={uploadAvatar}
disabled={isProcessing}
disabled={isProcessing || !selectedFile}
>
{isProcessing ? (
<CareIcon
Expand Down
50 changes: 27 additions & 23 deletions src/components/Facility/CentralNursingStation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ import HL7PatientVitalsMonitor from "@/components/VitalsMonitor/HL7PatientVitals
import useVitalsAspectRatioConfig from "@/components/VitalsMonitor/useVitalsAspectRatioConfig";
import { getVitalsMonitorSocketUrl } from "@/components/VitalsMonitor/utils";

import useBreakpoints from "@/hooks/useBreakpoints";
import useFilters from "@/hooks/useFilters";
import useFullscreen from "@/hooks/useFullscreen";

import routes from "@/Utils/request/api";
import useQuery from "@/Utils/request/useQuery";

const PER_PAGE_LIMIT = 6;

const SORT_OPTIONS: SortOption[] = [
{ isAscending: true, value: "bed__name" },
{ isAscending: false, value: "-bed__name" },
Expand All @@ -41,31 +40,34 @@ interface Props {
}

export default function CentralNursingStation({ facilityId }: Props) {
const perPageLimit = useBreakpoints({
default: 6,
"4xl": 9,
"4k": 24,
});
const { t } = useTranslation();
const [isFullscreen, setFullscreen] = useFullscreen();
const { qParams, updateQuery, removeFilter, updatePage } = useFilters({
limit: PER_PAGE_LIMIT,
limit: perPageLimit,
});
const query = useQuery(routes.listPatientAssetBeds, {
pathParams: { facility_external_id: facilityId },
query: {
...qParams,
page: qParams.page || 1,
limit: PER_PAGE_LIMIT,
offset: (qParams.page ? qParams.page - 1 : 0) * PER_PAGE_LIMIT,
limit: perPageLimit,
offset: (qParams.page ? qParams.page - 1 : 0) * perPageLimit,
asset_class: "HL7MONITOR",
ordering: qParams.ordering || "bed__name",
bed_is_occupied:
qParams.monitors_without_patient === "true" ? undefined : "true",
},
});

const totalCount = query.data?.count ?? 0;
const data = query.data?.results.map((obj) => ({
patientAssetBed: obj,
socketUrl: getVitalsMonitorSocketUrl(obj.asset),
}));

const { config, hash } = useVitalsAspectRatioConfig({
default: 6 / 11,
sm: 17 / 11,
Expand All @@ -88,7 +90,7 @@ export default function CentralNursingStation({ facilityId }: Props) {
<Pagination
className=""
cPage={qParams.page}
defaultPerPage={PER_PAGE_LIMIT}
defaultPerPage={perPageLimit}
data={{ totalCount }}
onChange={(page) => updatePage(page)}
/>
Expand Down Expand Up @@ -216,21 +218,23 @@ export default function CentralNursingStation({ facilityId }: Props) {
{t("no_vitals_present")}
</div>
) : (
<div className="3xl:grid-cols-3 mt-1 grid grid-cols-1 gap-1 lg:grid-cols-2">
{data.map((props, i) => (
<div className="overflow-hidden text-clip" key={i}>
<HL7PatientVitalsMonitor
patientCurrentBedAssignmentDate={
props.patientAssetBed?.patient?.last_consultation?.current_bed
?.start_date
}
key={`${props.patientAssetBed?.bed.id}-${hash}`}
patientAssetBed={props.patientAssetBed}
socketUrl={props.socketUrl || ""}
config={config}
/>
</div>
))}
<div className="@container">
<div className="mt-1 grid grid-cols-1 gap-1 @5xl:grid-cols-2 @7xl:grid-cols-3 @[140rem]:grid-cols-4 @[180rem]:grid-cols-5 @[240rem]:grid-cols-6">
{data.map((props, i) => (
<div className="overflow-hidden text-clip" key={i}>
<HL7PatientVitalsMonitor
patientCurrentBedAssignmentDate={
props.patientAssetBed?.patient?.last_consultation
?.current_bed?.start_date
}
key={`${props.patientAssetBed?.bed.id}-${hash}`}
patientAssetBed={props.patientAssetBed}
socketUrl={props.socketUrl || ""}
config={config}
/>
</div>
))}
</div>
</div>
)}
</Page>
Expand Down
7 changes: 4 additions & 3 deletions src/components/Patient/ManagePatients.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ export const PatientManager = () => {
);

const LastAdmittedToTypeBadges = () => {
const badge = (key: string, value: any, id: string) => {
const badge = (key: string, value: string | undefined, id: string) => {
return (
value && (
<FilterBadge
Expand Down Expand Up @@ -421,7 +421,7 @@ export const PatientManager = () => {
};

const HasConsentTypesBadges = () => {
const badge = (key: string, value: any, id: string) => {
const badge = (key: string, value: string | undefined, id: string) => {
return (
value && (
<FilterBadge
Expand Down Expand Up @@ -773,7 +773,7 @@ export const PatientManager = () => {
managePatients = (
<div className="col-span-3 w-full rounded-lg bg-white p-2 py-8 pt-4 text-center">
<p className="text-2xl font-bold text-secondary-600">
No Patients Found
{t("no_patients_found")}
</p>
</div>
);
Expand Down Expand Up @@ -875,6 +875,7 @@ export const PatientManager = () => {
/>
{!!params.facility && (
<ButtonV2
className="w-full lg:w-fit"
id="doctor-connect-patient-button"
onClick={() => {
triggerGoal("Doctor Connect Clicked", {
Expand Down
Loading

0 comments on commit 1ec01aa

Please sign in to comment.