Skip to content

Commit

Permalink
fix: Linter issues for failing semgrep rule
Browse files Browse the repository at this point in the history
Signed-off-by: Syed Mujeer Hashmi <mujeerhashmi@4csolutions.in>
  • Loading branch information
mujeerhashmi authored and akashkrishna619 committed Sep 25, 2023
1 parent feefcb2 commit 92176d5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ var schedule_discharge = function(frm) {
],
primary_action_label: __('Order Discharge'),
primary_action : function() {
var args = {
var discharge_details = {
patient: frm.doc.patient,
discharge_practitioner: dialog.get_value('discharge_practitioner'),
discharge_ordered_datetime: dialog.get_value('discharge_ordered_datetime'),
Expand All @@ -275,7 +275,7 @@ var schedule_discharge = function(frm) {
}
frappe.call ({
method: 'healthcare.healthcare.doctype.inpatient_record.inpatient_record.schedule_discharge',
args: {args},
args: {discharge_details},
callback: function(data) {
if(!data.exc){
frm.reload_doc();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ def schedule_inpatient(args):


@frappe.whitelist()
def schedule_discharge(args):
discharge_order = json.loads(args)
def schedule_discharge(discharge_details):
discharge_order = json.loads(discharge_details)
inpatient_record_id = frappe.db.get_value(
"Patient", discharge_order["patient"], "inpatient_record"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

frappe.ui.form.on('Patient Encounter', {
onload: function(frm) {
if (!frm.doc.__islocal && frm.doc.docstatus === 1 &&
frm.doc.inpatient_status == 'Admission Scheduled') {
if (!frm.doc.__islocal && frm.doc.docstatus === 1) {
frappe.db.get_value('Inpatient Record', frm.doc.inpatient_record,
['admission_encounter', 'status']).then(r => {
if (r.message) {
Expand Down Expand Up @@ -334,7 +333,7 @@ var schedule_discharge = function(frm) {
var dialog = new frappe.ui.Dialog ({
title: 'Inpatient Discharge',
fields: [
{fieldtype: 'Datetime', label: 'Discharge Ordered Datetime', fieldname: 'discharge_ordered_datetime', default: 'Today', read_only: 1},
{fieldtype: 'Datetime', label: 'Discharge Ordered Datetime', fieldname: 'discharge_ordered_datetime', default: frappe.datetime.now_datetime()},
{fieldtype: 'Date', label: 'Followup Date', fieldname: 'followup_date'},
{fieldtype: 'Link', label: 'Nursing Checklist Template', options: 'Nursing Checklist Template', fieldname: 'discharge_nursing_checklist_template'},
{fieldtype: 'Column Break'},
Expand All @@ -344,7 +343,7 @@ var schedule_discharge = function(frm) {
],
primary_action_label: __('Order Discharge'),
primary_action : function() {
var args = {
var discharge_details = {
patient: frm.doc.patient,
discharge_encounter: frm.doc.name,
discharge_practitioner: frm.doc.practitioner,
Expand All @@ -356,7 +355,7 @@ var schedule_discharge = function(frm) {
}
frappe.call ({
method: 'healthcare.healthcare.doctype.inpatient_record.inpatient_record.schedule_discharge',
args: {args},
args: {discharge_details},
callback: function(data) {
if(!data.exc){
frm.reload_doc();
Expand Down

0 comments on commit 92176d5

Please sign in to comment.