-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* change WardPatient type * refactor ward patient workspace * comments and tests * make bed field non-optional
- Loading branch information
Showing
18 changed files
with
134 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...p/src/ward-patient-card/colored-obs-tags-card-row/colored-obs-tags-card-row.extension.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 2 additions & 8 deletions
10
packages/esm-ward-app/src/ward-patient-card/row-elements/ward-patient-bed-number.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 18 additions & 15 deletions
33
packages/esm-ward-app/src/ward-patient-card/row-elements/ward-patient-gender.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,27 @@ | ||
import { type Patient } from '@openmrs/esm-framework'; | ||
import { type TFunction } from 'i18next'; | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
const WardPatientGender: React.FC<{ patient: Patient }> = ({ patient }) => { | ||
const { t } = useTranslation(); | ||
const getGender = (gender: string): string => { | ||
switch (gender) { | ||
case 'M': | ||
return t('male', 'Male'); | ||
case 'F': | ||
return t('female', 'Female'); | ||
case 'O': | ||
return t('other', 'Other'); | ||
case 'unknown': | ||
return t('unknown', 'Unknown'); | ||
default: | ||
return gender; | ||
} | ||
}; | ||
return <div>{getGender(patient?.person?.gender)}</div>; | ||
|
||
return <div>{getGender(t, patient?.person?.gender)}</div>; | ||
}; | ||
|
||
export const getGender = (t: TFunction, gender: string): string => { | ||
switch (gender) { | ||
case 'M': | ||
return t('male', 'Male'); | ||
case 'F': | ||
return t('female', 'Female'); | ||
case 'O': | ||
return t('other', 'Other'); | ||
case 'unknown': | ||
return t('unknown', 'Unknown'); | ||
default: | ||
return gender; | ||
} | ||
}; | ||
|
||
export default WardPatientGender; |
22 changes: 9 additions & 13 deletions
22
packages/esm-ward-app/src/ward-patient-card/ward-patient-card-element.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.