Commit 92a6d3ca authored by Reza Sahebgharan's avatar Reza Sahebgharan

feat(worklist4hislink): write getworklist for each his

parent 3baca37d
Pipeline #852 passed with stages
in 56 minutes and 53 seconds
......@@ -306,7 +306,6 @@ export default {
hislink() {
return HisLink.find({}).fetch();
},
clients() {
return Client.find({}).fetch();
}
......
......@@ -119,6 +119,9 @@
>
<strong>{{$t("HISLink.authenticateBtn")}}</strong>
</v-btn>
<v-btn color="rgb(94, 181, 177,.85)" class="white--text" @click="getWorklist">
<strong>{{$t("HISLink.getWorklistBtn")}}</strong>
</v-btn>
</v-col>
</v-row>
</v-card-actions>
......@@ -146,13 +149,22 @@
></v-data-table>
</v-col>
</v-row>
<his-worklist
:HisWorklistDialogProp="HisWorklistDialog"
:closeDialog="closeHisWorklistMethod"
:selectedBrand="selectedBrand"
></his-worklist>
</v-container>
</template>
<script>
import HisLink from "../../imports/api/collections/hislink.js";
import Brands from "../../imports/api/collections/brands.js";
import { Meteor } from "meteor/meteor";
import HisWorklist from "./HisWorklist.vue";
export default {
components: {
HisWorklist
},
data() {
return {
sortByTable: undefined,
......@@ -178,7 +190,9 @@ export default {
snackbar: false,
alertSnackbar: false,
alertText: "",
loading: false
loading: false,
HisWorklistDialog: false,
selectedBrand: null
};
},
mounted() {
......@@ -228,6 +242,10 @@ export default {
}
},
methods: {
closeHisWorklistMethod() {
this.HisWorklistDialog = false;
this.selectedBrand = null;
},
clickRow(item) {
if (
this.selectedItemInTable.length > 0 &&
......@@ -364,10 +382,22 @@ export default {
}
me.alertSnackbarMethod(
JSON.parse(result.content).Result == true
? me.$t("HISLink.hislinkAuthenticateSuccess")
? me.$t("HISLink.hislinkAuthenticateSuccess")
: me.$t("HISLink.hislinkAuthenticateFailed")
);
});
},
getWorklist() {
let me = this;
if (this.selectedItemInTable.length == 0) {
me.alertSnackbarMethod(me.$t("HISLink.hislinkSelectStatement"));
return;
}
let Brand = this.selectedItemInTable[0].Brand;
this.selectedBrand = Brand;
this.HisWorklistDialog = true;
}
},
meteor: {
......
<template>
<v-dialog v-model="HisWorklistDialog" max-width="900px">
<v-card>
<v-progress-linear
:active="HisWorklistLoading"
:indeterminate="HisWorklistLoading"
absolute
top
color="cyan lighten-2"
></v-progress-linear>
<v-card-title>
<v-icon class="mr-1" @click="internalCloseDialog">close</v-icon>
<span>{{$t("HisWorklist.title")}}</span>
</v-card-title>
<v-card-text class="ma-0 pa-0" v-if="$vuetify.breakpoint.mdAndUp">
<v-container class="cyan lighten-2" style="border-radius: 5px;">
<v-card class="pa-3 pr-6 ma-4">
<!-- <v-row dense>
<v-col cols="9">
<v-autocomplete :items="itemsOfBrands" label="Brand" v-model="selectedBrand"></v-autocomplete>
</v-col>
</v-row>-->
<v-row dense>
<v-data-table
:headers="headerOfTable"
:items="itemsOfTable"
item-key="_id"
class="elevation-1"
style="width:100%"
fixed-header
hide-default-footer
disable-pagination
height="600px"
></v-data-table>
</v-row>
</v-card>
</v-container>
</v-card-text>
</v-card>
</v-dialog>
</template>
<script>
import Brands from "../../imports/api/collections/brands.js";
import BrandCollections from "../../imports/api/collections/worklist4hislink.js";
import { Mongo } from "meteor/mongo";
export default {
props: ["HisWorklistDialogProp", "closeDialog", "selectedBrand"],
data: () => ({
HisWorklistLoading: false,
HisWorklistDialog: false
// selectedBrand: null
}),
computed: {
itemsOfBrands() {
if (this.brands && this.brands.length > 0) {
return this.brands.map(brand => {
return brand.Name;
});
}
return [];
},
itemsOfTable() {
if (this.worklist4hislink && this.worklist4hislink.length > 0) {
let worklistArray = [];
for (let worklist of this.worklist4hislink) {
let tempWorklist = {};
for (let prop in worklist) {
tempWorklist[prop] = JSON.stringify(worklist[prop]);
}
worklistArray.push(tempWorklist);
}
return worklistArray;
}
return [];
},
headerOfTable() {
if (this.worklist4hislink && this.worklist4hislink.length > 0) {
let headerNames = [];
let worklist = this.worklist4hislink[0];
for (let prop in worklist) {
headerNames.push({
text: prop,
value: prop,
class: "text-center",
width: 180
});
}
return headerNames;
}
return [];
}
},
watch: {
"$subReady.worklist4hislink"(ready) {
this.HisWorklistLoading = false;
},
HisWorklistDialog(newvalue, oldvalue) {
if (newvalue == false) {
this.closeDialog();
} else {
this.HisWorklistLoading = true;
}
},
HisWorklistDialogProp(newvalue, oldvalue) {
this.HisWorklistDialog = newvalue;
}
},
methods: {
internalCloseDialog() {
this.HisWorklistDialog = false;
}
},
meteor: {
$subscribe: {
// brands: [],
worklist4hislink: function() {
return [this.selectedBrand];
}
},
// brands() {
// return Brands.find({}).fetch();
// },
worklist4hislink() {
if (this.selectedBrand == null) return [];
return BrandCollections[this.selectedBrand].find({}).fetch();
}
}
};
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<div>
<v-btn color="rgb(94, 181, 177,.85)" class="white--text ma-3" @click="registerDialog=true">
<strong>{{$t("WorkList.Register")}}</strong>
</v-btn>
<v-dialog v-model="registerDialog" max-width="900px">
<v-card>
<v-progress-linear
:active="registerLoading"
:indeterminate="registerLoading"
absolute
top
color="cyan lighten-2"
></v-progress-linear>
<v-card-title>
<v-icon @click="closeRegisterPatient" class="mr-1">close</v-icon>
<span>{{$t("WorkList.RegisterPatient")}}</span>
</v-card-title>
<v-card-text class="ma-0 pa-0" v-if="$vuetify.breakpoint.mdAndUp">
<v-container class="cyan lighten-2" style="border-radius: 5px;">
<v-card class="pa-3 pr-6 ma-4">
<v-row dense>
<v-col md="4">
<v-text-field
label="FarsiFirstName"
v-model="registerPatient.FarsiFirstName"
type="text"
></v-text-field>
</v-col>
<v-col md="4">
<v-text-field
label="FarsiLastName"
v-model="registerPatient.FarsiLastName"
type="text"
></v-text-field>
</v-col>
<v-col md="4">
<v-text-field label="HISID" v-model="registerPatient.HISID" type="text"></v-text-field>
</v-col>
<v-col md="4">
<v-text-field label="Modality" v-model="registerPatient.Modality" type="text"></v-text-field>
</v-col>
<v-col md="4">
<v-text-field label="PatientAge" v-model="registerPatient.PatientAge" type="text"></v-text-field>
</v-col>
<v-col md="4">
<v-autocomplete
:items="itemsOfDeviceMap"
label="DeviceMap"
v-model="selectedDeviceMap"
item-text="GroupName"
item-value="GroupName"
return-object
></v-autocomplete>
</v-col>
</v-row>
</v-card>
</v-container>
</v-card-text>
<v-card-text class="ma-0 pa-0" v-else>
<v-container class="cyan lighten-2" style="border-radius: 5px;">
<v-card class="pa-3 pr-6 ma-4">
<v-row dense>
<v-col cols="6">
<v-text-field
label="FarsiFirstName"
type="text"
v-model="registerPatient.FarsiFirstName"
></v-text-field>
</v-col>
<v-col cols="6">
<v-text-field
label="FarsiLastName"
type="text"
v-model="registerPatient.FarsiLastName"
></v-text-field>
</v-col>
<v-col cols="6">
<v-text-field label="HISID" type="text" v-model="registerPatient.HISID"></v-text-field>
</v-col>
<v-col cols="6">
<v-text-field label="Modality" type="text" v-model="registerPatient.Modality"></v-text-field>
</v-col>
<v-col cols="6">
<v-text-field label="PatientAge" type="text" v-model="registerPatient.PatientAge"></v-text-field>
</v-col>
<v-col cols="6">
<v-autocomplete
:items="itemsOfDeviceMap"
label="DeviceMap"
v-model="selectedDeviceMap"
item-text="GroupName"
item-value="CodeInHIS"
return-object
></v-autocomplete>
</v-col>
</v-row>
</v-card>
</v-container>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
color="blue darken-1"
class="white--text"
@click="registerPatientMethod"
>{{$t("WorkList.CreatePatient")}}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</template>
<script>
import Devicemap from "../../imports/api/collections/devicemap.js";
export default {
data() {
return {
registerPatient: {
FarsiFirstName: "",
FarsiLastName: "",
HISID: "",
Modality: "",
PatientAge: ""
},
registerLoading: false,
registerDialog: false,
selectedDeviceMap: null
};
},
computed: {
itemsOfDeviceMap() {
if (this.devicemaps && this.devicemaps.length > 0) {
return this.devicemaps;
}
return [];
}
},
methods: {
closeRegisterPatient() {
this.registerDialog = false;
},
registerPatientMethod(item) {
let me = this;
this.registerLoading = true;
let registerPatient = {
...this.registerPatient
}
if (this.selectedDeviceMap) {
registerPatient.CodeInHIS = this.selectedDeviceMap.CodeInHIS;
}
Meteor.call("Register", registerPatient, function(err, result) {
me.registerLoading = false;
me.registerPatient = {
FarsiFirstName: "",
FarsiLastName: "",
HISID: "",
Modality: "",
PatientAge: ""
};
me.closeRegisterPatient();
});
}
},
meteor: {
$subscribe: {
devicemaps: []
},
devicemaps() {
return Devicemap.find({}).fetch();
}
}
};
</script>
<style scoped>
</style>
\ No newline at end of file
......@@ -83,96 +83,7 @@
<strong>{{$t('WorkList.editBtn')}}</strong>
</v-btn>
<v-divider class="mx-4" inset vertical></v-divider>
<v-btn color="rgb(94, 181, 177,.85)" class="white--text" @click="registerDialog=true">
<strong>{{$t("WorkList.Register")}}</strong>
</v-btn>
<v-dialog v-model="registerDialog" max-width="900px">
<v-card>
<v-progress-linear
:active="registerLoading"
:indeterminate="registerLoading"
absolute
top
color="cyan lighten-2"
></v-progress-linear>
<v-card-title>
<v-icon @click="closeRegisterPatient" class="mr-1">close</v-icon>
<span>{{$t("WorkList.RegisterPatient")}}</span>
</v-card-title>
<v-card-text class="ma-0 pa-0" v-if="$vuetify.breakpoint.mdAndUp">
<v-container class="cyan lighten-2" style="border-radius: 5px;">
<v-card class="pa-3 pr-6 ma-4">
<v-row dense>
<v-col md="4">
<v-text-field
label="FarsiFirstName"
v-model="registerPatient.FarsiFirstName"
type="text"
></v-text-field>
</v-col>
<v-col md="4">
<v-text-field
label="FarsiLastName"
v-model="registerPatient.FarsiLastName"
type="text"
></v-text-field>
</v-col>
<v-col md="4">
<v-text-field label="HISID" v-model="registerPatient.HISID" type="text"></v-text-field>
</v-col>
<v-col md="4">
<v-text-field
label="Modality"
v-model="registerPatient.Modality"
type="text"
></v-text-field>
</v-col>
<v-col md="4">
<v-text-field
label="PatientAge"
v-model="registerPatient.PatientAge"
type="text"
></v-text-field>
</v-col>
</v-row>
</v-card>
</v-container>
</v-card-text>
<v-card-text class="ma-0 pa-0" v-else>
<v-container class="cyan lighten-2" style="border-radius: 5px;">
<v-card class="pa-3 pr-6 ma-4">
<v-row dense>
<v-col cols="6">
<v-text-field label="FarsiFirstName" type="text"></v-text-field>
</v-col>
<v-col cols="6">
<v-text-field label="FarsiLastName" type="text"></v-text-field>
</v-col>
<v-col cols="6">
<v-text-field label="HISID" type="text"></v-text-field>
</v-col>
<v-col cols="6">
<v-text-field label="Modality" type="text"></v-text-field>
</v-col>
<v-col cols="6">
<v-text-field label="PatientAge" type="text"></v-text-field>
</v-col>
</v-row>
</v-card>
</v-container>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
color="blue darken-1"
class="white--text"
@click="registerPatientMethod"
>{{$t("WorkList.CreatePatient")}}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="editDialog" max-width="900px">
<v-card class="grey lighten-4">
......@@ -185,7 +96,7 @@
></v-progress-linear>
<v-card-title>
<v-icon @click="close" class="mr-1">close</v-icon>
<span >{{$t("WorkList.EditRegisterPatient")}}</span>
<span>{{$t("WorkList.EditRegisterPatient")}}</span>
</v-card-title>
<v-card-text class="ma-0 pa-0" v-if="$vuetify.breakpoint.mdAndUp">
......@@ -601,25 +512,10 @@
<script>
import Worklist from "../../imports/api/collections/worklist.js";
import DeviceCode from "../../imports/api/collections/devicecode.js";
import { Tracker } from "meteor/tracker";
import HisWorklist from "./HisWorklist.vue";
export default {
methods: {
registerPatientMethod(item) {
debugger;
let me = this;
this.registerLoading = true;
Meteor.call("Register", this.registerPatient, function(err, result) {
me.registerLoading = false;
me.registerPatient = {
FarsiFirstName: "",
FarsiLastName: "",
HISID: "",
Modality: "",
PatientAge: ""
};
me.closeRegisterPatient();
});
},
activerow: function(item) {
if (this.sortByTable && this.sortByTable.length > 0) {
const items = this.patientsOfTable.sort((a, b) => {
......@@ -713,9 +609,7 @@ export default {
close() {
this.editDialog = false;
},
closeRegisterPatient() {
this.registerDialog = false;
},
nextPatient() {
let index = this.sortedItems.findIndex(
patient => patient._id == this.selectedItem._id
......@@ -829,17 +723,9 @@ export default {
FarsiLastNameParts1: "FarsiLastNameParts1",
FarsiLastNameParts2: "FarsiLastNameParts2"
},
registerPatient: {
FarsiFirstName: "",
FarsiLastName: "",
HISID: "",
Modality: "",
PatientAge: ""
},
registerLoading: false,
selectedItem: undefined,
sortedItems: undefined,
registerDialog: false
sortedItems: undefined
}),
mounted() {
Meteor.call("getDeviceCodes");
......@@ -919,7 +805,7 @@ export default {
watch: {
"$subReady.worklist"(ready) {},
selectedDevice(newDevice, oldDevice) {
console.log(newDevice)
console.log(newDevice);
if (this.selectedDevice && this.selectedDevice.GroupName) {
let self = this;
this.fetchWorklistLoading = true;
......
......@@ -87,6 +87,7 @@ const messages = {
activeBtn: "Active",
deactiveBtn: "Deactive",
authenticateBtn: "Authenticate",
getWorklistBtn: "Worklist",
hislinkSelectStatement: "please select one of hislinks",
hislinkDeleteStatement: "HisLink has been deleted",
hislinkActiveStatement: "HisLink has been activated",
......@@ -129,8 +130,10 @@ const messages = {
editBtn: "Edit",
userSelectStatement: "please select one of users",
userDeleteStatement: "user has been deleted",
},
HisWorklist: {
title: "Worklist"
}
},
'fa': {
Login: {
......@@ -217,6 +220,7 @@ const messages = {
activeBtn: "فعال",
deactiveBtn: "غیرفعال",
authenticateBtn: "تصدیق کردن",
getWorklistBtn: "لیست بیماران",
hislinkSelectStatement: "لطفا یکی از hislink ها را انتخاب نمایید",
hislinkDeleteStatement: "HISLink حذف گردید",
hislinkActiveStatement: "HISLink فعال شد",
......@@ -259,6 +263,9 @@ const messages = {
editBtn: "ویرایش",
userSelectStatement: "لطفا یکی از کاربر ها را انتخاب نمایید",
userDeleteStatement: "کاربر حذف گردید",
},
HisWorklist: {
title: "لیست بیماران"
}
}
......
......@@ -99,6 +99,7 @@ import ChangePassword from '../views/ChangePassword.vue';
import Main from '../views/Main.vue';
import EditWorkList from '../components/EditWorkList.vue';
import RegisterPatient from '../components/RegisterPatient.vue';
import WorkList from '../components/Worklist.vue';
import HisLink from '../components/HisLink.vue';
import DeviceMap from '../components/DeviceMap.vue';
......@@ -141,7 +142,8 @@ const routes = [{
name: "worklist",
components: {
default: WorkList,
// edit_worklist: WorkList
register_patient: RegisterPatient
// edit_worklist: WorkList
}
}, {
path: "hislink",
......
......@@ -4,6 +4,8 @@
<v-app-bar app clipped-left color="teal lighten-3" dark>
<v-app-bar-nav-icon @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
<v-toolbar-title class="red--text">Karname</v-toolbar-title>
<router-view name="register_patient"></router-view>
<v-spacer></v-spacer>
</v-app-bar>
<v-navigation-drawer v-model="drawer" app clipped>
......@@ -65,17 +67,26 @@
import { Fragment } from "vue-fragment";
import AppFooter from "../components/AppFooter.vue";
import { Meteor } from "meteor/meteor";
import RegisterPatient from "../components/RegisterPatient.vue";
export default {
components: {
"app-footer": AppFooter,
fragment: Fragment
fragment: Fragment,
RegisterPatient
},
props: {
source: String
},
methods:{
},
computed: {
// getCurrentRoute(){
// debugger
// return this.$router.currentRoute.name == "worklist"
// },
updatedItems() {
debugger;
if (
Meteor.userId() &&
this.users.length > 0 &&
......@@ -87,7 +98,6 @@ export default {
return this.items;
}
},
data: () => ({
drawer: null,
drawerRight: null,
......
import { Mongo } from 'meteor/mongo';
import { Meteor } from 'meteor/meteor';
import { HTTP } from 'meteor/http';
let collections = {};
if (Meteor.isServer) {
debugger
const result = HTTP.call('GET', `${Meteor.settings.worklistUrl}/HISIntegration.svc/rest/GetHISBrandsRest`);
let brandsHttpResult = JSON.parse(result.content);
let collectionNames = brandsHttpResult.Items.map(brandObj => {
return brandObj.Name
})
// let collectionNames = ["TestWLS"];
for (let collName of collectionNames) {
collections[collName] = new Mongo.Collection(collName);
}
}
if (Meteor.isClient || Meteor.isCordova) {
Meteor.call("getBrandsName", function(err, result) {
let collectionNames = result;
// let collectionNames = ["TestWLS"];
for (let collName of collectionNames) {
collections[collName] = new Mongo.Collection(collName);
}
});
}
export default collections;
\ No newline at end of file
......@@ -4,7 +4,7 @@ import { HTTP } from 'meteor/http';
import Brands from '../collections/brands.js';
Meteor.methods({
'getBrands' () {
debugger;
this.unblock();
if (this.userId) {
try {
......@@ -22,5 +22,22 @@ Meteor.methods({
return false;
}
}
},
"getBrandsName" () {
this.unblock();
if (this.userId) {
try {
const result = HTTP.call('GET', `${Meteor.settings.worklistUrl}/HISIntegration.svc/rest/GetHISBrandsRest`);
let brandsHttpResult = JSON.parse(result.content);
return brandsHttpResult.Items.map(brandObj => {
return brandObj.Name
})
} catch (e) {
// Got a network error, timeout, or HTTP error in the 400 or 500 range.
return false;
}
}
}
});
\ No newline at end of file
import { check } from 'meteor/check';
import { Mongo } from 'meteor/mongo'
import Collections from '../../collections/worklist4hislink.js';
Meteor.publish("worklist4hislink", function(brand) {
debugger
if (brand == null) {
return [];
}
if (!this.userId) {
return this.ready();
}
const userid = this.userId;
check(brand, String);
// let Worklist = new Mongo.Collection(brand);
// console.log(Worklist.find({ _userid: userid, _devicemap: devicemap }).fetch())
return Collections[brand].find({}, {
reactive: true,
disableOplog: false,
pollingThrottleMs: 1000,
pollingIntervalMs: 1000
});
});
\ No newline at end of file
......@@ -9,6 +9,7 @@ import '../imports/api/methods/clients.js';
import '../imports/api/methods/devicemap.js';
import '../imports/api/methods/users.js'
import '../imports/api/server/publications/worklist.js';
import '../imports/api/server/publications/devicecode.js';
import '../imports/api/server/publications/hislink.js';
......@@ -16,6 +17,7 @@ import '../imports/api/server/publications/brands.js';
import '../imports/api/server/publications/clients.js';
import '../imports/api/server/publications/devicemap.js';
import '../imports/api/server/publications/users.js';
import '../imports/api/server/publications/worklist4hislink.js'
import { Accounts } from "meteor/accounts-base";
......@@ -26,4 +28,6 @@ Meteor.startup(() => {
username: 'marcoadmin',
password: 'sysAdmin4.21'
});
});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment