Skip to content

Use order-level service in Orders report output#29

Draft
Codex wants to merge 2 commits intomainfrom
codex/update-order-print-report
Draft

Use order-level service in Orders report output#29
Codex wants to merge 2 commits intomainfrom
codex/update-order-print-report

Conversation

@Codex
Copy link

@Codex Codex AI commented Feb 25, 2026

Orders printouts were wrongly using the patient’s profile service and repeating the patient name on every order instead of listing it once.

  • Reporting fix: Orders report now renders the patient header a single time, then lists filtered orders with each entry’s own service, date/time, and text.
  • Version: Bumped app version to 1.2.5 for the reporting change.

Example (per-order service now used):

const orderLines = scoped.map((entry) => {
  const serviceLabel = entry.service.trim()
  const orderDateTime = `${formatDateMMDD(entry.orderDate)} ${formatClock(entry.orderTime)}`
  const orderHeader = [serviceLabel, orderDateTime].filter(Boolean).join(' – ')
  return [orderHeader || orderDateTime, entry.orderText.trim()].filter(Boolean).join('\n')
})
return [formatPatientHeader(patient), ...orderLines].join('\n\n')
Original prompt

In the reporting tab, there is an option to print the Orders. It should show the orders that are filtered. It should show the "Service" in that order so each order would have its own service attribute. The patient profile however has its own "Service" attribute. When generating the output report print, it should use the order's service attribute, not the profile's. The summary or list shown in the orders page listing the orders is correct wherein it shows the orders service not the profile.

Additionally, when we generate the output of the report for Orders, since this is only for the same person, the current one, no need to repeat the name each entry of the order. Just once at the top then a list of the orders and details.

@Codex Codex AI changed the title [WIP] Update order report printing to use order's service attribute Use order-level service in Orders report output Feb 25, 2026
@Codex Codex AI requested a review from CSfromCS February 25, 2026 13:21
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.

2 participants