Commit b544e049 authored by jcorvi's avatar jcorvi
Browse files

Merge branch 'draft_version_2' into 'draft_version'

Draft version 2

See merge request !12
parents b5156cc9 27bce497
Pipeline #25779 passed with stage
in 1 minute and 2 seconds
......@@ -522,6 +522,15 @@ export class DocumentDetailComponent implements OnInit {
//alert(text);
});
}
setSRFindingValidation(data) {
const id = +this.route.snapshot.paramMap.get('id');
//alert(data.status);
this.documentService.setSRFindingValidation(id, data.srDomainId, data.status)
.subscribe(text => {
//alert(text);
});
}
setNextStatus(status){
if(status=='DRAFT'){
......@@ -560,7 +569,7 @@ export class DocumentDetailComponent implements OnInit {
onActivate(componentReference) {
console.log(componentReference)
componentReference.activation(this.document);
// if(componentReference.constructor.name=='PretoxsentencesTabulatorComponent'){
......@@ -576,11 +585,11 @@ export class DocumentDetailComponent implements OnInit {
//alert('rowClickEventFinding');
this.rowClickFindingEvidence(data);
})
}
}
//Below will subscribe to the searchItem emitter
if(componentReference.rowClickEvent!=undefined){
alert('sentence activation');
//alert('sentence activation');
this.getSentencesEvidence();
componentReference.rowClickEvent.subscribe((data) => {
//alert('rowClickEvent');
......@@ -588,6 +597,14 @@ export class DocumentDetailComponent implements OnInit {
})
}
//Below will subscribe to the searchItem emitter
if(componentReference.rowClickSRFindingValidationEvent!=undefined){
componentReference.rowClickSRFindingValidationEvent.subscribe((data) => {
//alert('rowClickFindingValidationEvent');
this.setSRFindingValidation(data);
})
}
//Below will subscribe to the searchItem emitter
if(componentReference.rowClickFindingValidationEvent!=undefined){
......@@ -597,10 +614,14 @@ export class DocumentDetailComponent implements OnInit {
})
}
if(componentReference.srFindingType!=undefined){
this.getAllEvidence();
}
//Below will subscribe to the searchItem emitter
if(componentReference.rowClickEventSRDomainTemplateEvidence!=undefined){
alert('sr-domain activation');
this.getAllEvidence();
//alert('sr-domain activation');
//this.getAllEvidence();
componentReference.rowClickEventSRDomainTemplateEvidence.subscribe((data) => {
//alert('rowClickSRDomainTemplateEvidence');
this.rowClickSRDomainTemplateEvidence(data);
......
......@@ -82,6 +82,15 @@ export class DocumentService {
);
}
/** set validation of finding */
setSRFindingValidation(id: number, srfindingId: number, finding_validation: string): Observable<string> {
const url = `${this.documentsUrl}${id}/srFindingValidation/${srfindingId}/${finding_validation}`;
return this.http.get(url , {responseType: 'text'}).pipe(
tap(_ => this.log(`finding_validation id=${srfindingId}`)),
catchError(this.handleError<string>(`finding_validation id=${srfindingId}`))
);
}
/** set export finding */
setExportSRDomain(id: number, findingId: number, export_finding: string): Observable<string> {
const url = `${this.documentsUrl}${id}/setExportSRDomain/${findingId}/${export_finding}`;
......
......@@ -36,4 +36,5 @@ export class SRDomainFinding {
export:String;
srDomainId:number;
findingId:number;
status: string;
}
......@@ -22,6 +22,9 @@ export class SrdomaintemplateTabulatorComponent implements OnInit {
@Output() rowClickEventSRDomainTemplateEvidence = new EventEmitter();
@Output() rowClickExportSRDomainEvent = new EventEmitter();
@Output() rowClickSRFindingValidationEvent = new EventEmitter();
@Output() srFindingType = new EventEmitter();
tab = document.createElement('div');
constructor(private route: ActivatedRoute, private documentService: DocumentService) { }
......@@ -41,32 +44,7 @@ export class SrdomaintemplateTabulatorComponent implements OnInit {
this.document = document;
//var data = [];
var data_relevant_sentences = [];
// document.findings.forEach(find => {
// data.push({
// id : find.findingId,
// finding: find.finding != null ? find.finding.value : '',
// study_testcd: find.study_testcd != null ? find.study_testcd.value : '',
// manifestation_finding: find.manifestation_finding != null ? find.manifestation_finding.value : '',
// study_domain: find.study_domain != null ? find.study_domain.value : '',
// specimen: find.specimen != null ? find.specimen.value : '',
// sex: find.sex != null ? find.sex.value : '',
// dose: find.dose != null ? find.dose.value : '',
// group: find.group != null ? find.group.value : '',
// is_trf: find.is_treatment_related != null ? find.is_treatment_related.value : ''
// });
// });
//this.tableData = data;
//this.clear();
//alert(JSON.stringify(document.findings));
//var j = JSON.parse('{ text:' + document.text + '}');
// var j = { text: document.text };
// head.ready( function() {
// const dispatcher = Util.embed('data1' , DocumentDetailComponent.collData, j, DocumentDetailComponent.webFontURLs);
// dispatcher.on('displaySpanComment', displaySpanComment);
// dispatcher.on('hideComment', hideComment);
// });
var srDomainFindingsGlobal = [];
......@@ -112,6 +90,7 @@ export class SrdomaintemplateTabulatorComponent implements OnInit {
srcomnt : srDomainFinding.srsigf,
export: srDomainFinding.export,
status: srDomainFinding.status,
srDomainId: srDomainFinding.srDomainId,
findingId: srDomainFinding.findingId,
......@@ -185,7 +164,34 @@ export class SrdomaintemplateTabulatorComponent implements OnInit {
// return '<i class="fa fa-edit" style="color:blue" aria-hidden="true"> </i>';
// }},
//{ formatter: 'responsiveCollapse'},
{title: 'EXPORT', hozAlign: 'center', headerSort: false,
{title: 'Validate', width: 5, hozAlign: 'center', headerSort: false,
cellClick: function(e, cell){
//cell.getRow().getElement().style.backgroundColor = "#e2fcad"; //apply css change to row element
var data = cell.getRow().getData();
if (data.status=="accepted"){
data.status="rejected";
cell.getElement().innerHTML='<i class="fa fa-times" style="color:red" aria-hidden="true" title="Rejected"> </i>';
}else if(data.status=="rejected"){
data.status="non_curated";
cell.getElement().innerHTML='<i class="fa fa-square" style="color:grey" aria-hidden="true" title="Waiting for curation"> </i>';
}else{
data.status="accepted";
cell.getElement().innerHTML='<i class="fa fa-check" style="color:green" aria-hidden="true" title="Accepted"> </i>';
}
pretoxSRDomainTemplateTab.rowClickSRFindingValidationEvent.emit(data);
},
formatter: function(cell, formatterParams, onRendered){
var data = cell.getRow().getData();
if (data.status=="accepted"){
return '<i class="fa fa-check" style="color:green" aria-hidden="true" title="Accept Evidence"> </i>';
}else if(data.status=="rejected"){
return '<i class="fa fa-times" style="color:red" aria-hidden="true" title="Reject Evidence"> </i>';
} else {
return '<i class="fa fa-square" style="color:grey" aria-hidden="true" title="This finding will not be exported"> </i>';
}
}},
{title: 'Export', hozAlign: 'center', headerSort: false,
cellClick: function(e, cell){
//alert(1);
var data = cell.getRow().getData();
......
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