Skip to content

Use order service in orders report and avoid repeating patient header#31

Draft
Codex wants to merge 3 commits intomainfrom
codex/fix-report-print-service-attribute
Draft

Use order service in orders report and avoid repeating patient header#31
Codex wants to merge 3 commits intomainfrom
codex/fix-report-print-service-attribute

Conversation

@Codex
Copy link

@Codex Codex AI commented Feb 25, 2026

Orders export was pulling service from the patient profile and repeated the patient name for every line; reports should use each order’s service and show the patient header once.

  • Changes
    • Orders report now renders a single patient header followed by entries.
    • Each order line uses the order’s own service plus date/time instead of the patient profile service.
const lines = [formatPatientHeader(patient)]
scoped.forEach((entry) => {
  const orderDateTime = `${formatDateMMDD(entry.orderDate)} ${formatClock(entry.orderTime)}`
  const header = [entry.service?.trim(), orderDateTime].filter(Boolean).join(' – ')
  lines.push([header, entry.orderText].filter(Boolean).join('\n'))
})
Original prompt

In the reporting page there is a way to export the orders. This has an attribute called "Service". The orders page shows the list of orders with the correct service listed. The report print of the orders however, doesn't use the order's "Service" attribute. It is mistakingly using the Patient profile's service which is not what we want. Use the order service, similar to how the list is shown in the orders tab.

Additionally, the print report of the orders repeats the name of the current patient for each order. Since this will be the same, just mention it once at the top and then a list of the orders without repeating the name.

@Codex Codex AI changed the title [WIP] Fix report print to use order service attribute Use order service in orders report and avoid repeating patient header Feb 25, 2026
@Codex Codex AI requested a review from CSfromCS February 25, 2026 13:26
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