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) O3-3661: Admission Requests List should include both Admission and Transfer requests #1255

Merged
merged 4 commits into from
Aug 2, 2024

Conversation

mogoodrich
Copy link
Member

@mogoodrich mogoodrich commented Jul 26, 2024

https://openmrs.atlassian.net/browse/O3-3661

The terminology is a little confusing, but according to @Fiona Anderson the admissions request list should should those awaiting admission to the ward, and those awaiting transfer into the ward from another ward.

There isn't a currently a way to set up transfer questions on our demo server (that will come with https://openmrs.atlassian.net/issues/O3-3247?filter=10648, so this won't be fully testable until then) but this PR expands the admission request view to dsplay both admission and transfer requests for the current ward in the following view.

2024-07-29_18-17

@@ -6,7 +6,10 @@ import useWardLocation from './useWardLocation';
const defaultRep =
'custom:(dispositionLocation,dispositionType,disposition,dispositionEncounter:full,patient:default,dispositionObsGroup,visit)';

export function useInpatientRequest(dispositionType: Array<DispositionType> = ['ADMIT'], rep: string = defaultRep) {
export function useInpatientRequest(
dispositionType: Array<DispositionType> = ['ADMIT', 'TRANSFER'],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically I didn't need to change the default value, but if we are going to have a default value seemed to make sense to have it equal to the only value we are currently passing in.

import { Loading } from '@carbon/react';
import { InlineNotification } from '@carbon/react';
import { useTranslation } from 'react-i18next';

const AdmissionRequestsWorkspace: React.FC<DefaultWorkspaceProps> = () => {
const { t } = useTranslation();
const { inpatientRequests, isLoading, error } = useInpatientRequest();
const admissionRequests = inpatientRequests?.filter((request) => request.dispositionType == 'ADMIT');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't have to filter here if we are only fetching types we want?

Copy link
Contributor

github-actions bot commented Jul 26, 2024

Size Change: +23 B (0%)

Total Size: 6.13 MB

ℹ️ View Unchanged
Filename Size Change
packages/esm-active-visits-app/dist/132.js 823 B 0 B
packages/esm-active-visits-app/dist/144.js 42.8 kB 0 B
packages/esm-active-visits-app/dist/197.js 630 B 0 B
packages/esm-active-visits-app/dist/27.js 53.4 kB 0 B
packages/esm-active-visits-app/dist/298.js 26.4 kB 0 B
packages/esm-active-visits-app/dist/300.js 614 B 0 B
packages/esm-active-visits-app/dist/330.js 579 B 0 B
packages/esm-active-visits-app/dist/335.js 959 B 0 B
packages/esm-active-visits-app/dist/372.js 3.09 kB 0 B
packages/esm-active-visits-app/dist/41.js 2.63 kB 0 B
packages/esm-active-visits-app/dist/464.js 3.02 kB 0 B
packages/esm-active-visits-app/dist/470.js 3.04 kB 0 B
packages/esm-active-visits-app/dist/55.js 718 B 0 B
packages/esm-active-visits-app/dist/641.js 7 kB 0 B
packages/esm-active-visits-app/dist/652.js 765 B 0 B
packages/esm-active-visits-app/dist/661.js 812 B 0 B
packages/esm-active-visits-app/dist/682.js 624 B 0 B
packages/esm-active-visits-app/dist/829.js 8.63 kB 0 B
packages/esm-active-visits-app/dist/831.js 315 kB 0 B
packages/esm-active-visits-app/dist/879.js 811 B 0 B
packages/esm-active-visits-app/dist/89.js 3.37 kB 0 B
packages/esm-active-visits-app/dist/99.js 707 B 0 B
packages/esm-active-visits-app/dist/main.js 82.3 kB 0 B
packages/esm-active-visits-app/dist/openmrs-esm-active-visits-app.js 3.45 kB 0 B
packages/esm-appointments-app/dist/132.js 2.37 kB 0 B
packages/esm-appointments-app/dist/144.js 42.8 kB 0 B
packages/esm-appointments-app/dist/167.js 9.01 kB 0 B
packages/esm-appointments-app/dist/197.js 1.94 kB 0 B
packages/esm-appointments-app/dist/300.js 1.94 kB 0 B
packages/esm-appointments-app/dist/335.js 2.56 kB 0 B
packages/esm-appointments-app/dist/372.js 3.08 kB 0 B
packages/esm-appointments-app/dist/38.js 210 kB 0 B
packages/esm-appointments-app/dist/41.js 41.2 kB 0 B
packages/esm-appointments-app/dist/414.js 143 kB 0 B
packages/esm-appointments-app/dist/422.js 2.63 kB 0 B
packages/esm-appointments-app/dist/431.js 1.77 kB 0 B
packages/esm-appointments-app/dist/449.js 7.03 kB 0 B
packages/esm-appointments-app/dist/495.js 2.24 kB 0 B
packages/esm-appointments-app/dist/55.js 2.19 kB 0 B
packages/esm-appointments-app/dist/652.js 2.29 kB 0 B
packages/esm-appointments-app/dist/661.js 2.31 kB 0 B
packages/esm-appointments-app/dist/712.js 868 B 0 B
packages/esm-appointments-app/dist/713.js 15 kB 0 B
packages/esm-appointments-app/dist/831.js 315 kB 0 B
packages/esm-appointments-app/dist/876.js 2.57 kB 0 B
packages/esm-appointments-app/dist/879.js 2.31 kB 0 B
packages/esm-appointments-app/dist/913.js 26.2 kB 0 B
packages/esm-appointments-app/dist/99.js 2.15 kB 0 B
packages/esm-appointments-app/dist/main.js 411 kB 0 B
packages/esm-appointments-app/dist/openmrs-esm-appointments-app.js 3.69 kB 0 B
packages/esm-bed-management-app/dist/132.js 680 B 0 B
packages/esm-bed-management-app/dist/144.js 42.8 kB 0 B
packages/esm-bed-management-app/dist/189.js 1.22 kB 0 B
packages/esm-bed-management-app/dist/197.js 680 B 0 B
packages/esm-bed-management-app/dist/300.js 679 B 0 B
packages/esm-bed-management-app/dist/335.js 680 B 0 B
packages/esm-bed-management-app/dist/336.js 394 B 0 B
packages/esm-bed-management-app/dist/372.js 3.09 kB 0 B
packages/esm-bed-management-app/dist/41.js 2.63 kB 0 B
packages/esm-bed-management-app/dist/449.js 7.04 kB 0 B
packages/esm-bed-management-app/dist/499.js 49.4 kB 0 B
packages/esm-bed-management-app/dist/55.js 725 B 0 B
packages/esm-bed-management-app/dist/652.js 681 B 0 B
packages/esm-bed-management-app/dist/661.js 680 B 0 B
packages/esm-bed-management-app/dist/802.js 27.9 kB 0 B
packages/esm-bed-management-app/dist/830.js 6.98 kB 0 B
packages/esm-bed-management-app/dist/831.js 315 kB 0 B
packages/esm-bed-management-app/dist/839.js 70.9 kB 0 B
packages/esm-bed-management-app/dist/879.js 680 B 0 B
packages/esm-bed-management-app/dist/913.js 26.2 kB 0 B
packages/esm-bed-management-app/dist/99.js 679 B 0 B
packages/esm-bed-management-app/dist/main.js 4.15 kB 0 B
packages/esm-bed-management-app/dist/openmrs-esm-bed-management-app.js 3.56 kB 0 B
packages/esm-patient-list-management-app/dist/132.js 1.72 kB 0 B
packages/esm-patient-list-management-app/dist/144.js 42.8 kB 0 B
packages/esm-patient-list-management-app/dist/197.js 1.34 kB 0 B
packages/esm-patient-list-management-app/dist/300.js 1.34 kB 0 B
packages/esm-patient-list-management-app/dist/335.js 1.85 kB 0 B
packages/esm-patient-list-management-app/dist/362.js 9.48 kB 0 B
packages/esm-patient-list-management-app/dist/372.js 3.09 kB 0 B
packages/esm-patient-list-management-app/dist/41.js 2.64 kB 0 B
packages/esm-patient-list-management-app/dist/470.js 3.05 kB 0 B
packages/esm-patient-list-management-app/dist/55.js 1.51 kB 0 B
packages/esm-patient-list-management-app/dist/641.js 7.01 kB 0 B
packages/esm-patient-list-management-app/dist/652.js 1.59 kB 0 B
packages/esm-patient-list-management-app/dist/661.js 1.58 kB 0 B
packages/esm-patient-list-management-app/dist/718.js 72.9 kB 0 B
packages/esm-patient-list-management-app/dist/824.js 58.6 kB 0 B
packages/esm-patient-list-management-app/dist/831.js 315 kB 0 B
packages/esm-patient-list-management-app/dist/879.js 1.58 kB 0 B
packages/esm-patient-list-management-app/dist/89.js 3.38 kB 0 B
packages/esm-patient-list-management-app/dist/913.js 26.2 kB 0 B
packages/esm-patient-list-management-app/dist/99.js 1.51 kB 0 B
packages/esm-patient-list-management-app/dist/main.js 177 kB 0 B
packages/esm-patient-list-management-app/dist/openmrs-esm-patient-list-management-app.js 3.61 kB 0 B
packages/esm-patient-registration-app/dist/132.js 2.22 kB 0 B
packages/esm-patient-registration-app/dist/197.js 1.78 kB 0 B
packages/esm-patient-registration-app/dist/211.js 6.72 kB 0 B
packages/esm-patient-registration-app/dist/236.js 465 B 0 B
packages/esm-patient-registration-app/dist/277.js 7.74 kB 0 B
packages/esm-patient-registration-app/dist/300.js 1.78 kB 0 B
packages/esm-patient-registration-app/dist/335.js 2.51 kB 0 B
packages/esm-patient-registration-app/dist/372.js 3.09 kB 0 B
packages/esm-patient-registration-app/dist/41.js 2.63 kB 0 B
packages/esm-patient-registration-app/dist/414.js 544 B 0 B
packages/esm-patient-registration-app/dist/464.js 3.03 kB 0 B
packages/esm-patient-registration-app/dist/495.js 2.24 kB 0 B
packages/esm-patient-registration-app/dist/55.js 2.15 kB 0 B
packages/esm-patient-registration-app/dist/611.js 84.7 kB 0 B
packages/esm-patient-registration-app/dist/652.js 2.06 kB 0 B
packages/esm-patient-registration-app/dist/661.js 2.13 kB 0 B
packages/esm-patient-registration-app/dist/830.js 7.04 kB 0 B
packages/esm-patient-registration-app/dist/831.js 315 kB 0 B
packages/esm-patient-registration-app/dist/873.js 64 kB 0 B
packages/esm-patient-registration-app/dist/876.js 2.58 kB 0 B
packages/esm-patient-registration-app/dist/879.js 2.13 kB 0 B
packages/esm-patient-registration-app/dist/913.js 68.5 kB 0 B
packages/esm-patient-registration-app/dist/99.js 2.05 kB 0 B
packages/esm-patient-registration-app/dist/main.js 149 kB 0 B
packages/esm-patient-registration-app/dist/openmrs-esm-patient-registration-app.js 3.65 kB 0 B
packages/esm-patient-search-app/dist/132.js 938 B 0 B
packages/esm-patient-search-app/dist/17.js 75 kB 0 B
packages/esm-patient-search-app/dist/197.js 738 B 0 B
packages/esm-patient-search-app/dist/300.js 741 B 0 B
packages/esm-patient-search-app/dist/335.js 1.04 kB 0 B
packages/esm-patient-search-app/dist/372.js 3.09 kB 0 B
packages/esm-patient-search-app/dist/41.js 2.63 kB 0 B
packages/esm-patient-search-app/dist/470.js 3.05 kB 0 B
packages/esm-patient-search-app/dist/55.js 869 B 0 B
packages/esm-patient-search-app/dist/62.js 24.6 kB 0 B
packages/esm-patient-search-app/dist/641.js 7 kB 0 B
packages/esm-patient-search-app/dist/652.js 877 B 0 B
packages/esm-patient-search-app/dist/661.js 920 B 0 B
packages/esm-patient-search-app/dist/831.js 315 kB 0 B
packages/esm-patient-search-app/dist/879.js 918 B 0 B
packages/esm-patient-search-app/dist/89.js 3.37 kB 0 B
packages/esm-patient-search-app/dist/913.js 68.5 kB 0 B
packages/esm-patient-search-app/dist/99.js 859 B 0 B
packages/esm-patient-search-app/dist/main.js 101 kB 0 B
packages/esm-patient-search-app/dist/openmrs-esm-patient-search-app.js 3.6 kB 0 B
packages/esm-service-queues-app/dist/11.js 117 kB 0 B
packages/esm-service-queues-app/dist/132.js 4.74 kB 0 B
packages/esm-service-queues-app/dist/144.js 42.8 kB 0 B
packages/esm-service-queues-app/dist/153.js 8.1 kB 0 B
packages/esm-service-queues-app/dist/176.js 7.75 kB 0 B
packages/esm-service-queues-app/dist/197.js 3.82 kB 0 B
packages/esm-service-queues-app/dist/206.js 7.1 kB 0 B
packages/esm-service-queues-app/dist/230.js 7.78 kB 0 B
packages/esm-service-queues-app/dist/240.js 789 B 0 B
packages/esm-service-queues-app/dist/300.js 3.85 kB 0 B
packages/esm-service-queues-app/dist/335.js 5.1 kB 0 B
packages/esm-service-queues-app/dist/372.js 3.09 kB 0 B
packages/esm-service-queues-app/dist/38.js 22.6 kB 0 B
packages/esm-service-queues-app/dist/41.js 2.63 kB 0 B
packages/esm-service-queues-app/dist/449.js 7.04 kB 0 B
packages/esm-service-queues-app/dist/484.js 8.9 kB 0 B
packages/esm-service-queues-app/dist/495.js 2.24 kB 0 B
packages/esm-service-queues-app/dist/531.js 7.78 kB 0 B
packages/esm-service-queues-app/dist/55.js 3.9 kB 0 B
packages/esm-service-queues-app/dist/574.js 2.52 kB 0 B
packages/esm-service-queues-app/dist/652.js 4.43 kB 0 B
packages/esm-service-queues-app/dist/661.js 4.53 kB 0 B
packages/esm-service-queues-app/dist/688.js 5.74 kB 0 B
packages/esm-service-queues-app/dist/691.js 1.35 kB 0 B
packages/esm-service-queues-app/dist/698.js 1.73 kB 0 B
packages/esm-service-queues-app/dist/779.js 9.95 kB 0 B
packages/esm-service-queues-app/dist/78.js 6.94 kB 0 B
packages/esm-service-queues-app/dist/830.js 6.98 kB 0 B
packages/esm-service-queues-app/dist/831.js 315 kB 0 B
packages/esm-service-queues-app/dist/876.js 2.58 kB 0 B
packages/esm-service-queues-app/dist/879.js 4.53 kB 0 B
packages/esm-service-queues-app/dist/896.js 1.59 kB 0 B
packages/esm-service-queues-app/dist/913.js 26.2 kB 0 B
packages/esm-service-queues-app/dist/967.js 1.64 kB 0 B
packages/esm-service-queues-app/dist/968.js 117 kB 0 B
packages/esm-service-queues-app/dist/99.js 3.82 kB 0 B
packages/esm-service-queues-app/dist/990.js 1.36 kB 0 B
packages/esm-service-queues-app/dist/main.js 278 kB 0 B
packages/esm-service-queues-app/dist/openmrs-esm-service-queues-app.js 3.61 kB 0 B
packages/esm-ward-app/dist/161.js 4.99 kB 0 B
packages/esm-ward-app/dist/236.js 340 B 0 B
packages/esm-ward-app/dist/300.js 1 kB 0 B
packages/esm-ward-app/dist/372.js 3.08 kB 0 B
packages/esm-ward-app/dist/38.js 22.6 kB 0 B
packages/esm-ward-app/dist/41.js 2.62 kB 0 B
packages/esm-ward-app/dist/449.js 7.03 kB 0 B
packages/esm-ward-app/dist/48.js 29.7 kB 0 B
packages/esm-ward-app/dist/495.js 2.23 kB 0 B
packages/esm-ward-app/dist/57.js 13 kB 0 B
packages/esm-ward-app/dist/67.js 7.84 kB 0 B
packages/esm-ward-app/dist/80.js 24 kB +11 B (+0.05%)
packages/esm-ward-app/dist/830.js 6.98 kB 0 B
packages/esm-ward-app/dist/831.js 315 kB 0 B
packages/esm-ward-app/dist/876.js 2.57 kB 0 B
packages/esm-ward-app/dist/886.js 644 B 0 B
packages/esm-ward-app/dist/900.js 11.9 kB 0 B
packages/esm-ward-app/dist/913.js 68.5 kB 0 B
packages/esm-ward-app/dist/main.js 55.1 kB +12 B (+0.02%)
packages/esm-ward-app/dist/openmrs-esm-ward-app.js 3.58 kB 0 B

compressed-size-action

@brandones
Copy link
Contributor

Hi @mogoodrich , please don't delete the PR template. Could you please add a screenshot or video? It's hard to evaluate the work without that.

@mogoodrich
Copy link
Member Author

Sorry about deleting the PR template @brandones .

RE: screenshot, I realized after I made the changes that this won't be fully testable (and therefore demoable) until we implement https://openmrs.atlassian.net/issues/O3-3247?filter=10648 , but I just added a screenshot to the PR showing what this PR should change.

@@ -29,7 +27,7 @@ const AdmissionRequestsWorkspace: React.FC<DefaultWorkspaceProps> = () => {

return (
<div className={styles.admissionRequestsWorkspace}>
{admissionRequests.map((admissionRequest, indx) => (
{inpatientRequests.map((admissionRequest, indx) => (
<AdmissionRequestCard key={indx} patient={admissionRequest.patient} />
Copy link
Member

@denniskigen denniskigen Jul 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there something in the response we could use as a key here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or just like inpatient-request-workspace-card-${indx}.

@vasharma05 sorry we didn't catch this in the original PR with this change, but you can't just use an integer as a React key; it is very easy to wind up with duplicate keys that way. Duplicate keys can cause really bizarre and confusing bugs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<AdmissionRequestCard key={indx} patient={admissionRequest.patient} />
<AdmissionRequestCard key={`inpatient-request-workspace-card-${indx}`} patient={admissionRequest.patient} />

@denniskigen denniskigen changed the title (fix) O3-3661: Admission Requests List should include both Admissio and Transfer requests (fix) O3-3661: Admission Requests List should include both Admission and Transfer requests Jul 30, 2024
Copy link
Contributor

@chibongho chibongho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mogoodrich mogoodrich merged commit e1009ab into main Aug 2, 2024
6 checks passed
@mogoodrich mogoodrich deleted the O3-3661 branch August 2, 2024 16:56
mogoodrich added a commit that referenced this pull request Aug 2, 2024
…and Transfer requests (#1255)

(follow-on update after merging)
@denniskigen denniskigen mentioned this pull request Aug 29, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants