nuVistA/htdocs/RoutePatientDetail.vue

97 lines
3.3 KiB
Vue
Raw Normal View History

2022-09-22 07:10:08 -04:00
<template>
<div v-if="info">
<div class="card mb-3 shadow">
2022-10-01 01:40:21 -04:00
<div class="card-header">{{info.name}} <span :title="info.pid">{{info.pid.slice(-4)}}</span> #{{dfn}}</div>
2022-09-22 07:10:08 -04:00
<div class="card-body row" style="font-family: monospace;">
<div class="col" v-if="info.dob"><strong>DOB:</strong> {{strptime_vista(info.dob).toLocaleDateString('en-CA')}}</div>
<div class="col" v-if="info.age"><strong>Age:</strong> {{info.age}}</div>
<div class="col" v-if="info.sex"><strong>Sex:</strong> {{info.sex}}</div>
<div class="col" v-if="info.sc_percentage"><strong>SC%:</strong> {{info.sc_percentage}}</div>
<div class="col" v-if="info.type"><strong>Type:</strong> {{info.type}}</div>
<div class="col" v-if="info.ward"><strong>Ward:</strong> {{info.ward}}</div>
<div class="col" v-if="info.room_bed"><strong>Room/bed:</strong> {{info.room_bed}}</div>
</div>
</div>
<div class="card mb-3 shadow">
<div class="card-header d-flex justify-content-between align-items-center">
2022-09-22 22:06:38 -04:00
<span>Data</span>
2022-09-24 00:12:36 -04:00
<DateRangePicker range="1M" direction="-1" v-model:date="report_date" v-model:date_end="report_date_begin" />
2022-09-22 07:10:08 -04:00
</div>
<div class="card-body">
2022-09-24 00:12:36 -04:00
<ViewVitalsLabs :client="client" :dfn="dfn" :date_begin="report_date_begin" :date_end="report_date" />
2022-09-22 07:10:08 -04:00
</div>
</div>
2022-10-01 00:38:59 -04:00
<div class="card mb-3 shadow">
<div class="card-header d-flex justify-content-between align-items-center">
<span>Orders</span>
<OrderFilterPicker :client="client" v-model="orders_filter" />
<DateRangePicker range="6M" direction="-1" v-model:date="orders_date" v-model:date_end="orders_date_begin" />
</div>
<div class="card-body"><ViewOrders :client="client" :dfn="dfn" :filter="orders_filter" :date_begin="orders_date_begin" :date_end="orders_date" /></div>
</div>
2022-09-22 07:10:08 -04:00
</div>
</template>
<script>
2022-09-24 00:12:36 -04:00
import { strptime_vista } from './util.mjs';
2022-09-22 07:10:08 -04:00
import DateRangePicker from './DateRangePicker.vue';
import ViewVitalsLabs from './ViewVitalsLabs.vue';
2022-10-01 00:38:59 -04:00
import OrderFilterPicker from './OrderFilterPicker.vue';
import ViewOrders from './ViewOrders.vue';
2022-09-22 07:10:08 -04:00
var now = new Date();
export default {
components: {
2022-10-01 00:38:59 -04:00
DateRangePicker, ViewVitalsLabs, OrderFilterPicker, ViewOrders
2022-09-22 07:10:08 -04:00
},
props: {
client: Object
},
data() {
return {
2022-09-23 02:20:13 -04:00
dfn: null,
2022-09-22 07:10:08 -04:00
info: null,
2022-09-24 00:12:36 -04:00
report_date: now,
2022-10-01 00:38:59 -04:00
report_date_begin: now,
orders_filter: 2,
orders_date: now,
orders_date_begin: now
2022-09-22 07:10:08 -04:00
};
},
watch: {
info(value) {
if((value) && (value.name)) document.title = value.name;
}
},
methods: {
strptime_vista
},
async mounted() {
if(this.$route.params.id.startsWith('$')) {
var id = this.$route.params.id.substring(1);
if(id.length == 9) {
var patient = await this.client.ORWPT_FULLSSN(id);
this.$router.replace('/patient/' + patient[0].dfn);
} else if(id.length == 5) {
var name = this.$route.query.name.toUpperCase();
var patient = await this.client.ORWPT_LAST5(id);
for(var i = 0; i < patient.length; ++i) if(name == patient[i].name) {
2022-09-26 18:39:07 -04:00
this.$router.replace('/patient/' + patient[i].dfn);
2022-09-22 07:10:08 -04:00
break;
}
}
2022-09-23 02:20:13 -04:00
} else {
this.dfn = this.$route.params.id;
this.info = await this.client.ORWPT16_ID_INFO(this.$route.params.id);
}
2022-09-22 07:10:08 -04:00
},
async beforeRouteUpdate(to, from, next) {
2022-09-23 02:20:13 -04:00
this.dfn = to.params.id;
2022-09-22 07:10:08 -04:00
this.info = await this.client.ORWPT16_ID_INFO(to.params.id);
next();
}
};
</script>