Commits (3)
......@@ -2014,20 +2014,6 @@
"webpack": "^4.0.0"
}
},
"@vue/cli-plugin-eslint": {
"version": "4.5.13",
"resolved": "https://registry.npmjs.org/@vue/cli-plugin-eslint/-/cli-plugin-eslint-4.5.13.tgz",
"integrity": "sha512-yc2uXX6aBiy3vEf5TwaueaDqQbdIXIhk0x0KzEtpPo23jBdLkpOSoU5NCgE06g/ZiGAcettpmBSv73Hfp4wHEw==",
"dev": true,
"requires": {
"@vue/cli-shared-utils": "^4.5.13",
"eslint-loader": "^2.2.1",
"globby": "^9.2.0",
"inquirer": "^7.1.0",
"webpack": "^4.0.0",
"yorkie": "^2.0.0"
}
},
"@vue/cli-plugin-router": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@vue/cli-plugin-router/-/cli-plugin-router-4.3.1.tgz",
......@@ -3874,12 +3860,6 @@
"integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==",
"dev": true
},
"ci-info": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz",
"integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==",
"dev": true
},
"cipher-base": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz",
......@@ -5158,9 +5138,9 @@
}
},
"crypto-js": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.0.0.tgz",
"integrity": "sha512-bzHZN8Pn+gS7DQA6n+iUmBfl0hO5DJq++QP3U6uTucDtk/0iGpXd/Gg7CGR0p8tJhofJyaKoWBuJI4eAO00BBg=="
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz",
"integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw=="
},
"crypto-random-string": {
"version": "2.0.0",
......@@ -6573,19 +6553,6 @@
}
}
},
"eslint-loader": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/eslint-loader/-/eslint-loader-2.2.1.tgz",
"integrity": "sha512-RLgV9hoCVsMLvOxCuNjdqOrUqIj9oJg8hF44vzJaYqsAHuY9G2YAeN3joQ9nxP0p5Th9iFSIpKo+SD8KISxXRg==",
"dev": true,
"requires": {
"loader-fs-cache": "^1.0.0",
"loader-utils": "^1.0.2",
"object-assign": "^4.0.1",
"object-hash": "^1.1.4",
"rimraf": "^2.6.1"
}
},
"eslint-module-utils": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.1.tgz",
......@@ -8975,15 +8942,6 @@
"integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==",
"dev": true
},
"is-ci": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz",
"integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==",
"dev": true,
"requires": {
"ci-info": "^1.5.0"
}
},
"is-color-stop": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-color-stop/-/is-color-stop-1.1.0.tgz",
......@@ -9581,57 +9539,6 @@
}
}
},
"loader-fs-cache": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/loader-fs-cache/-/loader-fs-cache-1.0.3.tgz",
"integrity": "sha512-ldcgZpjNJj71n+2Mf6yetz+c9bM4xpKtNds4LbqXzU/PTdeAX0g3ytnU1AJMEcTk2Lex4Smpe3Q/eCTsvUBxbA==",
"dev": true,
"requires": {
"find-cache-dir": "^0.1.1",
"mkdirp": "^0.5.1"
},
"dependencies": {
"find-cache-dir": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz",
"integrity": "sha1-yN765XyKUqinhPnjHFfHQumToLk=",
"dev": true,
"requires": {
"commondir": "^1.0.1",
"mkdirp": "^0.5.1",
"pkg-dir": "^1.0.0"
}
},
"find-up": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
"integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
"dev": true,
"requires": {
"path-exists": "^2.0.0",
"pinkie-promise": "^2.0.0"
}
},
"path-exists": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
"integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
"dev": true,
"requires": {
"pinkie-promise": "^2.0.0"
}
},
"pkg-dir": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz",
"integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=",
"dev": true,
"requires": {
"find-up": "^1.0.0"
}
}
}
},
"loader-runner": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz",
......@@ -10827,12 +10734,6 @@
}
}
},
"object-hash": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz",
"integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA==",
"dev": true
},
"object-inspect": {
"version": "1.10.3",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.3.tgz",
......@@ -14488,12 +14389,6 @@
"integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
"dev": true
},
"strip-indent": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz",
"integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=",
"dev": true
},
"strip-json-comments": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
......@@ -17133,74 +17028,6 @@
"integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
"dev": true
},
"yorkie": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/yorkie/-/yorkie-2.0.0.tgz",
"integrity": "sha512-jcKpkthap6x63MB4TxwCyuIGkV0oYP/YRyuQU5UO0Yz/E/ZAu+653/uov+phdmO54n6BcvFRyyt0RRrWdN2mpw==",
"dev": true,
"requires": {
"execa": "^0.8.0",
"is-ci": "^1.0.10",
"normalize-path": "^1.0.0",
"strip-indent": "^2.0.0"
},
"dependencies": {
"cross-spawn": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
"integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
"dev": true,
"requires": {
"lru-cache": "^4.0.1",
"shebang-command": "^1.2.0",
"which": "^1.2.9"
}
},
"execa": {
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-0.8.0.tgz",
"integrity": "sha1-2NdrvBtVIX7RkP1t1J08d07PyNo=",
"dev": true,
"requires": {
"cross-spawn": "^5.0.1",
"get-stream": "^3.0.0",
"is-stream": "^1.1.0",
"npm-run-path": "^2.0.0",
"p-finally": "^1.0.0",
"signal-exit": "^3.0.0",
"strip-eof": "^1.0.0"
}
},
"get-stream": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
"integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=",
"dev": true
},
"lru-cache": {
"version": "4.1.5",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz",
"integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==",
"dev": true,
"requires": {
"pseudomap": "^1.0.2",
"yallist": "^2.1.2"
}
},
"normalize-path": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-1.0.0.tgz",
"integrity": "sha1-MtDkcvkf80VwHBWoMRAY07CpA3k=",
"dev": true
},
"yallist": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
"integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=",
"dev": true
}
}
},
"zip-stream": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-3.0.1.tgz",
......
import axios from 'axios'
import store from '@/store'
import { REQUEST_DIR } from '../utils/constants'
import {
requestData,
requestDataFormUrlEncoded,
} from './requestHeadersHelper'
export async function getCenters (filters) {
const url = `${REQUEST_DIR}centros`
const response = await axios.get(url, requestData(filters))
const data = response.data.centros
store.commit('setCenters', data)
export async function getCenters (page = 1) {
const url = `${REQUEST_DIR}centros?page=${page}`
const response = await axios.get(url, requestData())
return response
}
......
......@@ -24,7 +24,7 @@ export async function getSystemStatus () {
return response
}
export async function getHealthStatus () {
const url = `${REQUEST_DIR}nomenclador/salud`
const url = `${REQUEST_DIR}nomenclador/estado`
const response = await axios.get(url, requestData())
const health = response.data
store.commit('setHealthStatuses', health)
......@@ -45,7 +45,7 @@ export async function getMunicipalities (id = 6) {
return response
}
export async function getClasifications () {
const url = `${REQUEST_DIR}nomenclador/riesgo-categoria`
const url = `${REQUEST_DIR}nomenclador/clasificacion`
const response = await axios.get(url, requestData())
const clasifications = response.data
store.commit('setClasifications', clasifications)
......
import axios from 'axios'
import { REQUEST_DIR } from '../utils/constants'
import { requestData, requestDataFormUrlEncoded } from './requestHeadersHelper'
import queryString from 'query-string'
export async function getPatients (filters) {
const url = `${REQUEST_DIR}pacientes`
const response = await axios.get(url, requestData(filters))
export async function getPatients (page = 1) {
const url = `${REQUEST_DIR}pacientes?page=${page}`
const response = await axios.get(url, requestData())
return response
}
......@@ -31,19 +32,3 @@ export async function putPatient (data) {
const response = await axios.put(url, data, requestDataFormUrlEncoded())
return response
}
export async function assignatePatient (idCenter, idPatient) {
const url = `${REQUEST_DIR}asignar-pacientes`
const data = {
id_centro: idCenter,
id_paciente: idPatient,
}
const response = await axios.post(url, data, requestDataFormUrlEncoded())
return response
}
export async function admitPatient (idPatient) {
const url = `${REQUEST_DIR}pacientes`
const response = await axios.post(url, idPatient, requestDataFormUrlEncoded())
return response
}
import { AGENT } from '@/utils/constants'
import { decrypt } from '../utils/enc'
export function requestData (filters) {
export function requestData () {
return {
params: filters,
headers: {
// Authorization: 'Bearer ' + localStorage.getItem('tkn'),
'Content-Type': 'application/json',
......@@ -14,9 +14,8 @@ export function requestData (filters) {
}
}
export function requestDataFormUrlEncoded (filters) {
export function requestDataFormUrlEncoded () {
return {
params: filters,
headers: {
// Authorization: 'Bearer ' + localStorage.getItem('tkn'),
'Content-Type': 'application/json',
......
......@@ -135,7 +135,6 @@
<v-row no-gutters>
<v-spacer />
<v-btn
text
color="info"
:loading="loading"
@click="sendFilter"
......
......@@ -124,7 +124,7 @@
sm="5"
md="10"
>
{{ healthArea }}
{{ patient.area_salud }}
</v-col>
<v-col
cols="12"
......@@ -383,13 +383,11 @@
<v-card-actions>
<v-spacer />
<v-btn
v-if="editable"
color="orange darken-1"
color="blue darken-1"
text
@click="sendEdit"
@click="sendClose"
>
<v-icon>mdi-pencil</v-icon>
Editar
OK
</v-btn>
<v-spacer v-if="!verified" />
<v-btn
......@@ -398,7 +396,6 @@
text
@click="dataVerified"
>
<v-icon>mdi-account-check</v-icon>
Verificar
</v-btn>
<v-spacer />
......@@ -415,10 +412,8 @@
</template>
<script>
import { getMunicipalities, getHealthAreas } from '@/axios/nomenclators'
export default {
name: 'PatientFile',
props: {
patient: {
type: Object,
......@@ -426,32 +421,18 @@
},
},
data: () => ({
editable: true,
verified: false,
formTitle: 'Datos del Paciente',
healthAreas: [],
healthArea: null,
municipality: null,
}),
computed: {
estadoSistema () {
const ststus = this.systemStatuses
const pepe = this.systemStatuses
let ok = null
ststus.forEach(element => {
pepe.forEach(element => {
if (element.id === this.patient.estado_sistema) {
ok = element.nombre
}
})
return ok
},
province () {
const prov = this.provinces
let ok = null
prov.forEach(element => {
if (element.id === this.patient.provincia) {
ok = element.nombre
}
})
console.log(ok)
return ok
},
noApp () {
......@@ -469,62 +450,11 @@
systemStatuses () {
return this.$store.getters.systemStatuses
},
provinces () {
return this.$store.getters.provinces
},
municipalities () {
return this.$store.getters.municipalities
},
},
async created () {
const hResponse = await getHealthAreas(this.patient.municipio)
this.healthAreas = hResponse.data
await getMunicipalities(this.patient.provincia)
const munic = this.municipalities
let ok = null
munic.forEach(element => {
if (element.id === this.patient.municipio) {
ok = element.nombre
}
})
this.municipality = ok
let hItem = null
const hh = this.healthAreas
hh.forEach(element => {
if (element.id === this.patient.area_salud) {
hItem = element.nombre
}
})
this.healthArea = hItem
},
methods: {
async getHealthAreasData () {
try {
const hResponse = await getHealthAreas(this.patient.municipio)
this.healthAreas = hResponse.data
} catch (e) {
this.$toast.error(e.toString(), {
position: 'bottom-center',
timeout: 5000,
closeOnClick: true,
pauseOnFocusLoss: false,
pauseOnHover: true,
draggable: true,
draggablePercent: 0.6,
showCloseButtonOnHover: false,
hideProgressBar: true,
closeButton: 'button',
icon: true,
rtl: false,
})
}
},
sendClose () {
this.$emit('close-click')
},
sendEdit () {
this.$emit('edit-click')
},
dataVerified () {
// TODO: Cambiar el estado de los datos del paciente
this.$toast.success('Usted ha verificado los datos satisfactoriamente', {
......
......@@ -693,7 +693,7 @@
label="Test Antígeno"
/>
</v-col>
<!-- <v-col
<v-col
cols="12"
sm="6"
md="4"
......@@ -706,7 +706,7 @@
item-value="id"
label="Estado en el sistema"
/>
</v-col> -->
</v-col>
<v-col
cols="12"
sm="6"
......@@ -788,7 +788,7 @@
<v-card-actions>
<v-spacer />
<v-btn
color="red darken-1"
color="blue darken-1"
text
@click="close"
>
......
<template>
<v-data-table
v-model="selected"
:headers="headers"
:items="desserts"
:single-select="singleSelect"
item-key="name"
show-select
class="elevation-1"
>
<template v-slot:top>
<v-switch
v-model="singleSelect"
label="Single select"
class="pa-3"
></v-switch>
</template>
</v-data-table>
</template>
<script>
export default {
data () {
return {
singleSelect: false,
selected: [],
headers: [
{
text: 'Dessert (100g serving)',
align: 'start',
sortable: false,
value: 'name',
},
{ text: 'Calories', value: 'calories' },
{ text: 'Fat (g)', value: 'fat' },
{ text: 'Carbs (g)', value: 'carbs' },
{ text: 'Protein (g)', value: 'protein' },
{ text: 'Iron (%)', value: 'iron' },
],
desserts: [
{
name: 'Frozen Yogurt',
calories: 159,
fat: 6.0,
carbs: 24,
protein: 4.0,
iron: '1%',
},
{
name: 'Ice cream sandwich',
calories: 237,
fat: 9.0,
carbs: 37,
protein: 4.3,
iron: '1%',
},
{
name: 'Eclair',
calories: 262,
fat: 16.0,
carbs: 23,
protein: 6.0,
iron: '7%',
},
{
name: 'Cupcake',
calories: 305,
fat: 3.7,
carbs: 67,
protein: 4.3,
iron: '8%',
},
{
name: 'Gingerbread',
calories: 356,
fat: 16.0,
carbs: 49,
protein: 3.9,
iron: '16%',
},
{
name: 'Jelly bean',
calories: 375,
fat: 0.0,
carbs: 94,
protein: 0.0,
iron: '0%',
},
{
name: 'Lollipop',
calories: 392,
fat: 0.2,
carbs: 98,
protein: 0,
iron: '2%',
},
{
name: 'Honeycomb',
calories: 408,
fat: 3.2,
carbs: 87,
protein: 6.5,
iron: '45%',
},
{
name: 'Donut',
calories: 452,
fat: 25.0,
carbs: 51,
protein: 4.9,
iron: '22%',
},
{
name: 'KitKat',
calories: 518,
fat: 26.0,
carbs: 65,
protein: 7,
iron: '6%',
},
],
}
},
}
</script>
\ No newline at end of file
......@@ -8,6 +8,28 @@
height="80"
>
<v-spacer />
<!-- <div>
<v-tabs
class="hidden-sm-and-down"
optional
>
<v-tab
v-for="(name, i) in items"
:key="i"
:to="{ name }"
:exact="name === 'Home'"
:ripple="false"
active-class="text--primary"
class="font-weight-bold"
min-width="96"
text
>
{{ name }}
</v-tab>
</v-tabs>
</div> -->
<v-app-bar-nav-icon
@click="showHideDrawer"
/>
......@@ -81,6 +103,11 @@
</v-list>
</v-menu>
</v-app-bar>
<!-- <home-drawer
v-model="drawer"
:items="items"
/> -->
</div>
</template>
......@@ -88,6 +115,10 @@
export default {
name: 'HomeAppBar',
/* components: {
HomeDrawer: () => import('./Drawer'),
}, */
data: () => ({
globalActions: [
{ link: 'lol', title: 'pepe', icon: 'mdi-account' },
......
......@@ -11,18 +11,22 @@ import 'vue-toastification/dist/index.css'
import axios from 'axios'
import api from '@/utils/api'
import { encrypt } from './utils/enc'
import MultiFiltersPlugin from '@/plugins/MultiFilters'
Vue.use(Vuex)
Vue.config.productionTip = false
Vue.use(Vuebar)
Vue.use(MultiFiltersPlugin)
Vue.prototype.$axios = api
/* if (process.env.NODE_ENV === 'development') {
if (process.env.NODE_ENV === 'development') {
const { worker } = require('./mocks/browser')
worker.start()
} */
}
Vue.use(Toast, {
transition: 'Vue-Toastification__bounce',
maxToasts: 20,
......
......@@ -13,6 +13,7 @@ export default [
organismo: 'MINED',
created_at: '2021-07-06 21:45:51',
updated_at: '2021-07-06 21:45:51',
categoria: 1,
},
{
id_centro: 2,
......@@ -21,6 +22,7 @@ export default [
organismo: 'MES',
created_at: '2021-07-06 21:45:51',
updated_at: '2021-07-06 21:45:51',
categoria: 1,
},
{
id_centro: 3,
......@@ -29,7 +31,26 @@ export default [
organismo: 'MES',
created_at: '2021-07-06 21:45:51',
updated_at: '2021-07-06 21:45:51',
categoria: 2,
},
{
id_centro: 4,
nombre_centro: 'Some Site',
municipio: 'Santo Domingo',
organismo: 'CARACOL',
created_at: '2021-07-06 21:45:51',
updated_at: '2021-07-06 21:45:51',
categoria: 0,
},
{
id_centro: 5,
nombre_centro: 'Another Place',
municipio: 'Caibarien',
organismo: 'MINED',
created_at: '2021-07-06 21:45:51',
updated_at: '2021-07-06 21:45:51',
categoria: 0,
}
],
meta: {
current_page: 1,
......@@ -111,6 +132,52 @@ export default [
}),
)
}),
rest.get(REQUEST_DIR + 'nomenclador/clasificacion', (req, res, ctx) => {
return res(
ctx.json([
{
id: 1,
nombre: 'ALTO RIESGO',
},
{
id: 2,
nombre: 'RIESGO MEDIO',
},
{
id: 3,
nombre: 'RIESGO BAJO',
},
{
id: 0,
nombre: 'SOSPECHOSO',
},
],
),
)
}),
rest.get(REQUEST_DIR + 'nomenclador/categoria', (req, res, ctx) => {
return res(
ctx.json([
{
id: 1,
nombre: 'ALTO RIESGO',
},
{
id: 2,
nombre: 'RIESGO MEDIO',
},
{
id: 3,
nombre: 'RIESGO BAJO',
},
{
id: 0,
nombre: 'SOSPECHOSO',
},
],
),
)
}),
rest.post(REQUEST_DIR + 'centros/1/areas', (req, res, ctx) => {
return res(
ctx.json({
......@@ -165,18 +232,28 @@ export default [
ci: 92121234063,
nombre: 'Pepe',
apellidos: 'Glez Hdez',
categoria: 3,
},
{
id_paciente: '1',
id_paciente: '2',
ci: 92121234063,
nombre: 'Pepe',
apellidos: 'Glez Hdez',
categoria: 2,
},
{
id_paciente: '1',
id_paciente: '3',
ci: 92121234063,
nombre: 'Pepe',
apellidos: 'Glez Hdez',
categoria: 2,
},
{
id_paciente: '4',
ci: 92121234063,
nombre: 'Amancio',
apellidos: 'Perez Perez',
categoria: 0,
},
],
meta: {
......@@ -269,26 +346,25 @@ export default [
cmf: '20.31',
remite_caso: 'Policlinico',
hospital: null,
estado_salud: 1,
estado_salud: 'De cuidado',
provincia: 1,
municipio: 1,
categoria: 1,
area_salud: 1,
estado_sistema: '1',
trabajador_salud: false,
embarazada: false,
ninho: false,
categoria: 'Loco',
estado_sistema: 'Negativo_PCR',
trabajador_salud: 0,
embarazada: 0,
ninho: 0,
test_antigeno: 'Negativo',
vacunado: true,
vacunado: 1,
apps: {
id_app: 1,
id_paciente: 1,
hipertension: false,
diabetes: false,
asma: false,
obesidad: false,
insuficiencia_renal: false,
oncologia: false,
hipertension: 0,
diabetes: 0,
asma: 1,
obesidad: 0,
insuficiencia_renal: 0,
oncologia: 0,
otros: '',
created_at: '2021-07-15 20:12:20',
updated_at: '2021-07-15 20:12:20',
......@@ -297,14 +373,14 @@ export default [
id_sintomas: 1,
id_paciente: 1,
fecha_sintomas: null,
fiebre: false,
rinorrea: false,
congestion_nasal: false,
tos: false,
expectoracion: false,
dificultad_respiratoria: false,
cefalea: false,
dolor_garganta: false,
fiebre: 0,
rinorrea: 1,
congestion_nasal: 0,
tos: 0,
expectoracion: 0,
dificultad_respiratoria: 0,
cefalea: 0,
dolor_garganta: 0,
otros: '',
created_at: '2021-07-15 20:12:20',
updated_at: '2021-07-15 20:12:20',
......@@ -431,130 +507,4 @@ export default [
]),
),
),
rest.get(REQUEST_DIR + 'nomenclador/provincia', (req, res, ctx) =>
res(
ctx.json([
{
id: 1,
nombre: 'HABANA',
},
{
id: 2,
nombre: 'MATANZAS',
},
{
id: 3,
nombre: 'VILLA CLARA',
},
]),
),
),
rest.get(REQUEST_DIR + 'nomenclador/clasificacion', (req, res, ctx) =>
res(
ctx.json([
{
id: 1,
nombre: 'ALTO RIESGO',
},
{
id: 2,
nombre: 'MEDIANO RIESGO',
},
{
id: 3,
nombre: 'BAJO RIESGO',
},
]),
),
),
rest.get(REQUEST_DIR + 'nomenclador/sistema', (req, res, ctx) =>
res(
ctx.json([
{
id: 1,
nombre: 'ENCUESTADO',
},
{
id: 2,
nombre: 'PENDIENTE INGRESO',
},
{
id: 3,
nombre: 'INGRESADO',
},
]),
),
),
rest.get(REQUEST_DIR + 'nomenclador/estado', (req, res, ctx) =>
res(
ctx.json([
{
id: 1,
nombre: 'DE CUIDADO',
},
{
id: 2,
nombre: 'GRAVE',
},
{
id: 3,
nombre: 'ETC',
},
]),
),
),
rest.get(REQUEST_DIR + 'nomenclador/categoria', (req, res, ctx) =>
res(
ctx.json([
{
id: 1,
nombre: 'SOSPECHOSO',
},
{
id: 2,
nombre: 'POSITIVO',
},
{
id: 3,
nombre: 'CONTACTO',
},
]),
),
),
rest.get(REQUEST_DIR + 'nomenclador/municipio/1', (req, res, ctx) =>
res(
ctx.json([
{
id: 1,
nombre: 'Santa Clara',
},
{
id: 2,
nombre: 'Maniv=caragua',
},
{
id: 3,
nombre: 'Santo Domingo',
},
]),
),
),
rest.get(REQUEST_DIR + 'nomenclador/salud/1', (req, res, ctx) =>
res(
ctx.json([
{
id: 1,
nombre: 'Santa Clara',
},
{
id: 2,
nombre: 'XX Aniversario',
},
{
id: 3,
nombre: 'Maleza',
},
]),
),
),
]
/**
* Enabled v-data-table to have moire than one filter.
*/
class MultiFilters {
/**
* Constructor.
*
* @param items
* @param filters
* @param filter
* @param headers
*/
constructor(items, filters, filter, headers) {
this.items = items;
this.filter = filter;
this.headers = headers;
this.filters = filters;
this.filterCallbacks = {};
}
/**
* Updates filter values.
* @param filters filter´s object
* @param val JSON chunk to be updated.
* @returns {*}
*/
static updateFilters(filters, val) {
return Object.assign({}, filters, val);
}
/**
* Adds a new filter
* @param filterName The name of the filter from which the information will be extracted
* @param filterCallback The callback that will apply the filter.
*/
registerFilter(filterName, filterCallback) {
this.filterCallbacks[filterName] = filterCallback;
}
/**
* Run all filters.
* @returns {*}
*/
runFilters() {
const self = this;
let filteredItems = self.items;
Object.entries(this.filterCallbacks)
.forEach(([entity, cb]) => {
filteredItems = cb.call(self, self.filters[entity], filteredItems);
});
return filteredItems;
}
}
// Vue plugin.
const MultiFiltersPlugin = {
install(Vue, options) {
Vue.prototype.$MultiFilters = MultiFilters;
}
};
export default MultiFiltersPlugin;
......@@ -36,20 +36,28 @@ const router = new Router({
name: 'Control',
component: () => import('@/views/home/Index.vue'),
},
{
path: 'enter_patients',
name: 'IngresarPacientes',
component: () => import('@/views/patients/IngresarPacientes.vue'),
},
{
path: 'centers',
name: 'Centros',
component: () => import('@/views/about/Index.vue'),
meta: { src: require('@/assets/about.jpg') },
},
{
path: 'patients',
name: 'Pacientes',
component: () => import('@/views/contact-us/Index.vue'),
meta: { src: require('@/assets/contact.jpg') },
},
{
path: 'pro',
name: 'Directores',
component: () => import('@/views/pro/Index.vue'),
meta: { src: require('@/assets/pro.jpg') },
},
{
path: '*',
......
......@@ -3,10 +3,4 @@ export default {
systemStatuses: state => state.systemStatuses,
provinces: state => state.provinces,
municipalities: state => state.municipalities,
categories: state => state.categories,
centers: state => state.centers,
clasifications: state => state.clasifications,
antigens: state => state.antigens,
healthAreas: state => state.healthAreas,
healthStatuses: state => state.healthStatuses,
}
......@@ -12,22 +12,4 @@ export default {
setMunicipalities (state, data) {
state.municipalities = data
},
setCategories (state, data) {
state.categories = data
},
setCenters (state, data) {
state.centers = data
},
setClasifications (state, data) {
state.clasifications = data
},
setAntigens (state, data) {
state.antigens = data
},
setHealthAreas (state, data) {
state.healthAreas = data
},
setHealthStatuses (state, data) {
state.healthStatuses = data
},
}
......@@ -1459,5 +1459,3 @@ export const COUNTRIES = [{
},
]
export const DECRYPT_KEY = 'xFr#s1r%K2'
export const EXAMPLE_TOKEN = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjhkNDE2NzJiZGU2OWYzNDI4OWIxMzRkMjdkMmRiOWMyZjJmOGVhNWY4YmE2MTgzYzRiNTBlMzMwNWM3MjMwNjdjYTUxNmI0ZGVhZDhmNzhkIn0.eyJhdWQiOiIxIiwianRpIjoiOGQ0MTY3MmJkZTY5ZjM0Mjg5YjEzNGQyN2QyZGI5YzJmMmY4ZWE1ZjhiYTYxODNjNGI1MGUzMzA1YzcyMzA2N2NhNTE2YjRkZWFkOGY3OGQiLCJpYXQiOjE2MjY5MTcwNDMsIm5iZiI6MTYyNjkxNzA0MywiZXhwIjoxNjU4NDUzMDQzLCJzdWIiOiIyIiwic2NvcGVzIjpbXX0.y2pdg3uMY1NKTsMhFgifxDVcapAwzVPqNUUQNpj8M_0wqGb2qerdUtOfHSGpqhWpvcpBvEA377DwrtOKbsLyevHtY3WGcPO_zXxPDdKCiQ6Yw108ilgq_-FPAL3iCgnuZP_Zlxl00TvYeMqHM6tEo8RiHiC00fKauxLNEgW5wMww6L9dNcJjAeOmp8BpvyjSGb9en2ZldT7eUHcs8O6MEfgjYaUSneMFWuQxaa8lPBN_zATptW2HODkKGrqwT5ZvIEAFkJrO9s8XRznIlFCf1U3SMCA9_PVNtguzu6qqS9xja7Z31bJ_T-MgLDWRsU0_MCsnhTlCPwZZK8P6S-EoO9_do6dRxRcSIOGwtAa7X0wwZZXLVBMiWxwjDx7xxpBJD1l8uTG2xUgOaDH6zDYaBgzEKLUo1htbQBSAYnSAWTLG3FJembbg30sBNispW2TW6L1T-S4N1XH9WY6bg34_Yt02xSK8deoVFHNeEN40zaBt9AmPPKj9IjK7FwYp9X15DBOb4W4k5NWvkMFJXeNfTruZZjUi3IpwjzChEUAankN1kysSo1AFLz66ea3EQd4VUyisfU4NwcSG0N_iVvpm_RDjtslcfaxz5b9-sgRyCAR0CpaiGziFiiT76Pq-K8MqZlxMzG2GZwN9xoRQeraJ2aVU3rVSVlJOw1ukcQ8zwMg'
/* eslint-disabled */
<script>
// Extensions
import View from '@/views/View'
// Mixins
import LoadSections from '@/mixins/load-sections'
export default {
name: 'IngresarPacientes',
metaInfo: { title: 'Inicio de Sesión' },
extends: View,
mixins: [
LoadSections([
'IngresarPacientes',
]),
],
props: {
id: {
type: String,
default: 'enter_patients',
},
},
}
</script>
/* eslint-disable */
<template>
<div style="padding: 8px">
<div v-if="init">
<div
v-if="init"
>
<v-data-table
:headers="headers"
:items="centers"
......@@ -16,7 +19,9 @@
@pagination="paginateCenters"
>
<template v-slot:top>
<v-toolbar flat>
<v-toolbar
flat
>
<v-toolbar-title>Centros de aislamiento</v-toolbar-title>
<v-divider
class="mx-4"
......@@ -155,9 +160,7 @@
max-width="500px"
>
<v-card>
<v-card-title
class="text-h5"
>
<v-card-title class="text-h5">
Este Centro no se puede eliminar porque tiene camas en uso!!!!
</v-card-title>
<v-card-actions>
......@@ -228,16 +231,22 @@
</template>
</v-data-table>
</div>
<div v-else-if="area">
<div
v-else-if="area"
>
<v-card>
<v-btn
style="margin: 12px"
@click="init= true"
>
<v-icon>mdi-arrow-left</v-icon>Atras
<v-icon>
mdi-arrow-left
</v-icon> Atras
</v-btn>
<v-card-title>
<v-icon large>
<v-icon
large
>
mdi-hospital-building
</v-icon>
<v-card-title class="text-h5">
......@@ -267,7 +276,9 @@
@pagination="paginateAreas"
>
<template v-slot:top>
<v-toolbar flat>
<v-toolbar
flat
>
<v-toolbar-title>Areas</v-toolbar-title>
<v-divider
class="mx-4"
......@@ -380,9 +391,7 @@
max-width="500px"
>
<v-card>
<v-card-title
class="text-h5"
>
<v-card-title class="text-h5">
Esta Area no se puede eliminar porque tiene camas en uso!!!!
</v-card-title>
<v-card-actions>
......@@ -429,7 +438,7 @@
</template>
<span>Eliminar</span>
</v-tooltip>
<v-tooltip bottom>
<!-- <v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<v-icon
color="info"
......@@ -441,7 +450,7 @@
</v-icon>
</template>
<span>Detalles</span>
</v-tooltip>
</v-tooltip> -->
</template>
<template v-slot:no-data>
<v-btn
......@@ -455,16 +464,22 @@
</v-card-text>
</v-card>
</div>
<div v-else-if="room">
<div
v-else-if="room"
>
<v-card>
<v-btn
style="margin: 12px"
@click="area = true"
>
<v-icon>mdi-arrow-left</v-icon>Atras
<v-icon>
mdi-arrow-left
</v-icon> Atras
</v-btn>
<v-card-title>
<v-icon large>
<v-icon
large
>
mdi-hospital-building
</v-icon>
<v-card-title class="text-h5">
......@@ -475,8 +490,9 @@
<v-card-text>
<v-card>
<v-card-title>
<v-icon>mdi-domain</v-icon>
{{ editedAreaItem.nombre }}
<v-icon>
mdi-domain
</v-icon>{{ editedAreaItem.nombre }}
</v-card-title>
<v-card-subtitle>{{ editedAreaItem.categoria }}</v-card-subtitle>
<info-box
......@@ -493,7 +509,9 @@
class="elevation-1"
>
<template v-slot:top>
<v-toolbar flat>
<v-toolbar
flat
>
<v-toolbar-title>Habitaciones</v-toolbar-title>
<v-divider
class="mx-4"
......@@ -604,9 +622,7 @@
max-width="500px"
>
<v-card>
<v-card-title
class="text-h5"
>
<v-card-title class="text-h5">
Esta Habitacion no se puede eliminar porque tiene camas en uso!!!!
</v-card-title>
<v-card-actions>
......@@ -672,23 +688,9 @@
<script>
import InfoBox from '@/components/InfoBox.vue'
import {
getCenters,
postCenter,
putCenter,
deleteCenter,
} from '@/axios/centers'
import {
getAreas,
postArea,
putArea,
deleteArea,
} from '@/axios/areas'
import {
getMunicipalities,
getProvinces,
getCategories,
} from '@/axios/nomenclators'
import { getCenters, postCenter, putCenter, deleteCenter } from '@/axios/centers'
import { getAreas, postArea, putArea, deleteArea } from '@/axios/areas'
import { getMunicipalities, getProvinces } from '@/axios/nomenclators'
export default {
components: { InfoBox },
data: () => ({
......@@ -704,8 +706,76 @@
loadingCentersData: true,
totalCentersItems: 0,
totalAreasItems: 0,
myStats: [],
myAreaStats: [],
myStats: [
{
bgColor: 'success ligthen-1',
iconClass: 'blue lighten-3 white--text',
icon: 'mdi-bunk-bed-outline',
title: 'Camas Totales',
data: '450',
action: {
label: 'more',
link: '',
},
},
{
bgColor: 'success ligthen-1',
iconClass: 'blue lighten-3 white--text',
icon: 'mdi-bed',
title: 'Camas Usadas',
data: '200',
action: {
label: 'more',
link: '',
},
},
{
bgColor: 'success ligthen-1',
iconClass: 'blue lighten-3 white--text',
icon: 'mdi-bed-empty',
title: 'Camas Disponibles',
data: '250',
action: {
label: 'more',
link: '',
},
},
],
myAreaStats: [
{
bgColor: 'success ligthen-1',
iconClass: 'blue lighten-3 white--text',
icon: 'mdi-bunk-bed-outline',
title: 'Camas Totales',
data: '200',
action: {
label: 'more',
link: '',
},
},
{
bgColor: 'success ligthen-1',
iconClass: 'blue lighten-3 white--text',
icon: 'mdi-bed',
title: 'Camas Usadas',
data: '150',
action: {
label: 'more',
link: '',
},
},
{
bgColor: 'success ligthen-1',
iconClass: 'blue lighten-3 white--text',
icon: 'mdi-bed-empty',
title: 'Camas Disponibles',
data: '50',
action: {
label: 'more',
link: '',
},
},
],
area: false,
init: true,
room: false,
......@@ -809,9 +879,7 @@
return this.editedAreaIndex === -1 ? 'Nueva Area' : 'Editar Area'
},
roomsFormTitle () {
return this.editedRoomIndex === -1
? 'Nueva Habitación'
: 'Editar Habitación'
return this.editedRoomIndex === -1 ? 'Nueva Habitación' : 'Editar Habitación'
},
},
watch: {
......@@ -865,27 +933,6 @@
})
}
},
async getCategoriesData () {
try {
const categoriesResponse = await getCategories()
this.categories = categoriesResponse.data
} catch (e) {
this.$toast.error(e.toString(), {
position: 'bottom-center',
timeout: 5000,
closeOnClick: true,
pauseOnFocusLoss: false,
pauseOnHover: true,
draggable: true,
draggablePercent: 0.6,
showCloseButtonOnHover: false,
hideProgressBar: true,
closeButton: 'button',
icon: true,
rtl: false,
})
}
},
async getProvincesData () {
try {
const provincesResponse = await getProvinces()
......@@ -1066,20 +1113,6 @@
async deleteItemConfirm () {
try {
await deleteCenter(this.editedItem.id_centro)
this.$toast.success('Centro eliminado correctamente', {
position: 'bottom-center',
timeout: 5000,
closeOnClick: true,
pauseOnFocusLoss: false,
pauseOnHover: true,
draggable: true,
draggablePercent: 0.6,
showCloseButtonOnHover: false,
hideProgressBar: true,
closeButton: 'button',
icon: true,
rtl: false,
})
this.loadCentersData()
} catch (err) {
console.log(err)
......@@ -1090,20 +1123,6 @@
async deleteAreaItemConfirm () {
try {
await deleteArea(this.editedAreaItem.id_area)
this.$toast.success('Área eliminada correctamente', {
position: 'bottom-center',
timeout: 5000,
closeOnClick: true,
pauseOnFocusLoss: false,
pauseOnHover: true,
draggable: true,
draggablePercent: 0.6,
showCloseButtonOnHover: false,
hideProgressBar: true,
closeButton: 'button',
icon: true,
rtl: false,
})
this.loadAreasData()
} catch (err) {
console.log(err)
......@@ -1161,39 +1180,13 @@
if (this.editedIndex > -1) {
await putCenter(this.editedItem)
this.loadCentersData()
// TODO: DELETE THIS !!
Object.assign(this.centers[this.editedIndex], this.editedItem)
this.$toast.success('Centro editado correctamente', {
position: 'bottom-center',
timeout: 5000,
closeOnClick: true,
pauseOnFocusLoss: false,
pauseOnHover: true,
draggable: true,
draggablePercent: 0.6,
showCloseButtonOnHover: false,
hideProgressBar: true,
closeButton: 'button',
icon: true,
rtl: false,
})
} else {
await postCenter(this.editedItem)
this.loadCentersData()
// TODO: DELETE THIS !!
this.centers.push(this.editedItem)
this.$toast.success('Centro insertado correctamente', {
position: 'bottom-center',
timeout: 5000,
closeOnClick: true,
pauseOnFocusLoss: false,
pauseOnHover: true,
draggable: true,
draggablePercent: 0.6,
showCloseButtonOnHover: false,
hideProgressBar: true,
closeButton: 'button',
icon: true,
rtl: false,
})
}
this.close()
},
......@@ -1202,38 +1195,10 @@
await putArea(this.editedAreaItem)
this.loadAreasData()
Object.assign(this.areas[this.editedAreaIndex], this.editedAreaItem)
this.$toast.success('Área editada correctamente', {
position: 'bottom-center',
timeout: 5000,
closeOnClick: true,
pauseOnFocusLoss: false,
pauseOnHover: true,
draggable: true,
draggablePercent: 0.6,
showCloseButtonOnHover: false,
hideProgressBar: true,
closeButton: 'button',
icon: true,
rtl: false,
})
} else {
await postArea(this.editedItem.id_centro, this.editedAreaItem)
this.loadAreasData()
this.areas.push(this.editedAreaItem)
this.$toast.success('Área insertada correctamente', {
position: 'bottom-center',
timeout: 5000,
closeOnClick: true,
pauseOnFocusLoss: false,
pauseOnHover: true,
draggable: true,
draggablePercent: 0.6,
showCloseButtonOnHover: false,
hideProgressBar: true,
closeButton: 'button',
icon: true,
rtl: false,
})
}
this.closeArea()
},
......@@ -1267,6 +1232,6 @@
</script>
<style scoped>
.fix-title {
word-break: normal;
}
word-break: normal;
}
</style>