Skip to content

Commit

Permalink
Added link to pharmacy patient, cleaned up community pharmacy (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
Omoshlawi authored Jul 31, 2024
1 parent 9947a63 commit e172f62
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 117 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint-disable no-console */
import { Button } from '@carbon/react';
import { ArrowRight } from '@carbon/react/icons';
import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { ArrowRight } from '@carbon/react/icons';
import styles from './pharmacy-header.scss';
import { Button, TextInput, Modal, Select, ComboBox, SelectItem, DatePickerInput, DatePicker } from '@carbon/react';

const MetricsHeader = () => {
const { t } = useTranslation();
Expand All @@ -20,121 +19,10 @@ const MetricsHeader = () => {
<Button
kind="tertiary"
renderIcon={(props) => <ArrowRight size={16} {...props} />}
iconDescription={t('enroll', 'Enroll new body')}
// onClick={() => setIsModalOpen(true)}
>
iconDescription={t('tagPharmacy', 'Tag pharmacy')}>
{t('tagPharmacy', 'Tag pharmacy')}
</Button>
</div>
<Modal
primaryButtonText="ADMIT NEW BODY"
secondaryButtonText="CANCEL"
open={isModalOpen}
onRequestClose={() => setIsModalOpen(false)}
modalLabel="ADMIT BROUGHT IN BODY"
modalHeading="ADMISSION"
hasScrollingContent>
<TextInput
data-modal-primary-focus
id="text-input-1"
labelText="Given Name*"
placeholder="Enter your given name"
required
style={{
marginBottom: '1rem',
}}
/>
<TextInput
data-modal-primary-focus
id="text-input-1"
labelText="Middle Name"
placeholder="Enter your middle name"
required
style={{
marginBottom: '1rem',
}}
/>
<TextInput
data-modal-primary-focus
id="text-input-1"
labelText="Family Name*"
placeholder="Enter your family name"
required
style={{
marginBottom: '1rem',
}}
/>
<div style={{ marginBottom: '20px' }}>
<Select id="select-1" labelText="Gender*">
<SelectItem value="" text="Select Gender" />
<SelectItem value="Option 2" text="Male" />
<SelectItem value="Option 2" text="Female" />
</Select>
</div>
<DatePicker datePickerType="single">
<DatePickerInput placeholder="mm/dd/yyyy" labelText="Date of Birth" id="date-picker-single" size="md" />
</DatePicker>
<div style={{ marginBottom: '20px' }}>
<ComboBox
allowCustomValue
shouldFilterItem={filterItems}
required
onChange={(e) => {
console.log(e);
}}
id="carbon-combobox"
items={[
'Married Polygamous',
'Married Monogamous',
'Divorced',
'Widowed',
'Cohabiting',
'Single',
'Not Married',
]}
downshiftProps={{
onStateChange: () => {
console.log('the state has changed');
},
}}
titleText="Marital Status*"
/>
</div>
<div style={{ marginBottom: '20px' }}>
<DatePicker datePickerType="single">
<DatePickerInput placeholder="mm/dd/yyyy" labelText="Date of Death" id="date-picker-single" size="md" />
</DatePicker>
</div>
<TextInput
data-modal-primary-focus
id="text-input-1"
labelText="Place Death*"
placeholder="Enter place of Death"
required
style={{
marginBottom: '1rem',
}}
/>
<div style={{ marginBottom: '20px' }}>
<ComboBox
allowCustomValue
shouldFilterItem={filterItems}
required
onChange={(e) => {
console.log(e);
}}
id="carbon-combobox"
items={['TB', 'Malaria']}
downshiftProps={{
onStateChange: () => {
console.log('the state has changed');
},
}}
titleText="Cause of death*"
/>
</div>
<div style={{ marginBottom: '20px' }}></div>
</Modal>
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
} from '@carbon/react';
import { Add, TrashCan } from '@carbon/react/icons';
import {
ConfigurableLink,
ErrorState,
UserHasAccess,
isDesktop,
Expand Down Expand Up @@ -92,7 +93,13 @@ export const PharmacyPatients: React.FC = () => {
return {
id: `${patient.uuid}`,
openmrsId: patient.openmrsId,
name: patient.name,
name: (
<ConfigurableLink
style={{ textDecoration: 'none' }}
to={window.getOpenmrsSpaBase() + `patient/${patient.uuid}/chart/Patient Summary`}>
{patient.name}
</ConfigurableLink>
),
age: patient.age ?? '--',
sex: patient.gender ?? '--',
contact: patient.telephoneContact ?? '--',
Expand Down
1 change: 0 additions & 1 deletion packages/esm-pharmacy-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"contact": "Contact",
"countyDistrict": "County District",
"dateMapped": "Date Mapped",
"enroll": "Enroll new body",
"name": "NAME",
"noCommunityPharmacyToList": "No Community Pharmacies to list.",
"noPharmacyPatients": "No Pharmacy Patients to list.",
Expand Down

0 comments on commit e172f62

Please sign in to comment.