Add cpone MCU generate summaries module

This commit is contained in:
sas.fajri
2026-04-29 09:51:46 +07:00
parent 09ee0fd533
commit 30f09c353c
14 changed files with 3341 additions and 0 deletions

View File

@@ -0,0 +1,786 @@
const URL = "/one-api/mcusummaries/";
export async function getmgmmcu(prm) {
try {
var resp = await axios.post(URL + 'generatedata/getmgmmcu', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function search(prm) {
try {
var resp = await axios.post(URL + 'generatedata/search', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function generatesetup(prm) {
try {
var resp = await axios.post(URL + 'generatedata/generatesetup', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getsexreg(token) {
try {
var resp = await axios.post(URL + 'generatedata/getsexreg',{token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function savecsv(prm) {
try {
var resp = await axios.post(URL + 'generatedata/savecsv',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function newpatient(prm) {
try {
var resp = await axios.post(URL + 'generatedata/newpatient',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function xdelete(prm) {
try {
var resp = await axios.post(URL + 'generatedata/deletepatient',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getaddress(prm) {
try {
var resp = await axios.post(URL + 'generatedata/getaddress',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchcity(token,prm) {
try {
var resp = await axios.post(URL + 'generatedata/searchcity',{token:token,search:prm});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getdistrict(token,prm) {
try {
var resp = await axios.post(URL + 'generatedata/getdistrict',{id:prm.M_CityID,token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getkelurahan(token,prm) {
try {
var resp = await axios.post(URL + 'generatedata/getkelurahan',{token:token,id:prm.M_DistrictID});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function savenewaddress(prm) {
try {
var resp = await axios.post(URL + 'generatedata/savenewaddress',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function saveeditaddress(prm) {
try {
var resp = await axios.post(URL + 'generatedata/saveeditaddress',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function deleteaddress(prm) {
try {
var resp = await axios.post(URL + 'generatedata/deleteaddress',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchdoctor(prm) {
try {
console.log('aye')
console.log(prm)
var resp = await axios.post(URL + 'generatedata/searchdoctor',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchcompany(prm) {
try {
var resp = await axios.post(URL + 'generatedata/searchcompany',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getmou(prm) {
try {
var resp = await axios.post(URL + 'generatedata/getmou',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function savegeneratedata(prm) {
try {
var resp = await axios.post(URL + 'generatedata/savegeneratedata',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function gotoreg(prm) {
try {
var resp = await axios.post(URL + 'generatedata/gotoreg',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function generatecountkelainan(prm) {
const params = new URLSearchParams();
for (const key in prm) {
params.append(key, prm[key]);
}
try {
var resp = await axios.post('/one-api/summarydashboard/sqlgenerator/get_count_kelainan', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function savekelainanselection(prm) {
try {
var resp = await axios.post('/one-api/summarydashboard/sqlgenerator/save_kelainan_selection',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getKelainanSelected(prm) {
try {
var resp = await axios.post('/one-api/summarydashboard/sqlgenerator/get_kelainan_selected', prm);
if (resp.status != 200) {
return { status: false, message: resp.statusText };
}
let data = resp.data;
return data;
} catch (e) {
return { status: false, message: e.message };
}
}
export async function downloadDatabase(prm) {
try {
var resp = await axios.get('/one-api/summarydashboard/sqlgenerator/download', {
responseType: 'blob',
params: prm
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText,
data: null
};
}
return resp;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function truncateDatabase(prm) {
try {
var resp = await axios.post('/one-api/summarydashboard/sqlgenerator/truncate_corporate_tables', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
// 1. Generate Table Setup
export async function generateTable(prm) {
try {
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_table_setup', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
// 2. Generate Kelainan Lab
export async function generateKelainanLab(prm) {
try {
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_kelainan_lab', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
// 3. Generate Kelainan Non-Lab
export async function generateKelainanNonLab(prm) {
try {
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_kelainan_nonlab', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
// 4. Generate Kelainan Fisik
export async function generateKelainanFisik(prm) {
try {
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_kelainan_fisik', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
// 5. Generate Kelainan Summary
export async function generateKelainanSummary(prm) {
try {
var resp = await axios.post('/one-api/summarydashboard/generatedata/summary_kelainan_sepuluh', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
// 6. Generate Result McuLab
export async function generateKelainanResultMcuLab(prm) {
try {
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_result_mcu_lab', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
// 7. Generate Kelainan Result McuNonLab
export async function generateKelainanResultMcuNonLab(prm) {
try {
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_result_mcu_nonlab', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
// 8. Generate Result Mcu Kenal Warna
export async function generateResultMcuKenalWarna (prm) {
try {
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_result_mcu_kenal_warna', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
// 9. Generate generate_result_mcu_visus
export async function generateResultMcuVisus (prm) {
try {
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_result_mcu_visus', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
// 10. Generate generate_result_mcu_status_gizi
export async function generateResultStatusGizi (prm) {
try {
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_result_mcu_status_gizi', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
// 11. generate_result_mcu_bodyfatmonitoring
export async function generateResultMcuBodyFatMonitoring (prm) {
try {
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_result_mcu_bodyfatmonitoring', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
// 12. generate_result_mcu_fisik
export async function generateResultMcuFisik (prm) {
try {
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_result_mcu_fisik', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
// 13. generate_all_results
export async function generateAllResult (prm) {
try {
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_all_results', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
// 14. Generate Encrypt Key
export async function generateEncryptKey (prm) {
try {
var resp = await axios.post('/one-api/summarydashboard/sqlgenerator/create_encrypt_key', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getActiveEncryptKey (prm) {
try {
var resp = await axios.post('/one-api/summarydashboard/sqlgenerator/get_active_encrypt_key', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,293 @@
<template>
<div class="vue-csv-uploader">
<div class="form">
<div class="vue-csv-uploader-part-one">
<div class="form-check form-group csv-import-checkbox" v-if="headers === null">
<slot name="hasHeaders" :headers="hasHeaders" :toggle="toggleHasHeaders">
<input :class="checkboxClass" type="checkbox" :id="makeId('hasHeaders')" :value="hasHeaders" @change="toggleHasHeaders">
<label class="form-check-label" :for="makeId('hasHeaders')">
File Has Headers
</label>
</slot>
</div>
<div class="form-group csv-import-file">
<input ref="csv" type="file" @change.prevent="validFileMimeType" :class="inputClass" name="csv">
<slot name="error" v-if="showErrorMessage">
<div class="invalid-feedback d-block">
File type is invalid
</div>
</slot>
</div>
<div class="form-group">
<slot name="next" :load="load">
<button type="submit" :disabled="disabledNextButton" :class="buttonClass" @click.prevent="load">
{{ loadBtnText }}
</button>
</slot>
</div>
</div>
<div class="vue-csv-uploader-part-two">
<div class="vue-csv-mapping" v-if="sample">
<table :class="tableClass">
<slot name="thead">
<thead>
<tr>
<th>Field</th>
<th>CSV Column</th>
</tr>
</thead>
</slot>
<tbody>
<tr v-for="(field, key) in fieldsToMap" :key="key">
<td>{{ field.label }}</td>
<td>
<select :class="tableSelectClass" :name="`csv_uploader_map_${key}`" v-model="map[field.key]">
<option :value="null" v-if="canIgnore">Ignore</option>
<option v-for="(column, key) in firstRow" :key="key" :value="key">{{ column }}</option>
</select>
</td>
</tr>
</tbody>
</table>
<div class="form-group" v-if="url">
<slot name="submit" :submit="submit">
<input type="submit" :class="buttonClass" @click.prevent="submit" :value="submitBtnText">
</slot>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { drop, every, forEach, get, isArray, map, set } from 'lodash';
import axios from 'axios';
import Papa from 'papaparse';
import mimeTypes from "mime-types";
export default {
props: {
value: Array,
url: {
type: String
},
mapFields: {
required: true
},
callback: {
type: Function,
default: () => ({})
},
catch: {
type: Function,
default: () => ({})
},
finally: {
type: Function,
default: () => ({})
},
parseConfig: {
type: Object,
default() {
return {};
}
},
headers: {
default: null
},
loadBtnText: {
type: String,
default: "Next"
},
submitBtnText: {
type: String,
default: "Submit"
},
tableClass: {
type: String,
default: "table"
},
checkboxClass: {
type: String,
default: "form-check-input"
},
buttonClass: {
type: String,
default: "btn btn-primary"
},
inputClass: {
type: String,
default: "form-control-file"
},
validation: {
type: Boolean,
default: true,
},
fileMimeTypes: {
type: Array,
default: () => {
return ["text/csv", "text/x-csv", "application/vnd.ms-excel", "text/plain"];
}
},
tableSelectClass: {
type: String,
default: 'form-control'
},
canIgnore: {
type: Boolean,
default: false,
}
},
data: () => ({
form: {
csv: null,
},
fieldsToMap: [],
map: {},
hasHeaders: true,
csv: null,
sample: null,
isValidFileMimeType: false,
fileSelected: false
}),
created() {
this.hasHeaders = this.headers;
if (isArray(this.mapFields)) {
this.fieldsToMap = map(this.mapFields, (item) => {
return {
key: item,
label: item
};
});
} else {
this.fieldsToMap = map(this.mapFields, (label, key) => {
return {
key: key,
label: label
};
});
}
},
methods: {
submit() {
const _this = this;
this.form.csv = this.buildMappedCsv();
this.$emit('input', this.form.csv);
if (this.url) {
axios.post(this.url, this.form).then(response => {
_this.callback(response);
}).catch(response => {
_this.catch(response);
}).finally(response => {
_this.finally(response);
});
} else {
_this.callback(this.form.csv);
}
},
buildMappedCsv() {
const _this = this;
let csv = this.hasHeaders ? drop(this.csv) : this.csv;
return map(csv, (row) => {
let newRow = {};
forEach(_this.map, (column, field) => {
set(newRow, field, get(row, column));
});
return newRow;
});
},
validFileMimeType() {
let file = this.$refs.csv.files[0];
const mimeType = file.type === "" ? mimeTypes.lookup(file.name) : file.type;
if (file) {
this.fileSelected = true;
this.isValidFileMimeType = this.validation ? this.validateMimeType(mimeType) : true;
} else {
this.isValidFileMimeType = !this.validation;
this.fileSelected = false;
}
},
validateMimeType(type) {
return this.fileMimeTypes.indexOf(type) > -1;
},
load() {
const _this = this;
this.readFile((output) => {
_this.sample = get(Papa.parse(output, { preview: 2, skipEmptyLines: true }), "data");
_this.csv = get(Papa.parse(output, { skipEmptyLines: true }), "data");
});
},
readFile(callback) {
let file = this.$refs.csv.files[0];
if (file) {
let reader = new FileReader();
reader.readAsText(file, "UTF-8");
reader.onload = function (evt) {
callback(evt.target.result);
};
reader.onerror = function () {
};
}
},
toggleHasHeaders() {
this.hasHeaders = !this.hasHeaders;
},
makeId(id) {
return `${id}${this._uid}`;
}
},
watch: {
map: {
deep: true,
handler: function (newVal) {
if (!this.url) {
let hasAllKeys = Array.isArray(this.mapFields) ? every(this.mapFields, function (item) {
return newVal.hasOwnProperty(item);
}) : every(this.mapFields, function (item, key) {
return newVal.hasOwnProperty(key);
});
if (hasAllKeys) {
this.submit();
}
}
}
},
sample(newVal, oldVal) {
if(newVal !== null){
this.fieldsToMap.forEach(field => {
newVal[0].forEach((columnName, index) => {
if(field.key === columnName){
this.map[field.key] = index;
}
});
});
}
}
},
computed: {
firstRow() {
return get(this, "sample.0");
},
showErrorMessage() {
return this.fileSelected && !this.isValidFileMimeType;
},
disabledNextButton() {
return !this.isValidFileMimeType;
}
},
};
</script>

View File

@@ -0,0 +1,397 @@
<template>
<v-layout v-if="xact !== 'new'" column >
<v-dialog v-model="dialogconfirmationdeleteaddr" persistent max-width="290">
<v-card>
<v-card-title
dark
class="headline error pt-2 pb-2"
primary-title
style="color:white"
>
<h4 dark>Konfirmasi</h4>
</v-card-title>
<v-card-text>
{{msgconfirmationdeleteaddr}}
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn small v-if="!checkError('deleteutama')" color="error darken-1 text-sm-left" flat @click="doDeleteAddr()">Hapus</v-btn>
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationdeleteaddr = false">Batal</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogformaddress" persistent max-width="650">
<v-card>
<v-card-title>
<span class="headline">Form Alamat Pasien</span>
</v-card-title>
<v-card-text class="pt-0 pb-0">
<v-layout wrap>
<v-flex xs12>
<v-text-field v-model="labeladdress" label="Label"></v-text-field>
<p v-if="checkError('requiredlabel')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
<p v-if="checkError('readonlyutama')" class="error pl-2 pr-2" style="color:#fff">Biarkan jadi yang utama</p>
</v-flex>
<v-flex xs12>
<v-layout row>
<v-flex xs4 pa-1>
<v-autocomplete
label="Kota"
v-model="cityaddress"
:items="xcities"
:search-input.sync="search_city"
auto-select-first
no-filter
item-text="M_CityName"
return-object
:loading="isLoading"
no-data-text="Pilih Kota"
>
<template
slot="item"
slot-scope="{ item }"
>
<v-list-tile-content>
<v-list-tile-title v-text="item.M_CityName"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-autocomplete>
<p v-if="checkError('requiredcity')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
</v-flex>
<v-flex xs4 pa-1>
<v-select
item-text="M_DistrictName"
return-object
:items="xdistricts"
v-model="districtaddress"
label="Kecamatan*"
></v-select>
<p v-if="checkError('requireddistrict')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
</v-flex>
<v-flex xs4 pa-1>
<v-select
item-text="M_KelurahanName"
return-object
:items="xkelurahans"
v-model="kelurahanaddress"
label="Kelurahan / Desa*"
></v-select>
<p v-if="checkError('requiredkelurahan')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12>
<v-textarea
box
label="Alamat Lengkap"
v-model="descriptionaddress"
></v-textarea>
<p v-if="checkError('requireddescription')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="dialogformaddress = false">Tutup</v-btn>
<v-btn v-if="xactaddr === 'new'" color="blue darken-1" flat @click="saveNewAddress()">Simpan</v-btn>
<v-btn v-if="xactaddr === 'edit'" color="blue darken-1" flat @click="saveEditAddress()">Simpan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-card>
<v-layout row>
<v-flex xs12>
<v-subheader red--text text--lighten-1> ALAMAT PASIEN
<v-flex text-md-right>
<v-btn @click="createNewAddress()" small color="info">Baru</v-btn>
</v-flex>
</v-subheader>
<v-divider></v-divider>
<v-layout row wrap>
<v-flex xs12 pa-2>
<v-data-table
:headers="headers"
:items="xaddresses"
:loading="isLoading"
hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-center pa-2">
<v-icon color="error" @click="deleteAddress(props.item)">delete</v-icon>
<v-icon class="ml-3" color="primary" @click="editAddress(props.item)">edit</v-icon>
</td>
<td class="text-xs-left pa-2">{{ props.item.M_PatientAddressNote}}</td>
<td class="text-xs-left pa-2">{{ props.item.M_PatientAddressDescription}}</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card>
</v-layout>
</template>
<style scoped>
</style>
<script>
module.exports = {
data: () => ({
search_city:'',
oldlabel:'',
headers: [
{
text: "AKSI",
align: "center",
sortable: false,
value: "action",
width: "10%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "LABEL",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "ALAMAT",
align: "left",
sortable: false,
value: "lab",
width: "40%",
class: "pa-1 blue lighten-3 white--text"
}
]
}),
computed: {
dialogconfirmationdeleteaddr:{
get() {
return this.$store.state.patient.dialog_confirmation_delete_addr
},
set(val) {
this.$store.commit("patient/update_dialog_confirmation_delete_addr",val)
}
},
msgconfirmationdeleteaddr(){
return this.$store.state.patient.msg_confirmation_delete_addr
},
xact() {
return this.$store.state.patient.act
},
xactaddr() {
return this.$store.state.patient.act_addr
},
dialogformaddress:{
get() {
return this.$store.state.patient.dialog_form_address
},
set(val) {
this.$store.commit("patient/update_dialog_form_address",val)
}
},
isLoading() {
return this.$store.state.patient.search_status == 1
},
xaddresses(p) {
return this.$store.state.patient.addresses
},
xcities(){
return this.$store.state.patient.cities
},
labeladdress:{
get() {
return this.$store.state.patient.label_address
},
set(val) {
this.$store.commit("patient/update_label_address",val)
}
},
cityaddress:{
get() {
return this.$store.state.patient.city_address
},
set(val) {
this.$store.commit("patient/update_city_address",val)
this.$store.dispatch("patient/getdistrict",this.$store.state.patient.city_address)
}
},
xdistricts(){
return this.$store.state.patient.districts
},
districtaddress:{
get() {
return this.$store.state.patient.district_address
},
set(val) {
this.$store.commit("patient/update_district_address",val)
this.$store.dispatch("patient/getkelurahan",this.$store.state.patient.district_address)
}
},
xkelurahans(){
return this.$store.state.patient.kelurahans
},
kelurahanaddress:{
get() {
return this.$store.state.patient.kelurahan_address
},
set(val) {
this.$store.commit("patient/update_kelurahan_address",val)
}
},
descriptionaddress:{
get() {
return this.$store.state.patient.description_address
},
set(val) {
this.$store.commit("patient/update_description_address",val)
}
},
},
methods : {
createNewAddress(){
this.$store.commit("patient/update_act_addr",'new')
this.search_city = ''
this.labeladdress = ''
this.$store.commit("patient/update_cities",[])
this.cityaddress = {}
this.$store.commit("patient/update_districts",[])
this.districtaddress = {}
this.$store.commit("patient/update_kelurahans",[])
this.kelurahanaddress = {}
this.descriptionaddress = ''
this.$store.commit("patient/update_dialog_form_address",true)
},
thr_search_city: _.debounce( function () {
this.$store.dispatch("patient/searchcity",this.search_city)
},2000),
checkError(value){
var errors = this.$store.state.patient.errors
if(errors.includes(value)){
return true
}
else{
return false
}
},
saveNewAddress(){
this.$store.commit("patient/update_errors",[])
var errors = this.$store.state.patient.errors
if(this.labeladdress === ''){
errors.push("requiredlabel")
}
if(_.isEmpty(this.cityaddress)){
errors.push("requiredcity")
}
if(_.isEmpty(this.districtaddress)){
errors.push("requireddistrict")
}
if(_.isEmpty(this.kelurahanaddress)){
errors.push("requiredkelurahan")
}
if(_.isEmpty(this.descriptionaddress)){
errors.push("requireddescription")
}
if(errors.length === 0){
var prm = {}
prm.M_PatientAddressM_PatientID = this.$store.state.patient.selected_patient.M_PatientID
prm.M_PatientName = this.$store.state.patient.selected_patient.M_PatientName
prm.M_PatientAddressNote = this.labeladdress
prm.M_PatientAddressDescription = this.descriptionaddress
prm.M_PatientAddressM_KelurahanID = this.kelurahanaddress.M_KelurahanID
this.$store.dispatch("patient/savenewaddress",prm)
}
},
editAddress(value){
this.$store.commit("patient/update_act_addr",'edit')
this.$store.commit("patient/update_x_addr_id",value.M_PatientAddressID)
this.labeladdress = value.M_PatientAddressNote
this.oldlabel = value.M_PatientAddressNote
this.$store.commit("patient/update_cities",[{M_CityID:value.M_CityID,M_CityName:value.M_CityName}])
this.cityaddress = {M_CityID:value.M_CityID,M_CityName:value.M_CityName}
this.$store.commit("patient/update_districts",[{M_DistrictID:value.M_DistrictID,M_DistrictName:value.M_DistrictName}])
this.districtaddress = {M_DistrictID:value.M_DistrictID,M_DistrictName:value.M_DistrictName}
this.$store.commit("patient/update_kelurahans",[{M_KelurahanID:value.M_PatientAddressM_KelurahanID,M_KelurahanName:value.M_KelurahanName}])
this.kelurahanaddress = {M_KelurahanID:value.M_PatientAddressM_KelurahanID,M_KelurahanName:value.M_KelurahanName}
this.descriptionaddress = value.M_PatientAddressDescription
this.$store.commit("patient/update_dialog_form_address",true)
},
saveEditAddress(){
this.$store.commit("patient/update_errors",[])
var errors = this.$store.state.patient.errors
if(this.labeladdress === ''){
errors.push("requiredlabel")
}
if(this.oldlabel.toLowerCase() === 'utama' && this.labeladdress.toLowerCase() !== 'utama'){
errors.push("readonlyutama")
}
if(_.isEmpty(this.cityaddress)){
errors.push("requiredcity")
}
if(_.isEmpty(this.districtaddress)){
errors.push("requireddistrict")
}
if(_.isEmpty(this.kelurahanaddress)){
errors.push("requiredkelurahan")
}
if(_.isEmpty(this.descriptionaddress)){
errors.push("requireddescription")
}
if(errors.length === 0){
var prm = {}
prm.M_PatientAddressID = this.$store.state.patient.x_addr_id
prm.M_PatientAddressM_PatientID = this.$store.state.patient.selected_patient.M_PatientID
prm.M_PatientName = this.$store.state.patient.selected_patient.M_PatientName
prm.M_PatientAddressNote = this.labeladdress
prm.M_PatientAddressDescription = this.descriptionaddress
prm.M_PatientAddressM_KelurahanID = this.kelurahanaddress.M_KelurahanID
this.$store.dispatch("patient/saveeditaddress",prm)
}
},
deleteAddress(value){
this.$store.commit("patient/update_act_addr",'delete')
this.$store.commit("patient/update_x_addr_id",value.M_PatientAddressID)
this.$store.commit("patient/update_errors",[])
this.oldlabel = value.M_PatientAddressNote
var errors = this.$store.state.patient.errors
if(value.M_PatientAddressNote.toLowerCase() === 'utama'){
errors.push("deleteutama")
}
var msg = ''
if(errors.includes("deleteutama")){
msg = "Biarkan yang utama tetap ada"
}
else{
msg = "Yakin, akan menghapus data alamat pasien "+value.M_PatientAddressNote+" ?"
}
this.$store.commit("patient/update_msg_confirmation_delete_addr",msg)
this.$store.commit("patient/update_dialog_confirmation_delete_addr",true)
},
doDeleteAddr(){
var prm = {}
prm.M_PatientAddressID = this.$store.state.patient.x_addr_id
prm.M_PatientAddressM_PatientID = this.$store.state.patient.selected_patient.M_PatientID
prm.M_PatientName = this.$store.state.patient.selected_patient.M_PatientName
prm.M_PatientAddressNote = this.oldlabel
this.$store.dispatch("patient/deleteaddress",prm)
}
},
watch: {
search_city(val,old) {
if (val == old ) return
if (! val) return
if (val.length < 1 ) return
if (this.$store.state.patient.update_autocomplete_status == 1 ) return
this.thr_search_city()
}
}
}
</script>

View File

@@ -0,0 +1,277 @@
<template>
<v-layout class="mb-2" column>
<v-dialog v-model="dialog_confirm_create_db" persistent max-width="400">
<v-card>
<v-card-title class="headline warning" primary-title>
Konfirmasi Generate Ulang
</v-card-title>
<v-card-text>
Anda yakin ingin meng-generate ulang database untuk company <br>
<strong>{{ selected_mgmmcu.mcuName }}</strong>? <br><br>
<span class="red--text">Semua data sebelumnya akan hilang.</span>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn text @click="dialog_confirm_create_db = false">Batal</v-btn>
<v-btn color="warning" text @click="confirmCreateDatabase">Ya, Lanjutkan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-card v-if="selected_mgm_mcu_id && (isLoading || kelainanCount.length > 0)">
<v-card-title style="background:#57c492; color:white">
<span>Daftar Kelainan</span>
<v-spacer></v-spacer>
<v-btn small color="primary" @click="saveSelection" :loading="loading_save">Simpan Pilihan</v-btn>
</v-card-title>
<v-card-text>
<v-data-table
:headers="kelainanHeaders"
:items="kelainanCount"
item-key="Mcu_KelainanID"
select-all
class="elevation-1"
:pagination.sync="pagination"
>
<template v-slot:headers="props">
<tr>
<th class="text-xs-left" style="width:10%">
Pilih
</th>
<th v-for="header in props.headers" :key="header.text" class="text-xs-left">
{{ header.text }}
</th>
</tr>
</template>
<template v-slot:items="props">
<td>
<v-checkbox
v-model="selectedKelainan"
:value="props.item.Mcu_KelainanID"
hide-details
></v-checkbox>
</td>
<td class="text-xs-left">{{ props.item.Mcu_KelainanName }}</td>
<td class="text-xs-left">{{ props.item.total_patient }}</td>
</template>
</v-data-table>
</v-card-text>
</v-card>
<v-card class="mt-4 pa-3" v-else-if="selected_mgm_mcu_id && !isLoading && kelainanCount.length === 0">
<v-layout row wrap align-center justify-center text-xs-center>
<v-flex xs12>
<h3 class="headline font-weight-light mb-2">Data Kelainan Belum Ada</h3>
<span class="font-weight-light">Tidak ada data kelainan yang ditemukan untuk MCU ini. Silakan buat database terlebih dahulu.</span>
</v-flex>
<v-flex xs12 mt-3>
<v-btn large color="success" @click="createDatabase" :loading="loading_create_db">
<v-icon left>mdi-database-plus</v-icon>
Create Database
</v-btn>
</v-flex>
</v-layout>
</v-card>
<v-card class="mt-4 pa-3" v-if="savedKelainan.length > 0" color="black--text">
<v-layout row wrap align-center justify-center text-xs-center>
<v-flex xs12>
<span class="font-weight-light">Jika pilihan kelainan sudah sesuai, Anda dapat men-generate dan mengunduh database.</span>
</v-flex>
<v-flex xs12 mt-3>
<v-btn x-large color="primary" @click="generateDatabase" :loading="loading_generate">
<v-icon left>mdi-database-arrow-down</v-icon>
Download Database
</v-btn>
</v-flex>
</v-layout>
</v-card>
</v-layout>
</template>
<style scoped>
table,
td,
th {
border: 0px solid #ddd;
text-align: left;
}
table {
border-collapse: collapse;
width: 100%;
}
th,
td {
padding-top: 5px;
padding-bottom: 5px;
padding-left: 8px;
padding-right: 5px;
}
.mini-input .v-input {
margin-top: 0px;
}
.mini-input .v-input,
.mini-input .v-input--selection-controls,
.mini-input .v-input__slot {
margin-top: 0px;
margin-bottom: 0px;
margin-left: 3px;
}
.mini-input .v-messages {
min-height: 0px;
}
input.fhm-input {
border: 1px solid black;
border-radius: 2px;
-webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1),
0 0 4px rgba(0, 0, 0, 0.1);
-moz-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1),
0 0 4px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1),
0 0 4px rgba(0, 0, 0, 0.1);
padding: 2px 4px;
background: rgba(255, 255, 255, 0.5);
margin: 0 0 1px 0;
width: 30px;
text-align: center;
}
</style>
<script>
module.exports = {
data () {
return {
createDb: false,
// selectedKelainan: [], // Dihapus karena akan menggunakan computed property dari Vuex
pagination: {
rowsPerPage: 10
},
kelainanHeaders: [
{ text: 'Nama Kelainan', value: 'Mcu_KelainanName', sortable: false },
{ text: 'Total Pasien', value: 'total_patient', sortable: false },
]
}
},
mounted() {
// Tidak perlu memanggil loadSelectedKelainan() di sini lagi
// karena data sudah dimuat saat MCU dipilih di komponen list.
// Jika perlu memastikan data ada saat komponen dimuat ulang,
// logika bisa ditambahkan di sini atau di `created`.
},
computed: {
kelainanCount() {
return this.$store.state.patient.kelainan_count
},
preSelectedKelainan() {
return this.$store.state.patient.pre_selected_kelainan;
},
loading_save() {
return this.$store.state.patient.loading_save
},
loading_generate() {
return this.$store.state.patient.loading_generate
},
loading_create_db() {
return this.$store.state.patient.loading_create_db;
},
selected_mgm_mcu_id() {
return this.$store.state.patient.selected_mgm_mcu_id
},
isLoading() {
return this.$store.state.patient.get_data_status === 1;
},
selected_mgmmcu() {
return this.$store.state.patient.selected_mgmmcu;
},
dialog_confirm_create_db: {
get() { return this.$store.state.patient.dialog_confirm_create_db; },
set(val) { this.$store.commit("patient/update_dialog_confirm_create_db", val); }
},
selectedKelainan: {
get() { return this.$store.state.patient.selectedKelainan; },
set(val) { this.$store.commit("patient/update_selected_kelainan", val); }
},
savedKelainan() {
return this.$store.state.patient.savedKelainan;
},
pages () {
if (this.pagination.rowsPerPage == null || this.pagination.totalItems == null)
return 0
return Math.ceil(this.pagination.totalItems / this.pagination.rowsPerPage)
}
},
watch: {
// Watcher untuk kelainanCount tidak lagi diperlukan untuk memuat data
},
methods: {
async saveSelection() {
const totalAvailable = this.kelainanCount.length;
const totalSelected = this.selectedKelainan.length;
if (totalAvailable >= 10) {
if (totalSelected !== 10) {
this.$store.commit("patient/update_msg_info", "Harap pilih tepat 10 kelainan.");
this.$store.commit("patient/update_open_dialog_info", true);
return;
}
} else if (totalSelected !== totalAvailable) {
this.$store.commit("patient/update_msg_info", `Harap pilih ${totalAvailable} kelainan yang tersedia.`);
this.$store.commit("patient/update_open_dialog_info", true);
return;
}
const payload = {
mgm_mcu_id: this.selected_mgm_mcu_id,
selected_kelainan: this.selectedKelainan.map(id => {
const item = this.kelainanCount.find(x => x.Mcu_KelainanID == id);
return {
id: parseInt(id),
name: item ? item.Mcu_KelainanName : ""
};
})
};
await this.$store.dispatch("patient/savekelainanselection", payload);
},
async generateDatabase() {
this.$store.dispatch("patient/generateDatabase", {
mgm_mcu_id: this.selected_mgm_mcu_id
});
},
createDatabase() {
this.dialog_confirm_create_db = true;
},
async confirmCreateDatabase() {
this.dialog_confirm_create_db = false;
const truncateSuccess = await this.$store.dispatch("patient/truncateDatabaseAction", {
mgm_mcu_id: this.selected_mgm_mcu_id,
confirm_truncate: true
});
if (truncateSuccess) {
this.$store.dispatch("patient/createDatabase", {
mgm_mcu_id: this.selected_mgm_mcu_id
});
}
}
},
}
</script>

View File

@@ -0,0 +1,389 @@
<template>
<v-layout class="fill-height" column>
<v-dialog
v-model="dialog_identifier"
width="800"
>
<v-card>
<v-card-title
class="headline grey lighten-2 pt-2 pb-2"
primary-title
>
GAGAL, KTP DAN TANGGAL LAHIR HARUS BENAR!!!
</v-card-title>
<v-card-text>
<v-layout align-center row>
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table :headers="headers" :items="xidentifer" hide-actions
class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2" v-html="props.item.NAMA"></td>
<td class="text-xs-left pa-2" v-html="props.item.KTP"></td>
</template>
</v-data-table>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
color="primary"
text
@click="dialog_identifier = false"
>
Tutup
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogsuccess" persistent max-width="290">
<v-card>
<v-card-title class="headline success" primary-title>Berhasil !</v-card-title>
<v-card-text>
{{msgsuccess}}
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="success" text @click="closeDialogSuccess">OK</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-card color="orange accent-1" class="mb-2 pa-2 searchbox">
<v-layout row>
<v-flex xs12>
<v-card>
<v-layout pa-2 row>
<v-flex xs12>
<v-autocomplete :items="xmgmmcu" v-model="selected_mgmmcu" item-text="mcuName" outline
item-value="Mgm_McuID" return-object label="MCU">
</v-autocomplete>
</v-flex>
</v-layout>
<v-divider></v-divider>
<v-layout row>
<v-flex xs12 pa-2>
<v-card color="orange" dark>
<v-card-text>
<v-layout align-center row>
<v-flex pb-2 xs12>
SETUP : {{selected_mgmmcu.Mgm_McuLabel}}
</v-flex>
</v-layout>
<v-divider dark></v-divider>
<v-layout row>
<v-flex xs12>
<p class="mb-0 caption"> Periode : {{selected_mgmmcu.Mgm_McuStartDate}} - {{selected_mgmmcu.Mgm_McuEndDate}}</p>
<p class="mb-0 caption" v-if="kelainanCount.length > 0">
Encrypt Key :
<p v-if="kelainanCount.length > 0 && activeEncryptKey">{{ activeEncryptKey }}</p>
<p v-else></p>
</p>
</v-flex>
</v-layout>
</v-card-text>
</v-card>
</v-flex>
</v-layout>
</v-card>
</v-flex>
</v-layout>
</v-card>
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()" @close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>
<one-dialog-info :status="opendialoginfo" :msg="msginfo" @close-dialog-info="opendialoginfo = false"></one-dialog-info>
</v-layout>
</template>
<style scoped>
table.v-table tbody td,table.v-table tbody th {
height: 35px;
}
table.v-table thead tr {
height: 35px;
}
</style>
<script>
module.exports = {
components: {
'one-dialog-info' : httpVueLoader('../../common/oneDialogInfo.vue'),
'one-dialog-alert': httpVueLoader('../../common/oneDialogAlert.vue')
},
mounted() {
this.$store.dispatch("patient/getmgmmcu")
},
methods: {
downloadxapp(){
var start = Date.now()
location.replace("/install-mcu.zip?tm="+start)
},
generateSetup(){
this.$store.commit("patient/update_patients", [])
this.$store.commit("patient/update_total_patients", 0)
this.$store.dispatch("patient/generatesetup", {
setupcode : this.setupcode
})
},
editRow(row){
console.log(row)
this.$store.commit("patient/update_act", 'edit')
this.$store.commit("patient/update_xid", row.McuOfflinePrepareID)
this.$store.commit("patient/update_companies", [{id:row.McuOfflinePrepareM_CompanyID,name:row.M_CompanyName}])
this.$store.commit("patient/update_company", {id:row.McuOfflinePrepareM_CompanyID,name:row.M_CompanyName})
this.$store.commit("patient/update_mous", row.allmous)
this.$store.commit("patient/update_mou", {})
this.$store.commit("patient/update_selected_mous", row.mous)
this.$store.commit("patient/update_selected_doctors", row.doctors)
this.$store.commit("patient/update_start_date", moment(row.McuOfflinePrepareStartDate).format('YYYY-MM-DD'))
this.$store.commit("patient/update_end_date", moment(row.McuOfflinePrepareEndDate).format('YYYY-MM-DD'))
},
isSelected(p) {
return p.M_PatientID == this.$store.state.patient.selected_patient.M_PatientID
},
searchPatient() {
this.$store.dispatch("patient/search", {
status: this.status,
current_page: 1,
lastid: -1
})
this.$store.commit("patient/update_current_page", 1)
},
selectMe(pat) {
if (this.$store.state.patient.no_save == 0) {
this.$store.commit("patient/update_selected_patient", pat)
} else {
this.$store.commit("patient/update_open_alert_confirmation", true)
}
},
closeAlertConfirmation() {
this.$store.commit("patient/update_open_alert_confirmation", false)
},
forgetAlertConfirmation() {
this.$store.commit("patient/update_no_save", 0)
this.$store.commit("patient/update_open_alert_confirmation", false)
},
updateAlert_success(val) {
this.$store.commit("patient/update_alert_success", val)
},
closeDialogSuccess() {
let arrpatient = this.$store.state.patient.patients
var idx = _.findIndex(arrpatient, item => item.M_PatientID === this.$store.state.patient.last_id)
console.log(idx)
this.$store.dispatch("patient/search", {
status: this.status,
current_page: this.curr_page,
lastid: idx
})
this.$store.commit("patient/update_dialog_success", false)
},
setNewSetup(){
this.$store.commit("patient/update_act", 'new')
this.$store.commit("patient/update_xid", -1)
this.$store.commit("patient/update_company", {})
this.$store.commit("patient/update_mous", [])
this.$store.commit("patient/update_mou", {})
this.$store.commit("patient/update_default_mou", {})
this.$store.commit("patient/update_default_doctor", {})
this.$store.commit("patient/update_selected_mous", [])
this.$store.commit("patient/update_selected_doctors", [])
this.$store.commit("patient/update_start_date", moment(new Date()).format('YYYY-MM-DD'))
this.$store.commit("patient/update_end_date", moment(new Date()).format('YYYY-MM-DD'))
},
deleteData(row) {
this.$store.commit("patient/update_selected_patient", row)
console.log(this.$store.state.patient.selected_patient)
let msg = "Yakin, akan menghapus data setup " + this.$store.state.patient.selected_patient.McuOfflinePrepareCode + " ?"
this.$store.commit("patient/update_msg_confirmation_delete", msg)
this.$store.commit("patient/update_dialog_confirmation_delete", true)
},
doDeleteData() {
var prm = {}
prm.id = this.$store.state.patient.selected_patient.McuOfflinePrepareID
prm.code = this.$store.state.patient.selected_patient.McuOfflinePrepareCode
console.log(prm)
this.$store.dispatch("patient/delete", prm)
}
},
computed: {
opendialoginfo: {
get() {
return this.$store.state.patient.open_dialog_info
},
set(val) {
this.$store.commit("patient/update_open_dialog_info",false)
}
},
msginfo: {
get() {
return this.$store.state.patient.msg_info
},
set(val) {
this.$store.commit("patient/update_msg_info",false)
}
},
xidentifer() {
return this.$store.state.patient.error_identifier
},
kelainanCount() {
return this.$store.state.patient.kelainan_count;
},
activeEncryptKey() {
return this.$store.state.patient.active_encrypt_key;
},
xmgmmcu() {
return this.$store.state.patient.mgmmcu
},
selected_mgmmcu: {
get() {
return this.$store.state.patient.selected_mgmmcu
},
set(val) {
this.$store.commit("patient/update_selected_mgmmcu", val)
this.$store.commit("patient/update_selected_mgm_mcu_id", val ? val.Mgm_McuID : null)
// Pastikan 'val' adalah objek yang valid dan memiliki ID
if (val && val.Mgm_McuID) {
this.$store.dispatch("patient/getcountkelainan", {
Mgm_McuID: val.Mgm_McuID,
company_id: val.Mgm_McuCorporateID
});
this.$store.dispatch("patient/getActiveEncryptKey", {
Mgm_McuID: val.Mgm_McuID
});
this.$store.dispatch("patient/getKelainanSelected", {
mgm_mcu_id: val.Mgm_McuID
});
}
}
},
setupcode: {
get() {
return this.$store.state.patient.setupcode
},
set(val) {
this.$store.commit("patient/update_setupcode", val)
}
},
xsetup() {
return this.$store.state.patient.data_setup
},
dialogconfirmationdelete: {
get() {
return this.$store.state.patient.dialog_confirmation_delete
},
set(val) {
this.$store.commit("patient/update_dialog_confirmation_delete", val)
}
},
msgconfirmationdelete() {
return this.$store.state.patient.msg_confirmation_delete
},
status: {
get() {
return this.$store.state.patient.status
},
set(val) {
this.$store.commit("patient/update_status", val)
this.$store.dispatch("patient/search", {
status: val,
current_page: this.curr_page,
lastid: -1
})
}
},
dialogsuccess: {
get() {
return this.$store.state.patient.dialog_success
},
set(val) {
this.$store.commit("patient/update_dialog_success", val)
}
},
msgsuccess() {
return this.$store.state.patient.msg_success
},
snackbar: {
get() {
return this.$store.state.patient.alert_success
},
set(val) {
this.$store.commit("patient/update_alert_success", val)
}
},
isLoading() {
return this.$store.state.patient.search_status == 1
},
openalertconfirmation: {
get() {
return this.$store.state.patient.open_alert_confirmation
},
set(val) {
this.$store.commit("patient/update_open_alert_confirmation", val)
}
},
loading_save: {
get() {
return this.$store.state.patient.loading_save
},
set(val) {
this.$store.commit("patient/update_loading_save", val)
},
},
},
filters: {
capitalize: function (str) {
return str.charAt(0).toUpperCase() + str.slice(1)
}
},
data() {
return {
files: [],
dialog_identifier: false,
channel_name: '',
channel_fields: [],
channel_entries: [],
parse_header: [],
parse_csv: [],
sortOrders:{},
sortKey: '',
statuses:[{id:"N",name:"Belum di download"},{id:"Y",name:"Sudah di download"}],
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
items: [],
name: '',
snorm: '',
page: 1,
headers: [
{
text: "NAMA",
align: "left",
sortable: false,
value: "mr",
width: "50%",
class: "pa-2 deep-orange accent-1 white--text"
},
{
text: "KTP",
align: "left",
sortable: false,
value: "lab",
width: "50%",
class: "pa-2 deep-orange accent-1 white--text"
}
],
pagination: {
descending: false,
page: 1,
rowsPerPage: 5,
sortBy: 'M_PatientName',
totalItems: this.$store.state.patient.total_patients
}
};
},
}
</script>

View File

@@ -0,0 +1,3 @@
PID,NAMA,TANGGAL_LAHIR,JENIS_KELAMIN,NIK,JABATAN,EMAIL,HP,LOKASI,JOB,KEDUDUKAN
,AA,12-09-2001,P,,GURU,,,,,
,BB,14-01-1994,L,12.14.44.55,DIRKEU,,,,,
1 PID NAMA TANGGAL_LAHIR JENIS_KELAMIN NIK JABATAN EMAIL HP LOKASI JOB KEDUDUKAN
2 AA 12-09-2001 P GURU
3 BB 14-01-1994 L 12.14.44.55 DIRKEU

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,118 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>One</title>
<link rel="stylesheet" href="../../../libs/vendor/css/google-fonts.css">
<link rel="stylesheet" href="../../../libs/vendor/css/icomoon-fonts.css">
<link rel="stylesheet" href="../../../libs/vendor/css/vuetify.min.css">
</head>
<body>
<div v-cloak id="app">
<v-app id="smartApp" >
<one-navbar></one-navbar>
<v-content style="background:#F5E8DF!important" >
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
<v-layout row wrap >
<v-flex xs3 class="left" fill-height pa-1>
<one-md-patient-list></one-md-patient-list>
</v-flex>
<v-flex xs9 class="right" fill-height pa-1>
<one-md-patient-detail></one-md-patient-detail>
</v-flex>
</v-layout>
</v-container>
</v-content>
<one-footer> </one-footer>
</v-app>
</div>
<!-- Vendor -->
<script src="../../../libs/vendor/moment.min.js"></script>
<script src="../../../libs/vendor/numeral.min.js"></script>
<script src="../../../libs/vendor/moment-locale-id.js"></script>
<script src="../../../libs/vendor/lodash.js"></script>
<script src="../../../libs/vendor/axios.min.js"></script>
<script src="../../../libs/vendor/vue.js"></script>
<script src="../../../libs/vendor/vuex.js"></script>
<script src="../../../libs/vendor/vuetify.js"></script>
<script src="../../../libs/vendor/httpVueLoader.js"></script>
<script src="../../../libs/one_global.js"></script>
<script src="../../../libs/vendor/sheetjs-master/xlsx.full.min.js"></script>
<!-- App Script -->
<?php
$ts = "?ts=" . Date("ymdhis");
?>
<script type="module">
window.calculate_age = function (inp_dob) {
var now = moment(new Date())
var dob = moment(new Date(inp_dob))
var year = now.diff(dob,'years')
dob.add(year,'years')
var month = now.diff(dob,'months')
dob.add(month,'months')
var day = now.diff(dob,'days')
if (isNaN(year)) return ''
return `${year} tahun ${month} bulan ${day} hari`
}
import { store } from './store.js<?php echo $ts ?>';
//for testing
window.store = store;
var ts = "?ts=" + Date.now();
new Vue({
store,
el: '#app',
methods: {
tab_selected : function(tab) {
return this.$store.state.tab_selected == tab
}
},
mounted: function() {
var url_string = window.location.href
var url = new URL(url_string);
var code = url.searchParams.get("code");
if (code != null) {
this.$store.commit('order/update_setupcode', code)
this.$store.commit("patient/update_patients", [])
this.$store.commit("patient/update_total_patients", 0)
this.$store.commit("patient/update_current_page", 1)
this.$store.dispatch("patient/generatesetup", {
setupcode : code
})
}
if (!one_token())
location.replace('/one-ui/test/vuex/one-login')
},
components: {
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
'one-md-patient-list': httpVueLoader('./components/oneMdPatientList.vue' + ts),
'one-md-patient-detail': httpVueLoader('./components/oneMdPatientDetail.vue'),
'one-md-patient-address': httpVueLoader('./components/oneMdPatientAddress.vue')
}
})
</script>
<style>
[v-cloak] {
display: none
}
.left {
}
.right {
}
</style>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,27 @@
// State
// data ...
// Mutations
//
//
// Actions
import patient from "./modules/patient.js";
import system from "../../../apps/modules/system/system.js";
export const store = new Vuex.Store({
modules: {
patient: patient,
system: system
},
state: {
tab_selected: 'pasien-dokter'
},
mutations: {
change_tab(state, ntab) {
state.tab_selected = ntab
}
},
actions: {
change_tab(context, ntab) {
context.commit('change_tab', ntab)
}
}
});