Commit befca0de authored by Adrien PARROT's avatar Adrien PARROT
Browse files

SearchPlace in place (voc, dom, min, max, standard, valid)

parent 16e10b3c
......@@ -28,53 +28,53 @@ sap.ui.controller("conceptmapper.conceptDetailPage", {
* @memberOf conceptmapper.conceptDetailPage
*/
onAfterRendering: function() {
var oData = {
concept_id : "test",
concept_name : "fdfdfd",
concept_code : "34343-43",
concept_class_id : "parrot",
vocabulary_id : "SNOMED",
domain_id : "condition",
standard_concept : "S",
relations: [
{
concept_id : "12121",
concept_name : "lab Rate",
concept_code : "34343-43",
concept_class_id : "parrot",
vocabulary_id : "SNOMED",
domain_id : "condition",
validity : "Valid",
standard_concept : "S",
}, {
concept_id : "4545",
concept_name : "445454 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",
}
]
};
sap.ui.getCore().setModel(new sap.ui.model.json.JSONModel(oData), "conceptDetail");
// SUBHEADER
//debugger;
//lol = "{label>/concept_id}";
//var toaster = sap.m.MessageToast.show("{label>concept_id}");
var oModel = sap.ui.getCore().getModel('label');
// var oData = {
// concept_id : "test",
// concept_name : "fdfdfd",
// concept_code : "34343-43",
// concept_class_id : "parrot",
// vocabulary_id : "SNOMED",
// domain_id : "condition",
// standard_concept : "S",
// relations: [
// {
// concept_id : "12121",
// concept_name : "lab Rate",
// concept_code : "34343-43",
// concept_class_id : "parrot",
// vocabulary_id : "SNOMED",
// domain_id : "condition",
// validity : "Valid",
// standard_concept : "S",
// }, {
// concept_id : "4545",
// concept_name : "445454 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",
// }
//
// ]
// };
// sap.ui.getCore().setModel(new sap.ui.model.json.JSONModel(oData), "conceptDetail");
// // SUBHEADER
// //debugger;
// //lol = "{label>/concept_id}";
// //var toaster = sap.m.MessageToast.show("{label>concept_id}");
// var oModel = sap.ui.getCore().getModel('label');
// if (oModel !== undefined) {
// var aData = oModel.getProperty("/concept_id");
// alert(aData);
......
......@@ -49,7 +49,7 @@ sap.ui.jsview("conceptmapper.conceptDetailPage", {
attributes : [
new sap.m.ObjectAttribute({
title : "concept_id",
text : "{label>/concept_id}",
text : "{conceptDetail>/concept_id}",
active : true,
press : function() {
alert("you press me");
......
......@@ -7,40 +7,75 @@ sap.ui.controller("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
// 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 oModel = new sap.ui.model.json.JSONModel(oData1);
// sap.ui.getCore().setModel(oModel, "concept");
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 = {
......@@ -99,30 +134,30 @@ sap.ui.controller("conceptmapper.searchPage", {
goToConceptDetail : function (oEvt) {
var URL_concept = "http://127.0.0.1:5000/concept/";
var sVal = oEvt.getParameters().rowBindingContext.getProperty('concept_id');
if (sVal !== undefined) {
var oData = {
"concept_id": sVal,
// "concept_name": oEvt.getParameters().rowBindingContext.getProperty('concept_name'),
// "concept_code": oEvt.getParameters().rowBindingContext.getProperty('concept_code'),
// "concept_class_id": oEvt.getParameters().rowBindingContext.getProperty('concept_class_id'),
// "vocabulary_id": oEvt.getParameters().rowBindingContext.getProperty('vocabulary_id'),
// "domain_id": oEvt.getParameters().rowBindingContext.getProperty('domain_id'),
// "validity": oEvt.getParameters().rowBindingContext.getProperty('validity'),
// "standard_concept": oEvt.getParameters().rowBindingContext.getProperty('standard_concept'),
// "relations": oEvt.getParameters().rowBindingContext.getProperty('relations'),
};
sap.ui.getCore().setModel(new sap.ui.model.json.JSONModel(oData), "label");
}
this.getView().addEventDelegate({
onBeforeHide: function(event) {
var targetView = event.to;
var dataToPass = /*...*/
targetView.data("data", dataToPass);
}
}, this);
app.to('idConceptDetailPage', 'slide', {concept_id: oEvt.getParameters().rowBindingContext.getProperty('concept_id')}); //('fade', 'flip', 'show', 'slide =default')
$.ajax({
type:"GET",
url: URL_concept + sVal,
dataType:"json",
async: false,
header: {
"Content-Type": "application/json",
},
success: function(oData, response, xhr) {
var oModel = new sap.ui.model.json.JSONModel(oData);
sap.ui.getCore().setModel(oModel, "conceptDetail");
console.log("connection");
},
error : function(error) {
alert("pb in the connection");
console.log(error);
}
})}
app.to('idConceptDetailPage', 'slide'); //('fade', 'flip', 'show', 'slide =default')
},
......@@ -478,7 +513,19 @@ sap.ui.controller("conceptmapper.searchPage", {
},
searcher : function (oEvt) {
var URL_concepts = "http://127.0.0.1:5000/concepts/";
var URL_concepts = "http://127.0.0.1:5000/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 = [];
......@@ -501,39 +548,35 @@ sap.ui.controller("conceptmapper.searchPage", {
var oData = {};
oData.search_string = sap.ui.getCore().byId('searchField').getProperty('value');
// standard => 'S' , classification concept => 'C', Null
oData.standard_concepts = sap.ui.getCore().byId('oStandardConcepts').getProperty('selected');
// valid => null, supprimer => 'D', updated => 'U'
var valid_concepts;
if (sap.ui.getCore().byId('oValidConcepts').getProperty('selected')) {
invalid_concepts = 'V';
} else {
invalid_concepts = 'U';
}
oData.invalid_reason = invalid_concepts;
oData.mini = sap.ui.getCore().byId('oMiniIB').getProperty('value');
oData.maxi = sap.ui.getCore().byId('oMaxiIB').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;
// oData.language_id = oLangMCB_list;
// oData.user_id = [];
// oData.frequency_id = [];
//oData.limit = -1;
console.log(oData),
$.ajax({
type:"GET",
url:URL_concepts,
dataType:"json",
data: oData,
data: {"json" : JSON.stringify(oData)},
async: false,
//processData: false,
header: {
"Content-Type": "application/json",
},
success: function(oData, response, xhr) {
var oModel = new sap.ui.model.json.JSONModel(oData);
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");
},
......
......@@ -50,6 +50,7 @@ sap.ui.jsview("conceptmapper.searchPage", {
search : [ oController.searcher, oController ],
}) ]
}),
visibleRowCount: 15,
cellClick : [ oController.goToConceptDetail, oController ]
});
......@@ -190,6 +191,47 @@ sap.ui.jsview("conceptmapper.searchPage", {
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}",
......@@ -280,7 +322,7 @@ sap.ui.jsview("conceptmapper.searchPage", {
navButtonPress : function(oEvt) {
app.back();
},
content : [ oStandardCB, oValidCB, oDomainMCB, oVocMCB, oMiniIB,
content : [ oValidMCB, oStandardMCB, oDomainMCB, oVocMCB, oMiniIB,
oMaxiIB, oLangMCB ]
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment