|
@@ -0,0 +1,261 @@
|
|
|
+<style>
|
|
|
+ #dna-patients-filters label {
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+
|
|
|
+ #dna-patients-filters .mw-100px {
|
|
|
+ min-width: 100px;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+<form id="dna-patients-filters" method="GET" action="{{ route('dna.patients') }}" class="row align-items-end" v-cloak>
|
|
|
+ <!-- AGE -->
|
|
|
+ <div class="col-md-2">
|
|
|
+ <div class="form-group">
|
|
|
+ <label>Age:</label>
|
|
|
+ <select name="age_category" class="form-control input-sm" v-model="filters.age_category">
|
|
|
+ <option value="">All</option>
|
|
|
+ <option value="EXACTLY">Exactly</option>
|
|
|
+ <option value="LESS_THAN">Less Than</option>
|
|
|
+ <option value="GREATER_THAN">Greater Than</option>
|
|
|
+ <option value="BETWEEN">Between</option>
|
|
|
+ <option value="NOT_BETWEEN">Not Between</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-show="filters.age_category" class="col-md-2">
|
|
|
+ <div class="form-group">
|
|
|
+ <label> </label>
|
|
|
+ <input name="age_value_1" v-model="filters.age_value_1" type="number" class="form-control input-sm" :placeholder="(filters.age_category === 'BETWEEN' || filters.age_category === 'NOT_BETWEEN') ? 'From' : 'Age'" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-show="filters.age_category && (filters.age_category === 'BETWEEN' || filters.age_category === 'NOT_BETWEEN')" class="col-md-2">
|
|
|
+ <div class="form-group">
|
|
|
+ <label> </label>
|
|
|
+ <input name="age_value_2" v-model="filters.age_value_2" type="number" class="form-control input-sm" placeholder="To" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- SEX -->
|
|
|
+ <div class="col-md-2">
|
|
|
+ <div class="form-group">
|
|
|
+ <label>Sex:</label>
|
|
|
+ <select name="sex" class="form-control input-sm" v-model="filters.sex">
|
|
|
+ <option value="">All</option>
|
|
|
+ <option value="M">Male</option>
|
|
|
+ <option value="F">Female</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- BMI -->
|
|
|
+ <div class="col-md-2">
|
|
|
+ <div class="form-group">
|
|
|
+ <label>BMI:</label>
|
|
|
+ <select name="bmi_category" class="form-control input-sm" v-model="filters.bmi_category">
|
|
|
+ <option value="">All</option>
|
|
|
+ <option value="EXACTLY">Exactly</option>
|
|
|
+ <option value="LESS_THAN">Less Than</option>
|
|
|
+ <option value="GREATER_THAN">Greater Than</option>
|
|
|
+ <option value="BETWEEN">Between</option>
|
|
|
+ <option value="NOT_BETWEEN">Not Between</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-show="filters.bmi_category" class="col-md-2">
|
|
|
+ <div class="form-group">
|
|
|
+ <label> </label>
|
|
|
+ <input name="bmi_value_1" v-model="filters.bmi_value_1" type="number" class="form-control input-sm" :placeholder="(filters.bmi_category === 'BETWEEN' || filters.bmi_category === 'NOT_BETWEEN') ? 'From' : 'BMI'" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-show="filters.bmi_category && (filters.bmi_category === 'BETWEEN' || filters.bmi_category === 'NOT_BETWEEN')" class="col-md-2">
|
|
|
+ <div class="form-group">
|
|
|
+ <label> </label>
|
|
|
+ <input name="bmi_value_2" v-model="filters.bmi_value_2" type="number" class="form-control input-sm" placeholder="To" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- LAST VISIT -->
|
|
|
+ <div class="col-md-2">
|
|
|
+ <div class="form-group">
|
|
|
+ <label>Last Visit **:</label>
|
|
|
+ <select name="last_visit_category" class="form-control input-sm" v-model="filters.last_visit_category">
|
|
|
+ <option value="">All</option>
|
|
|
+ <option value="EXACTLY">Exactly</option>
|
|
|
+ <option value="LESS_THAN">Less Than</option>
|
|
|
+ <option value="GREATER_THAN">Greater Than</option>
|
|
|
+ <option value="BETWEEN">Between</option>
|
|
|
+ <option value="NOT_BETWEEN">Not Between</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-show="filters.last_visit_category" class="col-md-2">
|
|
|
+ <div class="form-group">
|
|
|
+ <label> </label>
|
|
|
+ <input name="last_visit_value_1" v-model="filters.last_visit_value_1" type="date" class="form-control input-sm" :placeholder="(filters.last_visit_category === 'BETWEEN' || filters.last_visit_category === 'NOT_BETWEEN') ? 'From' : 'Last Visit'" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-show="filters.last_visit_category && (filters.last_visit_category === 'BETWEEN' || filters.last_visit_category === 'NOT_BETWEEN')" class="col-md-2">
|
|
|
+ <div class="form-group">
|
|
|
+ <label> </label>
|
|
|
+ <input name="last_visit_value_2" v-model="filters.last_visit_value_2" type="date" class="form-control input-sm" placeholder="To" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- NEXT APPOINTMENT -->
|
|
|
+ <div class="col-md-2">
|
|
|
+ <div class="form-group">
|
|
|
+ <label>Next Appointment **:</label>
|
|
|
+ <select name="next_appointment_category" class="form-control input-sm" v-model="filters.next_appointment_category">
|
|
|
+ <option value="">All</option>
|
|
|
+ <option value="EXACTLY">Exactly</option>
|
|
|
+ <option value="LESS_THAN">Less Than</option>
|
|
|
+ <option value="GREATER_THAN">Greater Than</option>
|
|
|
+ <option value="BETWEEN">Between</option>
|
|
|
+ <option value="NOT_BETWEEN">Not Between</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-if="filters.next_appointment_category" class="col-md-2">
|
|
|
+ <div class="form-group">
|
|
|
+ <label> </label>
|
|
|
+ <input name="next_appointment_value_1" v-model="filters.next_appointment_value_1" type="date" class="form-control input-sm" :placeholder="(filters.next_appointment_category === 'BETWEEN' || filters.next_appointment_category === 'NOT_BETWEEN') ? 'From' : 'Next Appointment'" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-if="filters.next_appointment_category && (filters.next_appointment_category === 'BETWEEN' || filters.next_appointment_category === 'NOT_BETWEEN')" class="col-md-2">
|
|
|
+ <div class="form-group">
|
|
|
+ <label> </label>
|
|
|
+ <input name="next_appointment_value_2" v-model="filters.next_appointment_value_2" type="date" class="form-control input-sm" placeholder="To" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- STATUS -->
|
|
|
+ <div class="col-md-2">
|
|
|
+ <div class="form-group">
|
|
|
+ <label>Status:</label>
|
|
|
+ <select name="status" class="form-control input-sm" v-model="filters.status">
|
|
|
+ <option value="">All</option>
|
|
|
+ <option value="ACTIVE">Active</option>
|
|
|
+ <option value="AWAITING_VISIT">Awaiting Visit</option>
|
|
|
+ <option value="INACTIVE">Inactive</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- LAST WEIGHED-IN -->
|
|
|
+ <div class="col-md-2">
|
|
|
+ <div class="form-group">
|
|
|
+ <label>Last Weighed-In:</label>
|
|
|
+ <select name="last_weighed_in_category" class="form-control input-sm" v-model="filters.last_weighed_in_category">
|
|
|
+ <option value="">All</option>
|
|
|
+ <option value="EXACTLY">Exactly</option>
|
|
|
+ <option value="LESS_THAN">Less Than</option>
|
|
|
+ <option value="GREATER_THAN">Greater Than</option>
|
|
|
+ <option value="BETWEEN">Between</option>
|
|
|
+ <option value="NOT_BETWEEN">Not Between</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-if="filters.last_weighed_in_category" class="col-md-2">
|
|
|
+ <div class="form-group">
|
|
|
+ <label> </label>
|
|
|
+ <input name="last_weighed_in_value_1" v-model="filters.last_weighed_in_value_1" type="date" class="form-control input-sm" :placeholder="(filters.last_weighed_in_category === 'BETWEEN' || filters.last_weighed_in_category === 'NOT_BETWEEN') ? 'From' : 'Enter Date'" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-if="filters.last_weighed_in_category && (filters.last_weighed_in_category === 'BETWEEN' || filters.last_weighed_in_category === 'NOT_BETWEEN')" class="col-md-2">
|
|
|
+ <div class="form-group">
|
|
|
+ <label> </label>
|
|
|
+ <input name="last_weighed_in_value_2" v-model="filters.last_weighed_in_value_2" type="date" class="form-control input-sm" placeholder="To" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- LAST BP -->
|
|
|
+ <div class="col-md-2">
|
|
|
+ <div class="form-group">
|
|
|
+ <label>Last BP:</label>
|
|
|
+ <select name="last_bp_category" class="form-control input-sm" v-model="filters.last_bp_category">
|
|
|
+ <option value="">All</option>
|
|
|
+ <option value="EXACTLY">Exactly</option>
|
|
|
+ <option value="LESS_THAN">Less Than</option>
|
|
|
+ <option value="GREATER_THAN">Greater Than</option>
|
|
|
+ <option value="BETWEEN">Between</option>
|
|
|
+ <option value="NOT_BETWEEN">Not Between</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-if="filters.last_bp_category" class="col-md-2">
|
|
|
+ <div class="form-group">
|
|
|
+ <label> </label>
|
|
|
+ <input name="last_bp_value_1" v-model="filters.last_bp_value_1" type="date" class="form-control input-sm" :placeholder="(filters.last_bp_category === 'BETWEEN' || filters.last_bp_category === 'NOT_BETWEEN') ? 'From' : 'Enter Date'" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-if="filters.last_bp_category && (filters.last_bp_category === 'BETWEEN' || filters.last_bp_category === 'NOT_BETWEEN')" class="col-md-2">
|
|
|
+ <div class="form-group">
|
|
|
+ <label> </label>
|
|
|
+ <input name="last_bp_value_2" v-model="filters.last_bp_value_2" type="date" class="form-control input-sm" placeholder="To" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="col-md-2">
|
|
|
+ <div class="form-group d-flex">
|
|
|
+ <label> </label>
|
|
|
+ <button type="button" v-on:click.prevent="doSubmit()" class="btn btn-primary btn-sm mr-2 mw-100px">Apply Filters</button>
|
|
|
+ <a href="{{ route('dna.patients') }}" class="btn btn-danger btn-sm text-white mw-100px">Clear Filters</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</form>
|
|
|
+
|
|
|
+<?php
|
|
|
+$loadedFilters = $filters;
|
|
|
+$allFilterKeys = [
|
|
|
+ 'age_category',
|
|
|
+ 'age_value_1',
|
|
|
+ 'age_value_2',
|
|
|
+ 'bmi_category',
|
|
|
+ 'bmi_value_1',
|
|
|
+ 'bmi_value_2',
|
|
|
+ 'last_bp_category',
|
|
|
+ 'last_bp_value_1',
|
|
|
+ 'last_bp_value_2',
|
|
|
+ 'last_visit_category',
|
|
|
+ 'last_visit_value_1',
|
|
|
+ 'last_visit_value_2',
|
|
|
+ 'last_weighed_in_category',
|
|
|
+ 'last_weighed_in_value_1',
|
|
|
+ 'next_appointment_category',
|
|
|
+ 'next_appointment_value_1',
|
|
|
+ 'sex',
|
|
|
+ 'status',
|
|
|
+];
|
|
|
+for ($i=0; $i < count($allFilterKeys); $i++) {
|
|
|
+ if (!isset($loadedFilters[$allFilterKeys[$i]]) || !$loadedFilters[$allFilterKeys[$i]]) {
|
|
|
+ $loadedFilters[$allFilterKeys[$i]] = '';
|
|
|
+ }
|
|
|
+}
|
|
|
+?>
|
|
|
+<script>
|
|
|
+ (function() {
|
|
|
+ function init() {
|
|
|
+ new Vue({
|
|
|
+ el: '#dna-patients-filters',
|
|
|
+ delimiters: ['@{{', '}}'],
|
|
|
+ data: {
|
|
|
+ filters: <?= json_encode($loadedFilters) ?>
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init: function() {
|
|
|
+
|
|
|
+ },
|
|
|
+ doSubmit: function() {
|
|
|
+ fastLoad('{{ route('dna.patients') }}?' + $('#dna-patients-filters').serialize());
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted: function() {
|
|
|
+ console.log(this.filters);
|
|
|
+ this.init();
|
|
|
+ },
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ addMCInitializer('dna-patients-filters', init, '#dna-patients-filters');
|
|
|
+ })();
|
|
|
+</script>
|