Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix) fixed pending issues #7

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
const pathArray = location.pathname.split('/home');
const lastElement = pathArray[pathArray.length - 1];
return decodeURIComponent(lastElement);
}, [location.pathname]);

Check warning on line 24 in packages/esm-medical-supply-dispensing-app/src/dashboard/dispensing-dashboard-link.component.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useMemo has an unnecessary dependency: 'location.pathname'. Either exclude it or remove the dependency array. Outer scope values like 'location.pathname' aren't valid dependencies because mutating them doesn't re-render the component

return (
<ConfigurableLink
className={classNames('cds--side-nav__link', {
'active-left-nav-link': navLink.match('dispensing'),
'active-left-nav-link': navLink.match('supplies-dispensing'),
})}
to={`${spaBasePath}/dispensing`}>
{t('dispensing', 'Dispensing')}
to={`${spaBasePath}/suppliesdispensing`}>
{t('suppliesdispensing', 'Supplies Dispensing')}
</ConfigurableLink>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import { spaBasePath } from './constants';

export default function DispensingLink() {
const { t } = useTranslation();
return <ConfigurableLink to={spaBasePath}>{t('dispensing', 'Dispensing')}</ConfigurableLink>;
return <ConfigurableLink to={spaBasePath}>{t('medicalSuppliesDispensing', 'Supplies Dispensing')}</ConfigurableLink>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const PauseDispenseForm: React.FC<PauseDispenseFormProps> = ({
delete medicationDispensePayload['dsiplay'];
delete medicationDispensePayload['statusReasonCodeableConcept'];
delete medicationDispensePayload['medicalSupplyOrderStatus'];
saveMedicationSupplyDispense(medicationDispensePayload, MedicationDispenseStatus.paused, abortController)
saveMedicationSupplyDispense(medicationDispensePayload, MedicationDispenseStatus.in_progress, abortController)
.then((response) => {
if (response.ok) {
showToast({
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-medical-supply-dispensing-app/src/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"pages": [
{
"component": "supplyDispensingDashboard",
"route": "medical-supply-dispensing"
"route": "supplies-dispensing"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export interface MedicationDispense {
}
export enum MedicationDispenseStatus {
//in_progress = "in-progress", NOT YET IMPLEMENTED
paused = 'paused',
in_progress = 'in_progress',
completed = 'completed',
declined = 'declined',
}
Expand Down
18 changes: 9 additions & 9 deletions packages/esm-medical-supply-dispensing-app/src/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ describe('Util Tests', () => {
},
performer: undefined,
resourceType: 'MedicationDispense',
status: MedicationDispenseStatus.paused,
status: MedicationDispenseStatus.in_progress,
subject: { display: '', reference: '', type: '' },
substitution: { reason: [], type: undefined, wasSubstituted: false },
type: undefined,
Expand Down Expand Up @@ -863,7 +863,7 @@ describe('Util Tests', () => {

test('when adding new dispense should return on-hold if status of new dispense is on-hold and if restrict total quantity dispensed config is false', () => {
newMedicationDispense.extension[0].valueDateTime = '2023-01-03T14:00:00-05:00';
newMedicationDispense.status = MedicationDispenseStatus.paused;
newMedicationDispense.status = MedicationDispenseStatus.in_progress;
newMedicationDispense.quantity.value = 0;
expect(
computeNewFulfillerStatusAfterDispenseEvent(
Expand Down Expand Up @@ -902,7 +902,7 @@ describe('Util Tests', () => {

test('when adding new on-hold dispense should return on-hold if restrict total quantity dispensed config is true', () => {
newMedicationDispense.extension[0].valueDateTime = '2023-01-03T14:00:00-05:00';
newMedicationDispense.status = MedicationDispenseStatus.paused;
newMedicationDispense.status = MedicationDispenseStatus.in_progress;
newMedicationDispense.quantity.value = 0;
expect(
computeNewFulfillerStatusAfterDispenseEvent(
Expand All @@ -915,10 +915,10 @@ describe('Util Tests', () => {

test('when adding new dispense to request with existing dispense should return complete if meets total quantity ordered and restrict total quantity dispensed config is true', () => {
newMedicationDispense.extension[0].valueDateTime = '2023-01-03T14:00:00-05:00';
newMedicationDispense.status = MedicationDispenseStatus.paused;
newMedicationDispense.status = MedicationDispenseStatus.in_progress;
newMedicationDispense.quantity.value = 20;
existingMedicationDispense.extension[0].valueDateTime = '2023-01-03T14:00:00-05:00';
existingMedicationDispense.status = MedicationDispenseStatus.paused;
existingMedicationDispense.status = MedicationDispenseStatus.in_progress;
existingMedicationDispense.quantity.value = 10;
expect(
computeNewFulfillerStatusAfterDispenseEvent(
Expand Down Expand Up @@ -2191,7 +2191,7 @@ describe('Util Tests', () => {
},
performer: undefined,
resourceType: 'MedicationDispense',
status: MedicationDispenseStatus.paused,
status: MedicationDispenseStatus.in_progress,
subject: { display: '', reference: '', type: '' },
substitution: { reason: [], type: undefined, wasSubstituted: false },
type: undefined,
Expand Down Expand Up @@ -2302,7 +2302,7 @@ describe('Util Tests', () => {
},
performer: undefined,
resourceType: 'MedicationDispense',
status: MedicationDispenseStatus.paused,
status: MedicationDispenseStatus.in_progress,
subject: { display: '', reference: '', type: '' },
substitution: { reason: [], type: undefined, wasSubstituted: false },
type: undefined,
Expand Down Expand Up @@ -2404,7 +2404,7 @@ describe('Util Tests', () => {
},
performer: undefined,
resourceType: 'MedicationDispense',
status: MedicationDispenseStatus.paused,
status: MedicationDispenseStatus.in_progress,
subject: { display: '', reference: '', type: '' },
substitution: { reason: [], type: undefined, wasSubstituted: false },
type: undefined,
Expand Down Expand Up @@ -2753,7 +2753,7 @@ describe('Util Tests', () => {
},
performer: undefined,
resourceType: 'MedicationDispense',
status: MedicationDispenseStatus.paused,
status: MedicationDispenseStatus.in_progress,
subject: { display: '', reference: '', type: '' },
substitution: { reason: [], type: undefined, wasSubstituted: false },
type: undefined,
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-medical-supply-dispensing-app/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function computeFulfillerStatus(
return MedicationRequestFulfillerStatus.declined;
}

if (mostRecentMedicationDispenseStatus === MedicationDispenseStatus.paused) {
if (mostRecentMedicationDispenseStatus === MedicationDispenseStatus.in_progress) {
return MedicationRequestFulfillerStatus.on_hold;
}

Expand Down
Loading