Skip to content

Commit

Permalink
Merge branch 'main' into feat/ward-app-pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
amosmachora authored Aug 7, 2024
2 parents 79e0d71 + ac24702 commit 8dc78f5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,23 @@ import type { WardPatient } from '../../types';
import { WardPatientCardElement } from '../../ward-patient-card/ward-patient-card-element.component';
import { useCurrentWardCardConfig } from '../../hooks/useCurrentWardCardConfig';
import styles from './style.scss';
import WardPatientBedNumber from '../../ward-patient-card/row-elements/ward-patient-bed-number';
import WardPatientName from '../../ward-patient-card/row-elements/ward-patient-name';

const WardPatientWorkspaceBanner = (props: WardPatient) => {
const { headerRowElements } = useCurrentWardCardConfig();
const { patient, bed, visit, firstAdmissionOrTransferEncounter, encounterAssigningToCurrentInpatientLocation } =
props;

if (!(patient && bed && visit)) return null;
if (!(patient && visit)) {
console.warn('Patient details and visit details were not received by the workspace');
return null;
}

return (
<div className={styles.patientBanner}>
{bed ? <WardPatientBedNumber bed={bed} /> : null}
<WardPatientName patient={patient} />
{headerRowElements.map((elementId, i) => (
<WardPatientCardElement
key={`ward-card-${patient.uuid}-header-${i}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ const PatientNotesForm: React.FC<PatientNotesFormProps> = ({
patient: patientUuid,
location: locationUuid,
encounterType: emrConfiguration?.visitNoteEncounterType.uuid,
encounterProviders: [
{
encounterRole: emrConfiguration?.clinicianEncounterRole.uuid,
provider: providerUuid,
},
],
obs: wardClinicalNote
? [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ test('renders the visit notes form with all the relevant fields and values', ()

test('renders a success snackbar upon successfully recording a visit note', async () => {
const successPayload = {
encounterProviders: expect.arrayContaining([
{
encounterRole: emrConfigurationMock.clinicianEncounterRole.uuid,
provider: undefined,
},
]),
encounterType: emrConfigurationMock.visitNoteEncounterType.uuid,
location: undefined,
obs: expect.arrayContaining([
Expand Down

0 comments on commit 8dc78f5

Please sign in to comment.