5073ac4dcb
* Page - Patient History * Healthcare Utils - get patient vitals * Healthcare Utils - render doc as html for patient history page * Page - Patient History - prcatitioner image in time line * Page - Patient History in menu * fix - page medical history * fix: page patient_history broken img, minor fixes * fix: patient_history page, add pagination, show doc if fetched * fix: Patient Medical Record to Patient History * fix: patient history page - set route options * fix: update to code standards * fix: remove Eidt button form patient history * fix: css update to code standards * fix: Remove page medical_record
40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
# Copyright (c) 2018, ESS LLP and contributors
|
|
# For license information, please see license.txt
|
|
|
|
from __future__ import unicode_literals
|
|
import frappe
|
|
from frappe.utils import cint
|
|
from erpnext.healthcare.utils import render_docs_as_html
|
|
|
|
@frappe.whitelist()
|
|
def get_feed(name, start=0, page_length=20):
|
|
"""get feed"""
|
|
result = frappe.db.sql("""select name, owner, creation,
|
|
reference_doctype, reference_name, subject
|
|
from `tabPatient Medical Record`
|
|
where patient=%(patient)s
|
|
order by creation desc
|
|
limit %(start)s, %(page_length)s""",
|
|
{
|
|
"patient": name,
|
|
"start": cint(start),
|
|
"page_length": cint(page_length)
|
|
}, as_dict=True)
|
|
return result
|
|
|
|
@frappe.whitelist()
|
|
def get_feed_for_dt(doctype, docname):
|
|
"""get feed"""
|
|
result = frappe.db.sql("""select name, owner, modified, creation,
|
|
reference_doctype, reference_name, subject
|
|
from `tabPatient Medical Record`
|
|
where reference_name=%(docname)s and reference_doctype=%(doctype)s
|
|
order by creation desc""",
|
|
{
|
|
"docname": docname,
|
|
"doctype": doctype
|
|
}, as_dict=True)
|
|
|
|
return result
|