Invoice clinical pathway support
Public API invoices can now be linked to a clinical pathway when they are created or updated. Invoice queries expose both the stored pathway identifier and optional nested pathway data.
Create, update, and unlink
Pass clinicalPathwayId in NewInvoiceDataInput or UpdateInvoiceDataInput.
The pathway must belong to the invoice patient and must not be deleted.
Passing clinicalPathwayId: null to updateInvoice unlinks the invoice.
mutation LinkInvoiceToPathway($invoiceId: ID!, $pathwayId: ID!) {
updateInvoice(
invoiceId: $invoiceId
invoiceData: { clinicalPathwayId: $pathwayId }
) {
data { id clinicalPathwayId }
error
}
}
Read pathway data
clinicalPathwayId requires invoice read access only. Nested
clinicalPathway data additionally requires pathway read access and the
episodes-of-care feature.
query InvoicePathway($invoiceId: ID!) {
invoice(id: $invoiceId) {
id
clinicalPathwayId
clinicalPathway {
id
episodeId
metadata { key value }
}
}
}
If an invoice is not linked, clinicalPathwayId and clinicalPathway are
null. If its linked pathway has been deleted, the stored
clinicalPathwayId remains available while clinicalPathway returns null.
Filter invoices by pathway
Use invoices(filters: { clinicalPathwayId: $pathwayId }) to list invoices
for one pathway. When this is combined with Healthcode filters, dateRange
is required.