Commit 3a11e232 authored by Adrien PARROT's avatar Adrien PARROT
Browse files

change in searchPage : add Hidden/show filters, rows per page

parent e5d044b8
......@@ -45,7 +45,7 @@ sap.ui.jsview("conceptmapper.conceptDetailPage", {
// numberUnit : "EUR",
title : "{conceptDetail>/concept_name}",
number : "{conceptDetail>/standard_concept}",
numberUnit : "{conceptDetail>/validity}",
numberUnit : "{conceptDetail>/invalid_reason}",
attributes : [
new sap.m.ObjectAttribute({
title : "concept_id",
......@@ -68,7 +68,7 @@ sap.ui.jsview("conceptmapper.conceptDetailPage", {
}), new sap.m.ObjectAttribute({
title : "domain_id",
text : "{conceptDetail>/domain_id}",
}),
}),
]
......@@ -89,7 +89,7 @@ sap.ui.jsview("conceptmapper.conceptDetailPage", {
template : new sap.m.ObjectListItem({
title : "{conceptDetail>concept_name}",
number : "{conceptDetail>standard_concept}",
numberUnit : "{conceptDetail>validity}",
numberUnit : "{conceptDetail>invalid_reason}",
type:"Active",
press: function(){
app.back();
......@@ -116,6 +116,9 @@ sap.ui.jsview("conceptmapper.conceptDetailPage", {
}), new sap.m.ObjectAttribute({
title : "domain_id",
text : "{conceptDetail>domain_id}",
}), new sap.m.ObjectAttribute({
title : "relationship_id",
text : "{conceptDetail>relationship_id}",
}),
]
......
sap.ui.controller("conceptmapper.searchPage", {
searcher : function (oEvt) {
var URL_concepts = "http://127.0.0.1:5000/concepts";
// var URL_concepts = "http://omop-mapper.fgh.ovh/concepts";
/**
* Called when a controller is instantiated and its View controls (if available) are already created.
* Can be used to modify the View before it is displayed, to bind event handlers and do other one-time initialization.
* @memberOf conceptmapper.searchPage
*/
onInit: function() {
// var oData1 = {
// "names" : [ {
// concept_id : "12121",
// concept_name : "Heart Rate",
// concept_code : "34343-43",
// concept_class_id : "parrot",
// vocabulary_id : "SNOMED",
// domain_id : "condition",
// validity : "Valid",
// standard_concept : "S",
// } , {
// concept_id : 213121231,
// concept_name : "Hematocssdjfkl fls sfdj lsfd flsdkjflsd slfj sdljsdlj fsdl fjrite",
// concept_code : "334-21",
// concept_class_id : "pondi",
// vocabulary_id : "SNOMED",
// domain_id : "LOINC",
// validity : "Valid",
// standard_concept : "S",
// } ],
// "total_concepts": 5,
// "total_valid_concepts": 4,
// "total_standard_concepts" : 3,
// }; // return les 15 premiers
// doit etre creer
// les domain existant, les vocabulaire existant, les langues existantes
// var oModel = new sap.ui.model.json.JSONModel(oData1);
// sap.ui.getCore().setModel(oModel, "concept");
var oStandardMCB_ref = sap.ui.getCore().byId('oStandardMCB').getSelectedItems();
var oStandardMCB_list = [];
for (var i in oStandardMCB_ref) {
oStandardMCB_list.push(oStandardMCB_ref[i].getProperty('text'));
}
sap.ui.getCore().byId("__container1-Master").addStyleClass('searchPage');
var oValidMCB_ref = sap.ui.getCore().byId('oValidMCB').getSelectedItems();
var oValidMCB_list = [];
for (var i in oValidMCB_ref) {
oValidMCB_list.push(oValidMCB_ref[i].getProperty('text'));
}
var oModel = new sap.ui.model.json.JSONModel();
var mData = {
"selected" : ["Standard"],
"items" : [{
"key" : "Standard",
"text" : "Standard"
},
{
"key" : "Non-Standard",
"text" : "Non-Standard"
},
{
"key" : "Classification",
"text" : "Classification"
}]
};
oModel.setData(mData);
sap.ui.getCore().setModel(oModel, "standardConcept");
var oDomainMCB_ref = sap.ui.getCore().byId('oDomainMCB').getSelectedItems();
var oDomainMCB_list = [];
for (var i in oDomainMCB_ref) {
oDomainMCB_list.push(oDomainMCB_ref[i].getProperty('text'));
}
var oModel = new sap.ui.model.json.JSONModel();
var mData = {
"selected" : ["Valid"],
"items" : [{
"key" : "Deleted",
"text" : "Deleted"
},{
"key" : "Updated",
"text" : "Updated"
},
{
"key" : "Valid",
"text" : "Valid"
}]
};
oModel.setData(mData);
sap.ui.getCore().setModel(oModel, "invalidReason");
var oVocMCB_ref = sap.ui.getCore().byId('oVocMCB').getSelectedItems();
var oVocMCB_list = [];
for (var i in oVocMCB_ref) {
oVocMCB_list.push(oVocMCB_ref[i].getProperty('text'));
}
var oModel = new sap.ui.model.json.JSONModel();
var mData = {
"selected" : [],
"items" : [{
"key" : "Condition",
"text" : "Condition"
},
{
"key" : "Device",
"text" : "Device"
},
{
"key" : "Cost",
"text" : "Cost"
}]
};
oModel.setData(mData);
sap.ui.getCore().setModel(oModel, "domain");
var oLangMCB_ref = sap.ui.getCore().byId('oLangMCB').getSelectedItems();
var oLangMCB_list = [];
for (var i in oLangMCB_ref) {
oLangMCB_list.push(oLangMCB_ref[i].getProperty('text'));
}
var oModel = new sap.ui.model.json.JSONModel();
var mData = {
"selected" : [],
"items" : [{
"key" : "SNOMED",
"text" : "SNOMED"
},
{
"key" : "LOINC",
"text" : "LOINC"
var oRowsNumber = parseInt(sap.ui.getCore().byId('oRowInPageInput').getProperty('value'));
var oData = {};
if (!isNaN(oRowsNumber) && Number.isInteger(oRowsNumber)) {
var oTable_ref = sap.ui.getCore().byId('oTable');
oData.limit = oRowsNumber;
}
oData.mini = parseInt(sap.ui.getCore().byId('oMiniIB').getProperty('value'));
oData.maxi = parseInt(sap.ui.getCore().byId('oMaxiIB').getProperty('value'));
//oData.search_string = sap.ui.getCore().byId('searchField').getProperty('value');
// Standard => 'S' , Classification => 'C', Non-Standard => Null
oData.standard_concept = oStandardMCB_list;
// Valid => null, Deleted => 'D', Updated => 'U'
oData.invalid_reason = oValidMCB_list;
oData.domain_id = oDomainMCB_list;
oData.vocabulary_id = oVocMCB_list;
// oData.language_id = oLangMCB_list;
// oData.user_id = [];
// oData.frequency_id = [];
console.log(oData),
$.ajax({
type:"GET",
url:URL_concepts,
dataType:"json",
data: {"json" : JSON.stringify(oData)},
async: false,
//processData: false,
header: {
"Content-Type": "application/json",
},
{
"key" : "PCORNET",
"text" : "PCORNET"
}]
};
oModel.setData(mData);
sap.ui.getCore().setModel(oModel, "vocabulary");
var oModel = new sap.ui.model.json.JSONModel();
var mData = {
"selected" : [],
"items" : [{
"key" : "FR",
"text" : "FR"
success: function(data) {
if (oData.limit) {
oTable_ref.setVisibleRowCount(oRowsNumber);
}
console.log(data);
var oModel = new sap.ui.model.json.JSONModel(data);
sap.ui.getCore().setModel(oModel, "concept");
console.log("connection");
},
{
"key" : "EN",
"text" : "EN"
}]
};
oModel.setData(mData);
sap.ui.getCore().setModel(oModel, "language");
error : function(error) {
sap.m.MessageToast.show("Connexion error");
console.log(error);
}
});
},
goToConceptDetail : function (oEvt) {
//var URL_concept = "http://127.0.0.1:5000/concept/";
var URL_concept = "http://omop-mapper.fgh.ovh/concept/";
var URL_concept = "http://127.0.0.1:5000/concept/";
// var URL_concept = "http://omop-mapper.fgh.ovh/concept/";
var sVal = oEvt.getParameters().rowBindingContext.getProperty('concept_id');
......@@ -240,8 +202,8 @@ sap.ui.controller("conceptmapper.searchPage", {
&& oData.concept_code && oData.concept_class_id && oData.vocabulary_id
&& oData.domain_id && oData.invalid_reason && oData.standard_concept ) {
//var URL_concept = "http://127.0.0.1:5000/concept/";
var URL_concept = "http://omop-mapper.fgh.ovh/concept/";
var URL_concept = "http://127.0.0.1:5000/concept/";
// var URL_concept = "http://omop-mapper.fgh.ovh/concept/";
//
// var oModel = sap.ui.getCore().getModel('concept');
......@@ -531,86 +493,18 @@ sap.ui.controller("conceptmapper.searchPage", {
oDeleteDialog.open();
},
searcher : function (oEvt) {
//var URL_concepts = "http://127.0.0.1:5000/concepts";
var URL_concepts = "http://omop-mapper.fgh.ovh/concepts";
var oStandardMCB_ref = sap.ui.getCore().byId('oStandardMCB').getSelectedItems();
var oStandardMCB_list = [];
for (var i in oStandardMCB_ref) {
oStandardMCB_list.push(oStandardMCB_ref[i].getProperty('text'));
}
var oValidMCB_ref = sap.ui.getCore().byId('oValidMCB').getSelectedItems();
var oValidMCB_list = [];
for (var i in oValidMCB_ref) {
oValidMCB_list.push(oValidMCB_ref[i].getProperty('text'));
}
var oDomainMCB_ref = sap.ui.getCore().byId('oDomainMCB').getSelectedItems();
var oDomainMCB_list = [];
for (var i in oDomainMCB_ref) {
oDomainMCB_list.push(oDomainMCB_ref[i].getProperty('text'));
}
var oVocMCB_ref = sap.ui.getCore().byId('oVocMCB').getSelectedItems();
var oVocMCB_list = [];
for (var i in oVocMCB_ref) {
oVocMCB_list.push(oVocMCB_ref[i].getProperty('text'));
}
var oLangMCB_ref = sap.ui.getCore().byId('oLangMCB').getSelectedItems();
var oLangMCB_list = [];
for (var i in oLangMCB_ref) {
oLangMCB_list.push(oLangMCB_ref[i].getProperty('text'));
}
var oData = {};
oData.search_string = sap.ui.getCore().byId('searchField').getProperty('value');
// Standard => 'S' , Classification => 'C', Non-Standard => Null
oData.standard_concept = oStandardMCB_list;
// Valid => null, Deleted => 'D', Updated => 'U'
oData.invalid_reason = oValidMCB_list;
oData.mini = parseInt(sap.ui.getCore().byId('oMiniIB').getProperty('value'));
oData.maxi = parseInt(sap.ui.getCore().byId('oMaxiIB').getProperty('value'));
oData.domain_id = oDomainMCB_list;
oData.vocabulary_id = oVocMCB_list;
// oData.language_id = oLangMCB_list;
// oData.user_id = [];
// oData.frequency_id = [];
//oData.limit = -1;
console.log(oData),
/**
* Called when a controller is instantiated and its View controls (if available) are already created.
* Can be used to modify the View before it is displayed, to bind event handlers and do other one-time initialization.
* @memberOf conceptmapper.searchPage
*/
onInit: function() {
$.ajax({
type:"GET",
url:URL_concepts,
dataType:"json",
data: {"json" : JSON.stringify(oData)},
async: false,
//processData: false,
header: {
"Content-Type": "application/json",
},
success: function(data) {
debugger;
console.log(data);
var oModel = new sap.ui.model.json.JSONModel(data);
sap.ui.getCore().setModel(oModel, "concept");
console.log("connection");
},
error : function(error) {
sap.m.MessageToast.show("Connexion error");
console.log(error);
}
});
},
},
/**
......@@ -618,9 +512,102 @@ sap.ui.controller("conceptmapper.searchPage", {
* (NOT before the first rendering! onInit() is used for that one!).
* @memberOf conceptmapper.searchPage
*/
// onBeforeRendering: function() {
//
// },
onBeforeRendering: function() {
sap.ui.getCore().byId("__container1-Master").addStyleClass('searchPage');
var oModel = new sap.ui.model.json.JSONModel();
var mData = {
"selected" : ["Standard"],
"items" : [{
"key" : "Standard",
"text" : "Standard"
},
{
"key" : "Non-Standard",
"text" : "Non-Standard"
},
{
"key" : "Classification",
"text" : "Classification"
}]
};
oModel.setData(mData);
sap.ui.getCore().setModel(oModel, "standardConcept");
var oModel = new sap.ui.model.json.JSONModel();
var mData = {
"selected" : ["Valid"],
"items" : [{
"key" : "Deleted",
"text" : "Deleted"
},{
"key" : "Updated",
"text" : "Updated"
},
{
"key" : "Valid",
"text" : "Valid"
}]
};
oModel.setData(mData);
sap.ui.getCore().setModel(oModel, "invalidReason");
var oModel = new sap.ui.model.json.JSONModel();
var mData = {
"selected" : [],
"items" : [{
"key" : "Condition",
"text" : "Condition"
},
{
"key" : "Device",
"text" : "Device"
},
{
"key" : "Cost",
"text" : "Cost"
}]
};
oModel.setData(mData);
sap.ui.getCore().setModel(oModel, "domain");
var oModel = new sap.ui.model.json.JSONModel();
var mData = {
"selected" : [],
"items" : [{
"key" : "SNOMED",
"text" : "SNOMED"
},
{
"key" : "LOINC",
"text" : "LOINC"
},
{
"key" : "PCORNET",
"text" : "PCORNET"
}]
};
oModel.setData(mData);
sap.ui.getCore().setModel(oModel, "vocabulary");
var oModel = new sap.ui.model.json.JSONModel();
var mData = {
"selected" : [],
"items" : [{
"key" : "FR",
"text" : "FR"
},
{
"key" : "EN",
"text" : "EN"
}]
};
oModel.setData(mData);
sap.ui.getCore().setModel(oModel, "language");
},
/**
* Called when the View has been rendered (so its HTML is part of the document). Post-rendering manipulations of the HTML could be done here.
......
......@@ -19,7 +19,178 @@ sap.ui.jsview("conceptmapper.searchPage", {
* @memberOf conceptmapper.searchPage
*/
createContent : function(oController) {
var oSplitContainer = new sap.m.SplitContainer();
// Master Page
var oStandardCB = new sap.m.CheckBox({
id : "oStandardConcepts",
visible : true,
selected : true,
enabled : true,
text : "Standard concepts"
});
var oValidCB = new sap.m.CheckBox({
id : "oValidConcepts",
visible : true,
selected : true,
enabled : true,
text : "Valid concepts"
});
//
var oItemTemplateStandard = new sap.ui.core.Item({
key : "{standardConcept>key}",
text : "{standardConcept>text}",
enabled : "{standardConcept>enabled}"
});
var oStandardMCB = new sap.m.MultiComboBox({
id : "oStandardMCB",
// width : "400px",
placeholder : "Standard Concepts",
items : {
path : "standardConcept>/items",
template : oItemTemplateStandard
},
selectedKeys : {
path : "standardConcept>/selected",
template : "{standardConcept>selected}"
},
});
var oItemTemplateValid = new sap.ui.core.Item({
key : "{invalidReason>key}",
text : "{invalidReason>text}",
enabled : "{invalidReason>enabled}"
});
var oValidMCB = new sap.m.MultiComboBox({
id : "oValidMCB",
// width : "400px",
placeholder : "Valid concept",
items : {
path : "invalidReason>/items",
template : oItemTemplateValid
},
selectedKeys : {
path : "invalidReason>/selected",
template : "{invalidReason>selected}"
},
});
///////////////
var oItemTemplateDomain = new sap.ui.core.Item({
key : "{domain>key}",
text : "{domain>text}",
enabled : "{domain>enabled}"
});
var oDomainMCB = new sap.m.MultiComboBox({
id : "oDomainMCB",
// width : "400px",
placeholder : "Choose your domain",
items : {
path : "domain>/items",
template : oItemTemplateDomain
},
selectedKeys : {
path : "domain>/selected",
template : "{domain>selected}"
},
// change : function(oControlEvent) {
// jQuery.sap.log.info('Event fired: "change" value property to ' +
// oControlEvent.getParameter("value") + " on "
// + this);
// },
// selectionChange : function(oControlEvent) {
// jQuery.sap.log.info('Event fired: "selectionChange" value property to
// ' + oControlEvent.getParameter("changedItem")
// + " with selected=" + oControlEvent.getParameter("selected") + " on "
// + this);
// },
// selectionFinish : function(oControlEvent) {
// jQuery.sap.log.info('Event fired: "selectionFinish" value property to
// ' + oControlEvent.getParameter("selectedItems")
// + " on " + this);
// }
});
var oItemTemplateVoc = new sap.ui.core.Item({
key : "{vocabulary>key}",
text : "{vocabulary>text}",
enabled : "{vocabulary>enabled}"
});
var oVocMCB = new sap.m.MultiComboBox({
id : "oVocMCB",
// width : "400px",
placeholder : "Choose your vocabulary",
items : {
path : "vocabulary>/items",
template : oItemTemplateVoc
},
selectedKeys : {
path : "vocabulary>/selected",
template : "{vocabulary>selected}"