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

O3-3030 service queues: fix NPE in mapVisitQueueEntryProperties #1085

Merged
merged 3 commits into from
Apr 7, 2024

Conversation

chibongho
Copy link
Contributor

@chibongho chibongho commented Apr 5, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

Previous commit introduce an NPE in mapVisitQueueEntryProperties. Fixing it by removing an unused field in MappedVisitQeueEntry.

Screenshots

Related Issue

Other

Copy link
Contributor

github-actions bot commented Apr 5, 2024

Size Change: +179 B (0%)

Total Size: 3.12 MB

ℹ️ View Unchanged
Filename Size Change
packages/esm-active-visits-app/dist/130.js 148 kB 0 B
packages/esm-active-visits-app/dist/255.js 2.21 kB 0 B
packages/esm-active-visits-app/dist/271.js 762 B 0 B
packages/esm-active-visits-app/dist/277.js 13.4 kB 0 B
packages/esm-active-visits-app/dist/316.js 42.9 kB 0 B
packages/esm-active-visits-app/dist/319.js 683 B 0 B
packages/esm-active-visits-app/dist/382.js 1.15 kB 0 B
packages/esm-active-visits-app/dist/448.js 47.1 kB 0 B
packages/esm-active-visits-app/dist/460.js 784 B 0 B
packages/esm-active-visits-app/dist/574.js 588 B 0 B
packages/esm-active-visits-app/dist/588.js 6.66 kB 0 B
packages/esm-active-visits-app/dist/635.js 1.15 kB 0 B
packages/esm-active-visits-app/dist/644.js 762 B 0 B
packages/esm-active-visits-app/dist/729.js 3.1 kB 0 B
packages/esm-active-visits-app/dist/757.js 694 B 0 B
packages/esm-active-visits-app/dist/784.js 2.63 kB 0 B
packages/esm-active-visits-app/dist/788.js 586 B 0 B
packages/esm-active-visits-app/dist/807.js 918 B 0 B
packages/esm-active-visits-app/dist/833.js 732 B 0 B
packages/esm-active-visits-app/dist/879.js 2.94 kB 0 B
packages/esm-active-visits-app/dist/main.js 65 kB 0 B
packages/esm-active-visits-app/dist/openmrs-esm-active-visits-app.js 3.33 kB 0 B
packages/esm-appointments-app/dist/130.js 148 kB 0 B
packages/esm-appointments-app/dist/152.js 257 B 0 B
packages/esm-appointments-app/dist/24.js 51.2 kB 0 B
packages/esm-appointments-app/dist/255.js 2.22 kB 0 B
packages/esm-appointments-app/dist/262.js 9.36 kB 0 B
packages/esm-appointments-app/dist/271.js 2.27 kB 0 B
packages/esm-appointments-app/dist/303.js 258 B 0 B
packages/esm-appointments-app/dist/319.js 2.21 kB 0 B
packages/esm-appointments-app/dist/337.js 259 kB 0 B
packages/esm-appointments-app/dist/390.js 26 kB 0 B
packages/esm-appointments-app/dist/4.js 1.77 kB 0 B
packages/esm-appointments-app/dist/460.js 2.41 kB 0 B
packages/esm-appointments-app/dist/500.js 2.51 kB 0 B
packages/esm-appointments-app/dist/574.js 1.97 kB 0 B
packages/esm-appointments-app/dist/588.js 6.65 kB 0 B
packages/esm-appointments-app/dist/591.js 16.9 kB 0 B
packages/esm-appointments-app/dist/644.js 2.27 kB 0 B
packages/esm-appointments-app/dist/729.js 3.1 kB 0 B
packages/esm-appointments-app/dist/757.js 2.02 kB 0 B
packages/esm-appointments-app/dist/784.js 2.63 kB 0 B
packages/esm-appointments-app/dist/788.js 1.96 kB 0 B
packages/esm-appointments-app/dist/807.js 2.66 kB 0 B
packages/esm-appointments-app/dist/833.js 2.27 kB 0 B
packages/esm-appointments-app/dist/main.js 322 kB 0 B
packages/esm-appointments-app/dist/openmrs-esm-appointments-app.js 3.42 kB 0 B
packages/esm-patient-list-management-app/dist/130.js 148 kB 0 B
packages/esm-patient-list-management-app/dist/255.js 2.21 kB 0 B
packages/esm-patient-list-management-app/dist/271.js 1.55 kB 0 B
packages/esm-patient-list-management-app/dist/295.js 99.3 kB 0 B
packages/esm-patient-list-management-app/dist/319.js 1.52 kB 0 B
packages/esm-patient-list-management-app/dist/382.js 1.15 kB 0 B
packages/esm-patient-list-management-app/dist/460.js 1.7 kB 0 B
packages/esm-patient-list-management-app/dist/574.js 1.34 kB 0 B
packages/esm-patient-list-management-app/dist/588.js 6.66 kB 0 B
packages/esm-patient-list-management-app/dist/591.js 16.9 kB 0 B
packages/esm-patient-list-management-app/dist/635.js 1.15 kB 0 B
packages/esm-patient-list-management-app/dist/644.js 1.55 kB 0 B
packages/esm-patient-list-management-app/dist/716.js 4.66 kB 0 B
packages/esm-patient-list-management-app/dist/729.js 3.1 kB 0 B
packages/esm-patient-list-management-app/dist/757.js 1.5 kB 0 B
packages/esm-patient-list-management-app/dist/784.js 2.64 kB 0 B
packages/esm-patient-list-management-app/dist/788.js 1.34 kB 0 B
packages/esm-patient-list-management-app/dist/807.js 1.84 kB 0 B
packages/esm-patient-list-management-app/dist/833.js 1.58 kB 0 B
packages/esm-patient-list-management-app/dist/995.js 21.9 kB 0 B
packages/esm-patient-list-management-app/dist/main.js 125 kB 0 B
packages/esm-patient-list-management-app/dist/openmrs-esm-patient-list-management-app.js 3.29 kB 0 B
packages/esm-patient-registration-app/dist/130.js 148 kB 0 B
packages/esm-patient-registration-app/dist/152.js 262 B 0 B
packages/esm-patient-registration-app/dist/255.js 2.21 kB 0 B
packages/esm-patient-registration-app/dist/271.js 2.01 kB 0 B
packages/esm-patient-registration-app/dist/303.js 260 B 0 B
packages/esm-patient-registration-app/dist/319.js 1.99 kB 0 B
packages/esm-patient-registration-app/dist/460.js 2.12 kB 0 B
packages/esm-patient-registration-app/dist/481.js 6.75 kB 0 B
packages/esm-patient-registration-app/dist/537.js 2.34 kB 0 B
packages/esm-patient-registration-app/dist/574.js 1.7 kB 0 B
packages/esm-patient-registration-app/dist/591.js 16.9 kB 0 B
packages/esm-patient-registration-app/dist/644.js 2.01 kB 0 B
packages/esm-patient-registration-app/dist/676.js 6.59 kB 0 B
packages/esm-patient-registration-app/dist/686.js 92 kB 0 B
packages/esm-patient-registration-app/dist/729.js 3.1 kB 0 B
packages/esm-patient-registration-app/dist/735.js 464 B 0 B
packages/esm-patient-registration-app/dist/757.js 2.07 kB 0 B
packages/esm-patient-registration-app/dist/783.js 36.2 kB 0 B
packages/esm-patient-registration-app/dist/784.js 2.64 kB 0 B
packages/esm-patient-registration-app/dist/788.js 1.7 kB 0 B
packages/esm-patient-registration-app/dist/807.js 2.43 kB 0 B
packages/esm-patient-registration-app/dist/833.js 1.97 kB 0 B
packages/esm-patient-registration-app/dist/879.js 2.94 kB 0 B
packages/esm-patient-registration-app/dist/main.js 130 kB 0 B
packages/esm-patient-registration-app/dist/openmrs-esm-patient-registration-app.js 3.34 kB 0 B
packages/esm-patient-search-app/dist/130.js 148 kB 0 B
packages/esm-patient-search-app/dist/255.js 2.21 kB 0 B
packages/esm-patient-search-app/dist/271.js 899 B 0 B
packages/esm-patient-search-app/dist/319.js 857 B 0 B
packages/esm-patient-search-app/dist/382.js 1.15 kB 0 B
packages/esm-patient-search-app/dist/460.js 924 B 0 B
packages/esm-patient-search-app/dist/574.js 732 B 0 B
packages/esm-patient-search-app/dist/584.js 21.7 kB 0 B
packages/esm-patient-search-app/dist/588.js 6.66 kB 0 B
packages/esm-patient-search-app/dist/591.js 16.9 kB 0 B
packages/esm-patient-search-app/dist/635.js 1.15 kB 0 B
packages/esm-patient-search-app/dist/644.js 899 B 0 B
packages/esm-patient-search-app/dist/729.js 3.1 kB 0 B
packages/esm-patient-search-app/dist/757.js 864 B 0 B
packages/esm-patient-search-app/dist/778.js 23.1 kB 0 B
packages/esm-patient-search-app/dist/784.js 2.63 kB 0 B
packages/esm-patient-search-app/dist/788.js 726 B 0 B
packages/esm-patient-search-app/dist/807.js 1.03 kB 0 B
packages/esm-patient-search-app/dist/833.js 867 B 0 B
packages/esm-patient-search-app/dist/main.js 48 kB 0 B
packages/esm-patient-search-app/dist/openmrs-esm-patient-search-app.js 3.3 kB 0 B
packages/esm-service-queues-app/dist/130.js 148 kB 0 B
packages/esm-service-queues-app/dist/152.js 262 B 0 B
packages/esm-service-queues-app/dist/233.js 1.73 kB 0 B
packages/esm-service-queues-app/dist/255.js 2.22 kB 0 B
packages/esm-service-queues-app/dist/263.js 3.45 kB 0 B
packages/esm-service-queues-app/dist/271.js 4.1 kB 0 B
packages/esm-service-queues-app/dist/303.js 261 B 0 B
packages/esm-service-queues-app/dist/319.js 3.54 kB 0 B
packages/esm-service-queues-app/dist/328.js 2.99 kB 0 B
packages/esm-service-queues-app/dist/368.js 56.2 kB +89 B (0%)
packages/esm-service-queues-app/dist/389.js 1.9 kB 0 B
packages/esm-service-queues-app/dist/425.js 2.09 kB 0 B
packages/esm-service-queues-app/dist/460.js 4.38 kB 0 B
packages/esm-service-queues-app/dist/574.js 3.53 kB 0 B
packages/esm-service-queues-app/dist/588.js 6.66 kB 0 B
packages/esm-service-queues-app/dist/591.js 16.9 kB 0 B
packages/esm-service-queues-app/dist/616.js 2.71 kB 0 B
packages/esm-service-queues-app/dist/644.js 4.11 kB 0 B
packages/esm-service-queues-app/dist/694.js 2.65 kB 0 B
packages/esm-service-queues-app/dist/696.js 570 B 0 B
packages/esm-service-queues-app/dist/729.js 3.1 kB 0 B
packages/esm-service-queues-app/dist/738.js 554 B 0 B
packages/esm-service-queues-app/dist/745.js 159 kB 0 B
packages/esm-service-queues-app/dist/757.js 3.53 kB 0 B
packages/esm-service-queues-app/dist/784.js 2.63 kB 0 B
packages/esm-service-queues-app/dist/788.js 3.53 kB 0 B
packages/esm-service-queues-app/dist/806.js 1.6 kB 0 B
packages/esm-service-queues-app/dist/807.js 4.82 kB 0 B
packages/esm-service-queues-app/dist/833.js 4.08 kB 0 B
packages/esm-service-queues-app/dist/940.js 21.4 kB 0 B
packages/esm-service-queues-app/dist/981.js 2.94 kB 0 B
packages/esm-service-queues-app/dist/main.js 218 kB +90 B (0%)
packages/esm-service-queues-app/dist/openmrs-esm-service-queues-app.js 3.3 kB 0 B

compressed-size-action

Copy link
Member

@mseaton mseaton left a comment

Choose a reason for hiding this comment

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

@chibongho - this isn't the fix I was expecting. Are these encounters not needed / used anywhere?

@makombe
Copy link
Contributor

makombe commented Apr 5, 2024

@chibongho Thanks for the fix. I think there is also another place where encounterProvider was being referenced that was failing as well. Not sure if this will address the same.

@makombe
Copy link
Contributor

makombe commented Apr 5, 2024

you can as well do a custom v representation to all that you need to pull , the use of default rep seems to leave out some properties being mapped hence npe being experienced

@chibongho
Copy link
Contributor Author

I don't see that field being used anywhere. If we expect to need it later I can change this to fix it via the v= param instead.

@makombe
Copy link
Contributor

makombe commented Apr 5, 2024

I don't see that field being used anywhere. If we expect to need it later I can change this to fix it via the v= param instead.

@chibongho please check here

provider: encounter.encounterProviders[0]?.provider?.person?.display,

@makombe
Copy link
Contributor

makombe commented Apr 5, 2024

and here as well

export function useQueueEntries(searchCriteria?: QueueEntrySearchCriteria, rep: string = 'default') {
some of the properties we are mapping are not being returned. Thanks

@chibongho
Copy link
Contributor Author

ok, I changed the v= param for useQueueEntries to includes the encounters (and its fields) in the visit object. I can't find usage of MappedVisitQueueEntry.encounters anywhere but I'm keeping it just in case. (I believe most if not all code paths use queueEntry.visits.encounters now)

@makombe Where is the encounters field being used? I see Visit.encounters being using in [current-visit-details.component.tsx(https://github.com/openmrs/openmrs-esm-patient-management/blob/main/packages/esm-service-queues-app/src/current-visit/visit-details/current-visit-details.component.tsx) but I haven't been able to figure out how to properly populate test data to test it. I tried adding a visit note but the encounterType got saved as "Consultation" instead. Let me know of any test scenarios you'd like me to go through. thanks.

@chibongho chibongho requested a review from mseaton April 5, 2024 19:08
denniskigen
denniskigen previously approved these changes Apr 5, 2024
@denniskigen denniskigen dismissed their stale review April 5, 2024 19:48

Sorry, I hadn't read the rest of the comments.

Copy link
Member

@donaldkibet donaldkibet left a comment

Choose a reason for hiding this comment

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

Thanks @chibongho LGTM

Copy link
Contributor

@makombe makombe left a comment

Choose a reason for hiding this comment

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

Thanks @chibongho LGTM. I will merge we test it further

@makombe makombe merged commit 29a9a1b into main Apr 7, 2024
6 checks passed
@makombe makombe deleted the O3-3030 branch April 7, 2024 07:19
senthil-athiban pushed a commit to senthil-athiban/openmrs-esm-patient-management that referenced this pull request Apr 15, 2024
…mrs#1085)

* O3-3030 service queues: fix NPE in mapVisitQueueEntryProperties

* change default rep string for queue entries to include visit encounters

---------

Co-authored-by: Makombe Kennedy <[email protected]>
denniskigen added a commit that referenced this pull request Aug 8, 2024
…e left empty (#1182)

* (fix) fix typo on recurring appointment label (#1047)

* (fix) service queues - make edit queue entry modal body scrollable if content is too long (#1042)

* (fix) O3-2471 recommended visit type tab should only show if configured to do so (#1045)

* (fix) service queues - unescape queue name when passed into t() (#1043)

Co-authored-by: Jayasanka Weerasinghe <[email protected]>

* (refactor) O3-2891: Refactor Patient Appointments ESM into Appointments ESM (#1048)

* (feat) re-use upcomming appointment work to mark appointments as `Checked In` (#1050)

* (chore) Update translations from Transifex (#1011)

Co-authored-by: OpenMRS Bot <[email protected]>
Co-authored-by: Mark Goodrich <[email protected]>

* (feat) use configured identifier type on appointment table (#1054)

* (fix) add `@openmrs/esm-patient-common-lib` as peer dependency and register appointment workspace correctly (#1053)

* (fix): Enhanced Tablet View: Service Queues Metrics Header Overhaul (#1046)

* (fix): Tablet-UI. Making Tablet Service-queues metrics header responsive on tablet mode

Signed-off-by: Joshua Murithi <[email protected]>

* Fixup

---------

Signed-off-by: Joshua Murithi <[email protected]>
Co-authored-by: Dennis Kigen <[email protected]>

* (chore) Update translations from Transifex (#1055)

Co-authored-by: OpenMRS Bot <[email protected]>
Co-authored-by: Mark Goodrich <[email protected]>

* Enhanced Monthly Calendar UI for Appointment Scheduler (#1049)

* Enhanced Monthly Calendar UI for Appointment Scheduler

* clicking on a day from within the month to change the appointment date

* Localized days in weeks

* Removed weekly calendar view on appointment scheduler

---------

Co-authored-by: Donald Kibet <[email protected]>

* (BREAKING) O3-2748 service queues - add ability to undo transitions and void queue entries (#1052)

* (BREAKGING) O3-2748 service queues - add ability to undo transitions and void queue entries

* add tests

* minor wording fixup

* remove unused imports

* change undo transition route per update in backend PR

* address PR comments

* (chore) O3-2989 service queues - refactor <PatientSearch> to not have things unrelated to patient serach (#1058)

* (feat) O3-2892: Add Patient-Centric View within the Appointments App (#1057)

* O3-2788 (fix) appointments table should correctly search by patient name or identifier (#1067)

* (fix) O3-3009 Appointment form should limit location to those tagged as 'Appointment Location' (#1066)

* (fix) O3-3013 Appointment Form should validate invalid time values (#1069)

* (fix) O3-3013 appointment time validation should match entire string (#1073)

* (feature) O3-2930: Add date of birth to patient details in Appointments Module

Co-authored-by: Mark Goodrich <[email protected]>

* (feat) O3-3025: Add validation in change status modal for service queues (#1076)

* (feat) O3-3025: Add validation in change status modal for service queues

* (test) updated test to reflect changes

* (fix) O3-2748 service queue - fix NPE in undo transition dialog (#1077)

* (fix) Fix queue filtering by location (#1078)

* (chore) Separate linting and formatting concerns (#1080)

* (feat) O3-3030 - make new queue table support creating new queue entry (#1079)

* (feat) O3-3030 - make new queue table support creating new queue entry

* fix metrics

* address PR comment

* (fix):O3-3039-Fix Incorrect Client Selection Issue When Navigating Pages in Queue Table (#1082)

* (refactor) O3-3012: Switch registering appointments form workspace ba… (#1068)

* (fix) Fix error for undifined attribute type (#1083)

* (test) O3-3005: Add E2E test for registering an unknown patient (#1070)

Co-authored-by: Dennis Kigen <[email protected]>

* (fix) Handle null start date on patient list details (#1081)

* Handle null start date on list details

* Removed unnecessary optional chaining

---------

Co-authored-by: Dennis Kigen <[email protected]>

* (chore) Update translations from Transifex (#1059)

Co-authored-by: OpenMRS Bot <[email protected]>
Co-authored-by: Ian <[email protected]>

* (refactor) O3-2685: Inconsistent / Duplicated Appointments List UI between Home App and Appointments App (#1084)

* (chore) Fix Prettier glob patterns

* O3-3030 service queues: fix NPE in mapVisitQueueEntryProperties (#1085)

* O3-3030 service queues: fix NPE in mapVisitQueueEntryProperties

* change default rep string for queue entries to include visit encounters

---------

Co-authored-by: Makombe Kennedy <[email protected]>

* (test) Remove mock implementations of usePagination (#1088)

* (test) Remove mock implementations of usePagination

* Fixup

* (chore) Bump playwright (#1090)

* O3-3043 - (feat) service queues - add new view of queue entries showin… (#1086)

* O3-3043 - (feat) service queues - add new view of queue entries showing one table per status

* move queue-table-for-all-statuses into view/

* (chore) Flag rules-of-hooks lint violations (#1091)

* (chore) Flag rules-of-hooks lint violations

* Fix e2e tests

* (chore) Update translations from Transifex (#1087)

Co-authored-by: OpenMRS Bot <[email protected]>
Co-authored-by: Ian <[email protected]>

* (feat) O3-3063: UI tweaks for the Today's appointments widget (#1092)

* (feat) UI tweaks for the Today's appointments widget

* Appointments dashboard fixes

* (fix) O3-3063: Fix appointments table empty state text (#1094)

* (feat) O3:3063: Appointments dashboard UI tweaks (#1096)

* (fix) Fix appointment metrics error state

* Enhanced relationship display logic to differentiate 'Patient' roles (#1089)

* (fix): improve client side form validation

* (fix): error validation

* Fixup

---------

Signed-off-by: Joshua Murithi <[email protected]>
Co-authored-by: Donald Kibet <[email protected]>
Co-authored-by: chibongho <[email protected]>
Co-authored-by: Michael Seaton <[email protected]>
Co-authored-by: Jayasanka Weerasinghe <[email protected]>
Co-authored-by: Mark Goodrich <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: OpenMRS Bot <[email protected]>
Co-authored-by: Joshua Murithi <[email protected]>
Co-authored-by: Dennis Kigen <[email protected]>
Co-authored-by: Gabriel Mbatha Ngao <[email protected]>
Co-authored-by: sparsh989 <[email protected]>
Co-authored-by: Makombe Kennedy <[email protected]>
Co-authored-by: Daud Kakumirizi <[email protected]>
Co-authored-by: Pedro Sousa - ICRC <[email protected]>
Co-authored-by: Ian <[email protected]>
Co-authored-by: Piyush Mishra <[email protected]>
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.

5 participants