Skip to content

Commit

Permalink
Merge pull request #921 from aakvatech/version-14-hotfix
Browse files Browse the repository at this point in the history
v14.15.0
  • Loading branch information
aakvatech authored Mar 21, 2024
2 parents 8069bba + 9cbcd38 commit 319042f
Show file tree
Hide file tree
Showing 25 changed files with 1,452 additions and 343 deletions.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
## Hms Tz
## HMS TZ - Healthcare Management System tuned for Tanzania

Hms Tz
HMS Tz is a healthcare management module designed for use within ERPNext. It provides a comprehensive suite of features tailored for healthcare facilities and services. The module includes functionalities for managing laboratory equipment, medication, healthcare providers, financial aspects like insurance claims (specifically NHIF - National Health Insurance Fund), patient care services, and various healthcare data records. HMS Tz is geared towards streamlining operations in healthcare settings, ensuring efficient patient care, and managing financial and administrative tasks effectively.

Features in ERPNext can be categorized into several key areas:

1. **Lab and Medication Management**: This includes managing lab machine profiles, messages, and medication change requests.

2. **Healthcare Provider and Facility Management**: Managing information about healthcare providers, facilities, and practitioner availability.

3. **Insurance and Financial Management**: This involves managing NHIF claims, tracking changes, setting up company NHIF settings, and handling patient discount requests.

4. **Patient Care and Services**: This covers healthcare package orders, referral management, and tracking of patient care services.

5. **Data and Record Management**: Involves managing various healthcare data such as physician qualifications, organ systems, and healthcare referral records.

6. **NHIF Specific Management**: This includes managing NHIF products, claims, reconciliations, responses, and scheme details.

This categorization provides a structured overview of the functionalities offered by the HMS Tz module.

#### License

Expand Down
9 changes: 6 additions & 3 deletions hms_tz/hms_tz/doctype/patient_encounter/patient_encounter.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def create_therapy_plan(encounter):
doc.hms_tz_patient_age = encounter.patient_age
doc.hms_tz_patient_sex = encounter.patient_sex
doc.hms_tz_insurance_coverage_plan = encounter.insurance_coverage_plan
doc.insurance_company = encounter.insurance_company
doc.ref_doctype = "Patient Encounter"
doc.ref_docname = encounter.name
for entry in therapies:
Expand All @@ -84,16 +85,18 @@ def create_therapy_plan(encounter):
"therapy_type": entry.therapy_type,
"no_of_sessions": entry.no_of_sessions,
"prescribe": entry.prescribe or 0,
"is_restricted": entry.is_restricted or 0,
"hms_tz_ref_childname": entry.name
},
)
doc.save(ignore_permissions=True)
if doc.get("name"):
encounter.db_set("therapy_plan", doc.name)
frappe.msgprint(
_("Therapy Plan {0} created successfully.").format(
frappe.bold(doc.name)
_(
f"Therapy Plan {frappe.bold(doc.name)} created successfully."
),
alert=True,
alert=True
)


Expand Down
115 changes: 72 additions & 43 deletions hms_tz/hms_tz/report/itemized_bill_report/itemized_bill_report.html
Original file line number Diff line number Diff line change
@@ -1,74 +1,103 @@
<style>
.print-format {
padding-left: 10mm;
padding-right: 5mm;
padding-top: 0mm;
font-size: 10pt;
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f5f5f5;
}

.print-format table {
width: 100% !important;
table-layout: fixed;
h1 {
text-align: center;
margin-top: 0;
}

.print-format td,
.print-format th {
vertical-align: top !important;
padding: 1px !important;
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
.print-format th {
font-weight: bold;
color: black;

table, th, td {
border: 0px solid #333;
}

th, td {
padding: 10px;
text-align: center;
}

th {
background-color: #333 !important;
color: #fff !important;
}

tr:nth-child(even) {
background-color: #f2f2f2;
}

hr {
margin-top: 10px;
margin-bottom: 5px;
thead {
display: table-header-group;
}

@media screen {
.print-format {
padding-left: 10mm;
padding-right: 5mm;
padding-top: 0mm;
font-size: 10pt;
width: 8.5in;
height: 11in;
@media print {
h1 {
font-size: 17px !important;
color: #ffffff !important;
text-align: center !important;
}

p {
font-size: 16px !important;
color: #111010 !important;
}

th, td {
font-size: 16px !important;
}

.print-format table {
width: 100% !important;
table-layout: fixed;
th {
background-color: #797676 !important;
color: #fff !important;
}

.print-format td,
.print-format th {
vertical-align: top !important;
padding: 1px !important;
th {
background-color: #333 !important;
color: #fff !important;
}

tr:nth-child(even) {
background-color: #f2f2f2;
}

tr:nth-child(even) {
background-color: #f2f2f2;
}
.print-format th {
font-weight: bold;
color: black;


/* Ensure the table headers are visible on each page */
thead {
display: table-header-group !important;
}

hr {
margin-top: 10px;
margin-bottom: 5px;
/* Add page breaks for tables */
table {
page-break-inside: auto;
}
}
</style>

<table cellspacing=0 cellpadding=0 style="border: 0px solid black;">

<!-- <table cellspacing=0 cellpadding=0 style="border: 0px solid black;"> -->
<colgroup>
<col style="width: 100%" />
</colgroup>
<thead>
<tr>
<td>
<p class="manifest-header text-center">
<img src="/files/SHMH Letterhead 2021-04-28.png" style="width: 100% !important;" />
<!-- <img src="/files/SHMH Letterhead 2021-04-28.png" style="width: 100% !important;" />
<br><br>
<hr>
<hr> -->
<p style="font-size: 20pt; font-family: Arial, Helvetica, sans-serif; text-align: center;">
ITEMIZED BILL
</p>
Expand Down Expand Up @@ -266,4 +295,4 @@ <h5 style="justify-content: center;">{%= __("Daily Limit Exceeded Items:") %}</h
</td>
</tr>
</tbody>
</table>
<!-- </table> -->
51 changes: 26 additions & 25 deletions hms_tz/hms_tz/report/itemized_bill_report/itemized_bill_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def execute(filters=None):
admitted_discharge_date = frappe.db.get_value(
"Inpatient Record",
{"patient_appointment": filters.patient_appointment},
["admitted_datetime as admitted_date", "discharge_date"],
["admitted_datetime as admitted_date", "discharge_date", "scheduled_date"],
as_dict=True,
)
if not filters.get("patient_type"):
Expand Down Expand Up @@ -83,6 +83,13 @@ def execute(filters=None):
for n in range(0, len(data)):
total_amount += data[n]["amount"]

_date = ""
if admitted_discharge_date:
if admitted_discharge_date.admitted_date:
_date = admitted_discharge_date.admitted_date.strftime("%Y-%m-%d")
else:
_date = admitted_discharge_date.scheduled_date

last_row = {
"date": "Total",
"category": "",
Expand All @@ -97,14 +104,12 @@ def execute(filters=None):
"coverage_plan_name": "",
"authorization_number": "",
"coverage_plan_card_number": "",
"date_admitted": admitted_discharge_date.admitted_date.strftime(
"%Y-%m-%d"
)
if admitted_discharge_date
else "",
"date_discharge": admitted_discharge_date.discharge_date
if admitted_discharge_date
else "",
"date_admitted": _date,
"date_discharge": (
admitted_discharge_date.discharge_date
if admitted_discharge_date
else ""
),
"appointment_date": appointment_date,
}

Expand Down Expand Up @@ -168,14 +173,12 @@ def execute(filters=None):
"coverage_plan_name": "",
"authorization_number": "",
"coverage_plan_card_number": "",
"date_admitted": admitted_discharge_date.admitted_date.strftime(
"%Y-%m-%d"
)
if admitted_discharge_date
else "",
"date_discharge": admitted_discharge_date.discharge_date
if admitted_discharge_date
else "",
"date_admitted": _date,
"date_discharge": (
admitted_discharge_date.discharge_date
if admitted_discharge_date
else ""
),
"appointment_date": appointment_date,
}

Expand Down Expand Up @@ -243,14 +246,12 @@ def execute(filters=None):
"coverage_plan_name": "",
"authorization_number": "",
"coverage_plan_card_number": "",
"date_admitted": admitted_discharge_date.admitted_date.strftime(
"%Y-%m-%d"
)
if admitted_discharge_date
else "",
"date_discharge": admitted_discharge_date.discharge_date
if admitted_discharge_date
else "",
"date_admitted": _date,
"date_discharge": (
admitted_discharge_date.discharge_date
if admitted_discharge_date
else ""
),
"appointment_date": appointment_date,
}

Expand Down
13 changes: 12 additions & 1 deletion hms_tz/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"Inpatient Record": "nhif/api/inpatient_record.js",
"Healthcare Service Unit": "nhif/api/service_unit.js",
"Therapy Plan": "nhif/api/therapy_plan.js",
"Therapy Session": "nhif/api/therapy_session.js",
"Clinical Procedure": "nhif/api/clinical_procedure.js",
"Medical Department": "nhif/api/medical_department.js",
"Delivery Note": "nhif/api/delivery_note.js",
Expand Down Expand Up @@ -141,7 +142,10 @@
"before_submit": "hms_tz.nhif.api.patient_encounter.before_submit",
"validate": "hms_tz.nhif.api.patient_encounter.on_submit_validation",
"on_trash": "hms_tz.nhif.api.patient_encounter.on_trash",
"on_submit": "hms_tz.nhif.api.patient_encounter.on_submit",
"on_submit": [
"hms_tz.nhif.api.patient_encounter.on_submit",
"hms_tz.nhif.api.sales_order.create_sales_order",
],
"before_insert": "hms_tz.nhif.api.patient_encounter.before_insert",
"after_insert": "hms_tz.nhif.api.patient_encounter.after_insert",
},
Expand Down Expand Up @@ -201,9 +205,16 @@
"Prescription Dosage": {
"before_insert": "hms_tz.nhif.api.prescription_dosage.before_insert",
},
"Sales Order": {
"validate": "hms_tz.nhif.api.sales_order.validate",
"before_submit": "hms_tz.nhif.api.sales_order.before_submit",
},
# "Therapy Plan": {
# "validate": "hms_tz.nhif.api.therapy_plan.validate",
# },
"Therapy Session": {
"after_insert": "hms_tz.nhif.api.therapy_session.after_insert",
},
}

# standard_queries = {
Expand Down
3 changes: 2 additions & 1 deletion hms_tz/nhif/api/clinical_procedure.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ frappe.ui.form.on('Clinical Procedure', {
}

frappe.call({
method: "hms_tz.nhif.api.healthcare_utils.varify_service_approval_number_for_LRPM",
method: "hms_tz.nhif.api.healthcare_utils.verify_service_approval_number_for_LRPMT",
args: {
company: frm.doc.company,
approval_number: frm.doc.approval_number,
template_doctype: "Clinical Procedure Template",
template_name: frm.doc.procedure_template,
appointment: frm.doc.appointment,
encounter: frm.doc.ref_docname
},
freeze: true,
Expand Down
2 changes: 1 addition & 1 deletion hms_tz/nhif/api/delivery_note.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ frappe.ui.form.on("Delivery Note Item", {
return;
}
frappe.call({
method: "hms_tz.nhif.api.healthcare_utils.varify_service_approval_number_for_LRPM",
method: "hms_tz.nhif.api.healthcare_utils.verify_service_approval_number_for_LRPMT",
args: {
company: frm.doc.company,
approval_number: row.approval_number,
Expand Down
Loading

0 comments on commit 319042f

Please sign in to comment.