Skip to content

Commit

Permalink
(fix) Update reusable patient header component imports
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen committed Nov 20, 2024
1 parent 8088aed commit 7f25bf3
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 120 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React, { useEffect, useState } from 'react';

import { SearchTypes } from '../types';
import PatientScheduledVisits from './patient-scheduled-visits.component';
import VisitForm from './visit-form/visit-form.component';
import { Button, DataTableSkeleton } from '@carbon/react';
import isNil from 'lodash-es/isNil';
import { useTranslation } from 'react-i18next';
import {
type DefaultWorkspaceProps,
ArrowLeftIcon,
Expand All @@ -15,12 +14,12 @@ import {
usePatient,
useVisit,
} from '@openmrs/esm-framework';
import { SearchTypes } from '../types';
import { useScheduledVisits } from './hooks/useScheduledVisits';
import ExistingVisitFormComponent from './visit-form/existing-visit-form.component';
import PatientScheduledVisits from './patient-scheduled-visits.component';
import VisitForm from './visit-form/visit-form.component';
import styles from './patient-search.scss';
import { Button, DataTableSkeleton } from '@carbon/react';
import { useScheduledVisits } from './hooks/useScheduledVisits';
import isNil from 'lodash-es/isNil';
import { useTranslation } from 'react-i18next';

interface PatientSearchProps extends DefaultWorkspaceProps {
selectedPatientUuid: string;
Expand All @@ -41,11 +40,13 @@ const PatientSearch: React.FC<PatientSearchProps> = ({
const { t } = useTranslation();
const { patient } = usePatient(selectedPatientUuid);
const { activeVisit } = useVisit(selectedPatientUuid);
const { appointments, isLoading, error } = useScheduledVisits(selectedPatientUuid);

const [searchType, setSearchType] = useState<SearchTypes>(SearchTypes.SCHEDULED_VISITS);
const [showContactDetails, setContactDetails] = useState(false);
const { appointments, isLoading, error } = useScheduledVisits(selectedPatientUuid);

const hasAppointments = !(isNil(appointments?.futureVisits) && isNil(appointments?.recentVisits));
const patientName = patient && getPatientName(patient);

const backButtonDescription =
searchType === SearchTypes.VISIT_FORM && hasAppointments
Expand Down Expand Up @@ -76,7 +77,6 @@ const PatientSearch: React.FC<PatientSearchProps> = ({
}
}, [searchType, handleBackToSearchList]);

const patientName = patient && getPatientName(patient);
return patient ? (
<div className={styles.patientSearchContainer}>
<AddPatientToQueueContext.Provider value={{ currentServiceQueueUuid }}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type Patient, type PatientIdentifier, PatientBannerPatientIdentifier } from '@openmrs/esm-framework';
import React from 'react';
import { type Patient, type PatientIdentifier, PatientBannerPatientIdentifiers } from '@openmrs/esm-framework';
import { useElementConfig } from '../../ward-view/ward-view.resource';

export interface WardPatientIdentifierProps {
Expand All @@ -23,7 +23,7 @@ const WardPatientIdentifier: React.FC<WardPatientIdentifierProps> = ({ id, patie
}));

return (
<PatientBannerPatientIdentifier identifier={fhirIdentifiers} showIdentifierLabel={config?.showIdentifierLabel} />
<PatientBannerPatientIdentifiers identifiers={fhirIdentifiers} showIdentifierLabel={config?.showIdentifierLabel} />
);
};

Expand Down
Loading

0 comments on commit 7f25bf3

Please sign in to comment.