Skip to content

Commit

Permalink
RFL Reporting Query Option
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmiller committed Oct 6, 2024
1 parent fc11c98 commit 619f5d2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
20 changes: 12 additions & 8 deletions elcid/assets/js/elcid/controllers/clinical_timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@ angular.module('opal.controllers').controller(
};

this.hasIcuOrObservation = function(item){
if(item.reason_for_interaction !== 'ICU round'){
return false;
}
var icuSize = _.size(item.micro_input_icu_round_relation.icu_round)
var observation = _.size(item.micro_input_icu_round_relation.observation)
if(icuSize || observation){
return true;
}
//
// This was removed, and this check is no longer useful.
// TODO Remove more permanently
//
// if(item.reason_for_interaction !== 'ICU round'){
// return false;
// }
// var icuSize = _.size(item.micro_input_icu_round_relation.icu_round)
// var observation = _.size(item.micro_input_icu_round_relation.observation)
// if(icuSize || observation){
// return true;
// }
return false;
}

Expand Down
17 changes: 17 additions & 0 deletions intrahospital_api/apis/prod_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,23 @@ def execute_epma_query(self, query, params=None):
logger.debug(result)
return result

def execute_rfl_reporting_query(self, query, params=None):
with pytds.connect(
self.reporting_settings["ip_address"],
self.reporting_settings["database"],
self.reporting_settings["username"],
self.reporting_settings["password"],
as_dict=True
) as conn:
with conn.cursor() as cur:
logger.info(
"Running RFL Reporting query {} {}".format(query, params)
)
cur.execute(query, params)
result = cur.fetchall()
logger.debug(result)
return result

@property
def pathology_demographics_query(self):
return PATHOLOGY_DEMOGRAPHICS_QUERY.format(
Expand Down
2 changes: 1 addition & 1 deletion plugins/admissions/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def load_bed_status():

api = ProdAPI()

status = api.execute_warehouse_query(
status = api.execute_rfl_reporting_query(
Q_GET_ALL_BED_STATUS
)

Expand Down

0 comments on commit 619f5d2

Please sign in to comment.