Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

saqar's avatar
Level 1

How to go about patients bill in a hospital management system.

I want to know how to get all services provided to a particular patient and bill him on that when he gets to the accountant office to pay bills. I don't want the accountant inputing price of services the patients had access to but rather getting the patients total bill by just clicking a link in his dashboard. So lets say we bill them on their lab tests and medicine issued to them. How do i go about it?

0 likes
21 replies
vincent15000's avatar

What do you have already done ? Is it an existing application ? Can you give more details ?

saqar's avatar
Level 1

@vincent15000 Yeah its an existing application, I've done quite a lot to be fair. Can you narrow down on what you'll need?

1 like
Sinnbeck's avatar

Really hard to say without more context? Sounds like a simple query to the database getting the sum? But I dont know your database structure.

Bill::query()->where('patient', 22)->sum('amount');
1 like
saqar's avatar
Level 1

@Sinnbeck I've not done any tables for Bills yet in my database. I've got that of the medicine prescription and the lab tests of the patients. So i was wondering how to get the total prices of the prescription and lab test in the Bill table for the accountant to access. How would you go about it, say i haven't done the prescription, lab tests and bill tables??

I hope i'm making sense

1 like
Sinnbeck's avatar

@saqar First start by designing those tables. Then show us how they are set up. Then we can help you with how to get the data you need out.

1 like
tykus's avatar

@saqar where do you store the information about the services used by the patient?

1 like
Sinnbeck's avatar

@saqar It sounds to me like the question isnt "how do I get the total" but rather "how do I design my database" ?

1 like
martinbean's avatar

@saqar Sounds like you’ve been tasked with a job at work and wanting us to solve it for you…

1 like
saqar's avatar
Level 1

@tykus Yeah we are in the same group, actually introduced me to laracast

1 like
martinbean's avatar

no please. Its school work

@saqar We’re to here to do your homework either. If you’re stuck, ask your tutor.

tykus's avatar

@saqar no shit... the same assignment and the same basic knowledge...

saqar's avatar
Level 1

@tykus it hasn't been easy. The fact is we were taught PHP and Laravel for a month and that's all the experience we have. its why we are struggling

OussamaMater's avatar

@saqar I assume you are Arab? I know the struggle, I have been there, bad teachers, non sense course in a month (sometimes less) and you have to figure out where to start alone, without much infos, straighten up buddy 💪

They said so because they don't have the full idea about schools here and comparing them to EU, US, USA usually.

1 like
tykus's avatar

@saqar the Laravel From Scratch series will be a good primer in that case. I would suggest supplementing your course with these free lessons to understand how to design and build a Laravel application.

1 like

Please or to participate in this conversation.