Skip to content

Commit

Permalink
Merge branch 'feature/prognosis-game' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
HeitorMatt committed Jul 21, 2021
2 parents 5db85f6 + 795607a commit f4f6d3f
Show file tree
Hide file tree
Showing 11 changed files with 4,658 additions and 4,324 deletions.
8 changes: 4 additions & 4 deletions src/adonisjs/public/dccs/components/web/dcc-rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ class DCCRest extends DCCBase {
async restRequest(method, parameters) {
// console.log('============ rest method')
// console.log(method)
console.log('=== service request')
console.log(method)
console.log(parameters)
// console.log('=== service request')
// console.log(method)
// console.log(parameters)
let result = null

if (this._setup.environment)
Expand All @@ -49,7 +49,7 @@ class DCCRest extends DCCBase {

if (this._setup != null && this._setup.oas != null &&
this._setup.oas.paths != null) {
console.log('--- inside request')
// console.log('--- inside request')
const paths = Object.keys(this._setup.oas.paths)
if (paths.length > 0) {
let url = paths[0]
Expand Down
18 changes: 11 additions & 7 deletions src/adonisjs/public/infra/bus.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ class MessageBus {
}

async publish (topic, message) {
for (const l in this._listeners) {
if (this.matchTopic(l, topic)) { this._listeners[l].callback(topic, message) }
let listeners = this._listeners.slice()
for (const l in listeners) {
if (this.matchTopic(listeners[l], topic))
listeners[l].callback(topic, message)
}

if (this._externalized) {
Expand Down Expand Up @@ -103,16 +105,18 @@ class MessageBus {
/* Checks if this topic has a subscriber */
hasSubscriber (topic) {
let hasSub = false
for (let l = 0; !hasSub && l < this._listeners.length; l++) { hasSub = this.matchTopic(l, topic) }
let listeners = this._listeners.slice()
for (let l = 0; !hasSub && l < listeners.length; l++) {
hasSub = this.matchTopic(listeners[l], topic) }
return hasSub
}

matchTopic (index, topic) {
matchTopic (listener, topic) {
let matched = false
if (this._listeners[index].regexp) {
const matchStr = this._listeners[index].regexp.exec(topic)
if (listener.regexp) {
const matchStr = listener.regexp.exec(topic)
if (matchStr != null && matchStr[0] === topic) { matched = true }
} else if (this._listeners[index].topic === topic) { matched = true }
} else if (listener.topic === topic) { matched = true }
return matched
}

Expand Down
2 changes: 1 addition & 1 deletion src/adonisjs/public/infra/simple-page-tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class PageController {
})
MessageBus.int.subscribe('control/dhtml/ready', this.removeLoadingIcon)
MessageBus.ext.subscribe('control/case/ready', this.removeLoadingIcon)
MessageBus.ext.subscribe('control/validate/ready', this.removeLoadingIcon)
MessageBus.int.subscribe('control/validate/ready', this.removeLoadingIcon)
MessageBus.int.subscribe('control/html/ready', this.pageReady)
}
async pageReady(){
Expand Down
3 changes: 1 addition & 2 deletions src/adonisjs/public/infra/token-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class TokenController {
} catch (e) {
// console.log(e)
}
MessageBus.ext.publish('control/validate/ready')
MessageBus.int.publish('control/validate/ready')
}else{
setTimeout(function(){
TokenController.instance.changeHeaderButtons(response)
Expand All @@ -91,7 +91,6 @@ class TokenController {
// // console.log(e)
// }
// console.log('============')
// MessageBus.ext.publish('control/validate/ready')
});*/
}
}
Expand Down
20 changes: 2 additions & 18 deletions src/adonisjs/public/prognosis/calculator/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,44 +145,28 @@ <h5 class="">Saps-3 Score</h5>
<dcc-include src="/author/partials/header.html"></dcc-include>
<main role="">
<div id="main-panel" class="d-flex flex-column vh-100 vw-100 scroll-y index-boot-padding bg-secondary">
<div class="d-flex flex-column w-lg-75 h-100 w-100 px-2 pb-4 bg-dark mx-auto scroll-y">
<div class="d-flex main-scroll flex-column w-lg-75 h-100 w-100 px-2 pb-4 bg-dark mx-auto scroll-y">
<h1 class="border-top border-bottom rounded txt-light my-5 text-center">SAPS-3 Score Calculador</h1>
<form action="javascript:void(0);">
<div class="bg-light border rounded m-1 p-2" id="idade-wrapper">
<h2 class="border-bottom txt-light text-center">Idade</h2>
<div class="form-row">

<div class="input-group mb-2">
<div class="input-group-prepend">
<label class="input-group-text" for="idade-1">Idade</label>
</div>

</div>
</div>
</div>
<div class="bg-light border rounded m-1 p-2" id="origem-wrapper">
<h2 class="border-bottom txt-light text-center">Origem</h2>
<div class="input-group mb-2">
<div class="input-group-prepend">
<label class="input-group-text" for="origem-1">Origem</label>
</div>
</div>
</div>
<div class="bg-light border rounded m-1 p-2" id="comorbidade-wrapper">
<h2 class="border-bottom txt-light text-center">Comorbidade</h2>

</div>
<div class="bg-light border rounded m-1 p-2" id="motivo-admissao-wrapper">
<h2 class="border-bottom txt-light text-center">Contexto da admissão</h2>

</div>
<div class="bg-light border rounded m-1 p-2" id="status-clinico-wrapper">
<h2 class="border-bottom txt-light text-center">Status clínico</h2>
</div>
<div class="bg-light border rounded m-1 p-2" id="alt-lab-wrapper">
<h2 class="border-bottom txt-light text-center">Alterações laboratoriais</h2>
</div>
<button type="submit" name="btn-create-pacient" class="btn btn-success w-100" onclick="Saps.i.calcSaps3Score(this.form)"> Create pacient</button>
<button type="submit" name="btn-create-pacient" class="btn btn-success w-100" onclick="Saps.i.calcSaps3Score(this.form)">Calculate</button>
</form>
<div class="p-2">

Expand Down
Loading

0 comments on commit f4f6d3f

Please sign in to comment.