-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[ENG-500] Support for creating multiple diagnostic reports in a service request #16455
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
base: develop
Are you sure you want to change the base?
Changes from 7 commits
5fcab8e
a8f3809
7df41e2
0d1dc49
f28b7f1
29314ad
13acde3
af5db1b
41bb2fa
af05e7b
db602f2
e2537fc
8614e10
76861d6
0e5afd5
f011c4e
d55cc57
88ef689
f15ef2e
257deb5
8cc6d10
ac46a03
24b2c55
8fb53bf
53d39eb
3cea86c
cca7592
79ff661
30a1517
ef3e185
ae41da7
0256a28
cfcaa11
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -267,6 +267,10 @@ export default function ServiceRequestShow({ | |
| activityDefinition.observation_result_requirements ?? []; | ||
| const diagnosticReports = request.diagnostic_reports || []; | ||
|
|
||
| const activeDiagnosticReports = diagnosticReports.filter( | ||
| (report) => report.status !== DiagnosticReportStatus.final, | ||
| ); | ||
|
|
||
| const assignedSpecimenIds = new Set<string>(); | ||
|
|
||
| const preparePrintAllQRCodes = async () => { | ||
|
|
@@ -596,22 +600,18 @@ export default function ServiceRequestShow({ | |
| </DropdownMenu> | ||
| </div> | ||
| )} | ||
| {(!diagnosticReports.length || | ||
| diagnosticReports[0]?.status !== | ||
| DiagnosticReportStatus.final) && ( | ||
| <DiagnosticReportForm | ||
| patientId={request.encounter.patient.id} | ||
| facilityId={facilityId} | ||
| serviceRequestId={serviceRequestId} | ||
| observationDefinitions={observationRequirements} | ||
| diagnosticReports={diagnosticReports} | ||
| activityDefinition={activityDefinition} | ||
| specimens={request.specimens || []} | ||
| disableEdit={disableEdit} | ||
| /> | ||
| )} | ||
| </div> | ||
|
|
||
| <DiagnosticReportForm | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
if there are mutiple diagnostic reports 1 A if I edit A and click save results after the update the order changes in the UI 1 B This feels like a Bad UX I think this is happening because of the diagnostic_reports returned in the SR are not ordered in the backend, either we need to fix the order in the backend or handle it in FE
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc: @gauritejusa is this fix needed in this pr? |
||
| patientId={request.encounter.patient.id} | ||
| facilityId={facilityId} | ||
| serviceRequestId={serviceRequestId} | ||
| observationDefinitions={observationRequirements} | ||
| diagnosticReports={activeDiagnosticReports} | ||
| activityDefinition={activityDefinition} | ||
| specimens={request.specimens || []} | ||
| disableEdit={disableEdit} | ||
| /> | ||
| </div> | ||
| {diagnosticReports.length > 0 && ( | ||
| <DiagnosticReportReview | ||
| facilityId={facilityId} | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.