healthcare fix - str encode to utf-8 (#14213)
This commit is contained in:
parent
7ad556cd4c
commit
27cf190269
@ -6,7 +6,7 @@ from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import getdate
|
||||
from frappe.utils import getdate, cstr
|
||||
import json
|
||||
from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_receivable_account, get_income_account
|
||||
|
||||
@ -125,7 +125,7 @@ def delete_medical_record(consultation):
|
||||
def set_subject_field(consultation):
|
||||
subject = "No Diagnosis "
|
||||
if(consultation.diagnosis):
|
||||
subject = "Diagnosis: \n"+ str(consultation.diagnosis)+". "
|
||||
subject = "Diagnosis: \n"+ cstr(consultation.diagnosis)+". "
|
||||
if(consultation.drug_prescription):
|
||||
subject +="\nDrug(s) Prescribed. "
|
||||
if(consultation.test_prescription):
|
||||
|
@ -6,7 +6,7 @@ from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
import json
|
||||
from frappe.utils import getdate
|
||||
from frappe.utils import getdate, cstr
|
||||
from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_receivable_account
|
||||
from frappe import _
|
||||
|
||||
@ -228,9 +228,9 @@ def get_employee_by_user_id(user_id):
|
||||
return employee
|
||||
|
||||
def insert_lab_test_to_medical_record(doc):
|
||||
subject = str(doc.test_name)
|
||||
subject = cstr(doc.test_name)
|
||||
if(doc.test_comment):
|
||||
subject += ", \n"+str(doc.test_comment)
|
||||
subject += ", \n"+ cstr(doc.test_comment)
|
||||
medical_record = frappe.new_doc("Patient Medical Record")
|
||||
medical_record.patient = doc.patient
|
||||
medical_record.subject = subject
|
||||
|
@ -5,6 +5,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import cstr
|
||||
|
||||
class VitalSigns(Document):
|
||||
def on_submit(self):
|
||||
@ -33,16 +34,16 @@ def delete_vital_signs_from_medical_record(doc):
|
||||
def set_subject_field(doc):
|
||||
subject = " "
|
||||
if(doc.temperature):
|
||||
subject += "Temperature: \n"+ str(doc.temperature)+". "
|
||||
subject += "Temperature: \n"+ cstr(doc.temperature)+". "
|
||||
if(doc.pulse):
|
||||
subject += "Pulse: \n"+ str(doc.pulse)+". "
|
||||
subject += "Pulse: \n"+ cstr(doc.pulse)+". "
|
||||
if(doc.respiratory_rate):
|
||||
subject += "Respiratory Rate: \n"+ str(doc.respiratory_rate)+". "
|
||||
subject += "Respiratory Rate: \n"+ cstr(doc.respiratory_rate)+". "
|
||||
if(doc.bp):
|
||||
subject += "BP: \n"+ str(doc.bp)+". "
|
||||
subject += "BP: \n"+ cstr(doc.bp)+". "
|
||||
if(doc.bmi):
|
||||
subject += "BMI: \n"+ str(doc.bmi)+". "
|
||||
subject += "BMI: \n"+ cstr(doc.bmi)+". "
|
||||
if(doc.nutrition_note):
|
||||
subject += "Note: \n"+ str(doc.nutrition_note)+". "
|
||||
subject += "Note: \n"+ cstr(doc.nutrition_note)+". "
|
||||
|
||||
return subject
|
||||
|
Loading…
x
Reference in New Issue
Block a user