### **OOP-Based Design of Orders and Bills in CareCode HIS** In the CareCode Hospital Information System (HIS), the concept of an **Order, Bill, or Request** is modelled using Object-Oriented Programming (OOP) principles. This design ensures that every order or bill is represented as a well-defined object with attributes and relationships. Below is an overview of the core attributes and class hierarchy. #### **Attributes of an Order/Bill/Request** 1. **Patient Attributes** A patient object contains all the necessary details about the patient for whom the order or bill is generated. 2. **Bill Date and Time** Records the exact date and time when the bill is issued. 3. **Bill Number** A unique identifier assigned to each bill for reference. 4. **Total Price** The total amount to be paid, including all bill items and fees. 5. **Referring Doctor** The doctor who referred the patient for the relevant service or procedure. 6. **Bill Department** The department where the bill is generated, typically the one responsible for collecting payments (e.g., OPD or Cashier). 7. **Bill Institution** The healthcare institution responsible for generating the bill. 8. **To Department** The department that provides the service (e.g., Radiology for X-rays or the Lab for blood tests). Revenue is attributed to this department. 9. **To Institution** The institution where the service is rendered, which may differ from the billing institution. 10. **Bill Items** Each bill contains multiple individual requests or services. For example, a single bill might contain requests for tests like FNAC, FBS, and CXR. 11. **Bill Fees** Each service in a bill includes several associated fees, such as: - Consultant fee - Medical Officer fee - Laboratory Technician (MLT) fee - Hospital fee These fees are encapsulated within the `BillFee` object and contribute to the overall bill item total. 12. **Gross Total, Discount, and Net Total** - **Gross Total:** The sum of all fees before any deductions. - **Discount:** Any reductions or discounts applied. - **Net Total:** The final payable amount after discounts. 13. **Tax** Applicable taxes added to the bill. 14. **Fee Summaries** - Sum of Staff Fees - Sum of Hospital Fees - Sum of Collecting Centre Fees (If the total is income for the institution, it is positive. If there are refunds or cancellations, it is negative.) --- #### **Class Hierarchy: OOP Model of the Bill Object** 1. **`Bill` (Parent Class)** The `Bill` class serves as the parent class, encapsulating all shared attributes and behaviour among its subclasses. 2. **Subclasses of `Bill`** - **`PreBill`** Represents a preliminary bill, which may be subject to modification before finalisation. - **`BilledBill`** A finalised bill that is issued to the patient. It maintains a reference to any cancelled or returned bills associated with it: - **Cancellation Reference:** Points to a `CancelledBill` if the bill is voided. - **Return Bills List:** A list of multiple `ReturnBills` if the patient returns parts of the service. - **`CancelledBill`** This object is created when a `BilledBill` is cancelled. It holds a reference back to the original `BilledBill`. - **`ReturnBill`** --- This OOP-based design ensures that every bill or order is accurately represented with a well-structured hierarchy. It supports tracking services across departments and institutions, capturing staff and hospital fees, and handling complex scenarios like cancellations and returns. This modular structure also enhances flexibility, allowing the system to cater to various billing workflows. A concept in CareCOde HIS OOP-based Design Order or a Bill or a Request Attributes- * Patient attributes. And patient object content all the patient details. * Bill date * Bill time * Bill Number * Total price * Referring Doctor * Bill Department - where the Bill is raised, the cash is collected, ex. A patient comes to OPD, taking money for any services given by any other department * Bill Institution * To Department - where the service is given. for example. in the above bill, X-Rays will be done by the Radiology Department and Investigations will be done by the Lab. Revenue is generated by this department. * To Institution * Bill Items - One bill/request consists of multiple individual requests. One Bill from OPD for Patient A, may have BillItems for FNAC, FBS, CXR * Bill Fees - Has a reference to Bill Item as well. For Ex. FNAC has the following fees - Staff fee for Cosultant Pathologist, Staff Fee for Medical Officer, Staff Fee for MLT, Hospital Fee, Fees for the medical user, etc. Each is represented by BillFee. Bill Fee total is added to decide Bill Item Totals and then Bill Totals * Gross Total * Discount * Net Total * Tax * Sum of Staff Fees * Sum of Hospital Fees # Sum of Collecting Centre Fees (For totals, we the company gets income, they are plus, if cash going out, as in cancellation, refund, totals are Negatives) Bill - Parent Class Sub Classes * PreBill - * BilledBill - has a reference to cancelleBill as CancelBill, no referance to a single ReturnBill, has a list of returnBills. * CancelleBill - when a BilledBill is cancelled, a new cancelledBill is created, which has a reference called BilledBill * ReturnBill - when a BilledBill is returned, multiple times is a possibility, is created. Has a reference to BilledBill [Back](https://github.com/hmislk/hmis/wiki/Knowledgebase)