Commit b8159c9f authored by Reza Sahebgharan's avatar Reza Sahebgharan

create DockerFile and docker-compose.yml WAD-6915

parent c0f88371
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
] ]
], ],
"plugins": [ "plugins": [
[ [
"@babel/plugin-transform-async-to-generator" "@babel/plugin-transform-async-to-generator"
], ],
......
node_modules/
.meteor/local/
.vscode/
...@@ -11,8 +11,8 @@ reactive-var@1.0.11 # Reactive variable for tracker ...@@ -11,8 +11,8 @@ reactive-var@1.0.11 # Reactive variable for tracker
tracker@1.2.0 # Meteor's client-side reactive programming library tracker@1.2.0 # Meteor's client-side reactive programming library
shell-server@0.4.0 # Server-side component of the `meteor shell` command shell-server@0.4.0 # Server-side component of the `meteor shell` command
http
accounts-password accounts-password
ardatan:webpack ardatan:webpack
ardatan:webpack-dev-middleware ardatan:webpack-dev-middleware
http
...@@ -57,11 +57,9 @@ ...@@ -57,11 +57,9 @@
v-model="selectedPatientInTable" v-model="selectedPatientInTable"
:headers="headerOfTable" :headers="headerOfTable"
:items="patientsOfTable" :items="patientsOfTable"
single-select
item-key="_id" item-key="_id"
class="elevation-1" class="elevation-1"
style="width:100%" style="width:100%"
show-select
fixed-header fixed-header
hide-default-footer hide-default-footer
disable-pagination disable-pagination
...@@ -80,13 +78,9 @@ ...@@ -80,13 +78,9 @@
<v-toolbar flat color="white"> <v-toolbar flat color="white">
<!-- <v-toolbar-title>{{devicemap==""?$t("WorkList.noDevicemap"):devicemap}}</v-toolbar-title> --> <!-- <v-toolbar-title>{{devicemap==""?$t("WorkList.noDevicemap"):devicemap}}</v-toolbar-title> -->
<v-btn <v-btn color="rgb(94, 181, 177,.85)" class="white--text" @click="editPatients()">
color="rgb(94, 181, 177,.85)" <v-icon small left>edit</v-icon>
class="white--text" <strong>{{$t('WorkList.editBtn')}}</strong>
@click="editPatients()"
>
<v-icon small left>edit</v-icon>
<strong>{{$t('WorkList.editBtn')}}</strong>
</v-btn> </v-btn>
<v-divider class="mx-4" inset vertical></v-divider> <v-divider class="mx-4" inset vertical></v-divider>
...@@ -399,6 +393,117 @@ ...@@ -399,6 +393,117 @@
<!-- <template v-slot:item.Action="{ item }"> <!-- <template v-slot:item.Action="{ item }">
<v-icon small @click="editPatients(item)">edit</v-icon> <v-icon small @click="editPatients(item)">edit</v-icon>
</template>--> </template>-->
<template v-slot:item="{item}">
<tr
v-if="$vuetify.breakpoint.mdAndUp"
@click="activerow(item)"
:class="{'cyan lighten-4': item._id===selectedId}"
>
<td>{{ item.AdmissionID }}</td>
<td class="text-xs-right">
<v-btn
text
tile
@click="activerow(item);editPatients()"
:class="{
'red--text': item.EnglishFirstName.includes('?'),
'blue--text':!item.EnglishFirstName.includes('?')
}"
>{{item.EnglishFirstName}}</v-btn>
</td>
<td class="text-xs-right">
<v-btn
text
tile
@click="activerow(item);editPatients()"
:class="{
'red--text': item.EnglishLastName.includes('?'),
'blue--text':!item.EnglishLastName.includes('?')
}"
>{{item.EnglishLastName}}</v-btn>
</td>
<td class="text-xs-right">{{ item.FarsiFirstName }}</td>
<td class="text-xs-right">{{ item.FarsiLastName }}</td>
<td class="text-xs-right">{{ item.HISID }}</td>
<td class="text-xs-right">{{ item.Modality }}</td>
<td class="text-xs-right">{{ item.PatientAge }}</td>
</tr>
<tr v-else @click="activerow(item)" :class="{'cyan lighten-4': item._id===selectedId}">
<td class="v-data-table__mobile-row">
<div class="v-data-table__mobile-row__wrapper">
<div class="v-data-table__mobile-row__header">AdmissionID</div>
<div class="v-data-table__mobile-row__cell">{{item.AdmissionID}}</div>
</div>
</td>
<td class="v-data-table__mobile-row">
<div class="v-data-table__mobile-row__wrapper flex-wrap">
<div class="v-data-table__mobile-row__header">EnglishFirstName</div>
<div class="v-data-table__mobile-row__cell">
<v-btn
:class="{
'red--text': item.EnglishFirstName.includes('?'),
'blue--text':!item.EnglishFirstName.includes('?'),
'ma-0':true
}"
text
tile
@click="activerow(item);editPatients()"
>{{item.EnglishFirstName}}</v-btn>
</div>
</div>
</td>
<td class="v-data-table__mobile-row">
<div class="v-data-table__mobile-row__wrapper flex-wrap">
<div class="v-data-table__mobile-row__header">EnglishLastName</div>
<div class="v-data-table__mobile-row__cell">
<v-btn
:class="{
'red--text': item.EnglishLastName.includes('?'),
'blue--text':!item.EnglishLastName.includes('?'),
'ma-0':true
}"
text
tile
@click="activerow(item);editPatients()"
>{{item.EnglishLastName}}</v-btn>
</div>
</div>
</td>
<td class="v-data-table__mobile-row">
<div class="v-data-table__mobile-row__wrapper">
<div class="v-data-table__mobile-row__header">FarsiFirstName</div>
<div class="v-data-table__mobile-row__cell">{{item.FarsiFirstName}}</div>
</div>
</td>
<td class="v-data-table__mobile-row">
<div class="v-data-table__mobile-row__wrapper">
<div class="v-data-table__mobile-row__header">FarsiLastName</div>
<div class="v-data-table__mobile-row__cell">{{item.FarsiLastName}}</div>
</div>
</td>
<td class="v-data-table__mobile-row">
<div class="v-data-table__mobile-row__wrapper">
<div class="v-data-table__mobile-row__header">HISID</div>
<div class="v-data-table__mobile-row__cell">{{item.HISID}}</div>
</div>
</td>
<td class="v-data-table__mobile-row">
<div class="v-data-table__mobile-row__wrapper">
<div class="v-data-table__mobile-row__header">Modality</div>
<div class="v-data-table__mobile-row__cell">{{item.Modality}}</div>
</div>
</td>
<td class="v-data-table__mobile-row">
<div class="v-data-table__mobile-row__wrapper">
<div class="v-data-table__mobile-row__header">PatientAge</div>
<div class="v-data-table__mobile-row__cell">{{item.PatientAge}}</div>
</div>
</td>
</tr>
</template>
</v-data-table> </v-data-table>
</v-col> </v-col>
</v-row> </v-row>
...@@ -411,6 +516,36 @@ import DeviceCode from "../../imports/api/collections/devicecode.js"; ...@@ -411,6 +516,36 @@ import DeviceCode from "../../imports/api/collections/devicecode.js";
import { Tracker } from "meteor/tracker"; import { Tracker } from "meteor/tracker";
export default { export default {
methods: { methods: {
activerow: function(item) {
if (this.sortByTable && this.sortByTable.length > 0) {
const items = this.patientsOfTable.sort((a, b) => {
const sortA = a[this.sortByTable[0]];
const sortB = b[this.sortByTable[0]];
if (this.sortDescTable && this.sortDescTable[0] == true) {
if (sortA < sortB) return 1;
if (sortA > sortB) return -1;
return 0;
} else {
if (sortA < sortB) return -1;
if (sortA > sortB) return 1;
return 0;
}
});
console.log(items);
this.sortedItems = items;
} else {
this.sortedItems = this.patientsOfTable;
}
if (item) {
this.selectedItem = item;
this.selectedPatientInTable = [item];
}
this.selectedId = item._id;
// this.$set(item, "selected", true);
},
searchPatients() { searchPatients() {
if (this.selectedDevice && this.devicemap != this.selectedDevice.Value) { if (this.selectedDevice && this.devicemap != this.selectedDevice.Value) {
let self = this; let self = this;
...@@ -487,6 +622,7 @@ export default { ...@@ -487,6 +622,7 @@ export default {
} }
this.editPatients(this.sortedItems[index + 1]); this.editPatients(this.sortedItems[index + 1]);
this.activerow(this.sortedItems[index + 1]);
}, },
prevPatient() { prevPatient() {
let index = this.sortedItems.findIndex( let index = this.sortedItems.findIndex(
...@@ -507,6 +643,7 @@ export default { ...@@ -507,6 +643,7 @@ export default {
} }
this.editPatients(this.sortedItems[index - 1]); this.editPatients(this.sortedItems[index - 1]);
this.activerow(this.sortedItems[index - 1]);
}, },
savePatient() { savePatient() {
debugger; debugger;
...@@ -541,9 +678,12 @@ export default { ...@@ -541,9 +678,12 @@ export default {
].filter(elm => { ].filter(elm => {
return elm && elm.length > 0; return elm && elm.length > 0;
}); });
let { selected, ...selectedItemClone } = this.selectedItem;
this.editLoading = true; this.editLoading = true;
let self = this; let self = this;
Meteor.call("EditworklistItem", this.selectedItem, function( Meteor.call("EditworklistItem", selectedItemClone, function(
error, error,
result result
) { ) {
...@@ -557,7 +697,7 @@ export default { ...@@ -557,7 +697,7 @@ export default {
devicemap: "", devicemap: "",
selectedDevice: undefined, selectedDevice: undefined,
deviceComboSearch: null, deviceComboSearch: null,
selectedId: -1,
noDataCombo: true, noDataCombo: true,
toggleAllOrUnknown: 0, toggleAllOrUnknown: 0,
selectedPatientInTable: undefined, selectedPatientInTable: undefined,
...@@ -658,9 +798,6 @@ export default { ...@@ -658,9 +798,6 @@ export default {
} }
}, },
watch: { watch: {
worklist: (newWorklist, oldWorklist) => {
console.log(newWorklist);
},
"$subReady.worklist"(ready) {}, "$subReady.worklist"(ready) {},
selectedDevice(newDevice, oldDevice) { selectedDevice(newDevice, oldDevice) {
if (this.selectedDevice && this.selectedDevice.Value) { if (this.selectedDevice && this.selectedDevice.Value) {
...@@ -674,33 +811,33 @@ export default { ...@@ -674,33 +811,33 @@ export default {
// } else { // } else {
// alert("لطفا یکی از دستگاه ها را انتخاب نمایید"); // alert("لطفا یکی از دستگاه ها را انتخاب نمایید");
// } // }
},
selectedPatientInTable(newSelected, oldSelected) {
if (this.sortByTable && this.sortByTable.length > 0) {
const items = this.patientsOfTable.sort((a, b) => {
const sortA = a[this.sortByTable[0]];
const sortB = b[this.sortByTable[0]];
if (this.sortDescTable && this.sortDescTable[0] == true) {
if (sortA < sortB) return 1;
if (sortA > sortB) return -1;
return 0;
} else {
if (sortA < sortB) return -1;
if (sortA > sortB) return 1;
return 0;
}
});
console.log(items);
this.sortedItems = items;
} else {
this.sortedItems = this.patientsOfTable;
}
if (newSelected) {
this.selectedItem = newSelected[0];
}
} }
// selectedPatientInTable(newSelected, oldSelected) {
// if (this.sortByTable && this.sortByTable.length > 0) {
// const items = this.patientsOfTable.sort((a, b) => {
// const sortA = a[this.sortByTable[0]];
// const sortB = b[this.sortByTable[0]];
// if (this.sortDescTable && this.sortDescTable[0] == true) {
// if (sortA < sortB) return 1;
// if (sortA > sortB) return -1;
// return 0;
// } else {
// if (sortA < sortB) return -1;
// if (sortA > sortB) return 1;
// return 0;
// }
// });
// console.log(items);
// this.sortedItems = items;
// } else {
// this.sortedItems = this.patientsOfTable;
// }
// if (newSelected) {
// this.selectedItem = newSelected[0];
// }
// }
} }
}; };
</script> </script>
...@@ -710,10 +847,6 @@ export default { ...@@ -710,10 +847,6 @@ export default {
.wholeLayout { .wholeLayout {
height: calc(~"75vh - 106px"); height: calc(~"75vh - 106px");
} }
td,
th {
width: 50px !important;
}
</style> </style>
<style scoped> <style scoped>
......
import Login from '../views/Login.vue'; // const Login = () =>
import Home from '../views/Home.vue'; // import ('../views/Login.vue')
import Register from '../views/Register.vue';
import ChangePassword from '../views/ChangePassword.vue';
import Main from '../views/Main.vue';
import EditWorkList from '../components/EditWorkList.vue';
import WorkList from '../components/Worklist.vue'; // const Home = () =>
// import ('../views/Home.vue')
// const Register = () =>
// import ('../views/Register.vue')
// const ChangePassword = () =>
// import ('../views/ChangePassword.vue')
// const Main = () =>
// import ('../views/Main.vue')
// const EditWorkList = () =>
// import ('../components/EditWorkList.vue')
// const WorkList = () =>
// import ('../components/Worklist.vue')
// import Login from '../views/Login.vue';
// import Home from '../views/Home.vue';
// import Register from '../views/Register.vue';
// import ChangePassword from '../views/ChangePassword.vue';
// import Main from '../views/Main.vue';
// import EditWorkList from '../components/EditWorkList.vue';
// import WorkList from '../components/Worklist.vue';
const routes = [{ const routes = [{
path: '/', path: '/',
component: Home, component: () =>
import ('../views/Home.vue'),
name: 'Home' name: 'Home'
}, },
{ {
path: '/signin', path: '/signin',
component: Login, component: () =>
import ('../views/Login.vue'),
name: 'signin' name: 'signin'
}, },
{ {
path: '/signup', path: '/signup',
component: Register, component: () =>
import ('../views/Register.vue'),
name: 'signup' name: 'signup'
}, },
{ {
path: '/changePassword', path: '/changePassword',
component: ChangePassword, component: () =>
import ('../views/ChangePassword.vue'),
name: 'changePassword' name: 'changePassword'
}, { }, {
path: '/main', path: '/main',
component: Main, component: () =>
import ('../views/Main.vue'),
name: 'main', name: 'main',
children: [{ children: [{
path: "worklist", path: "worklist",
name: "worklist", name: "worklist",
components: { components: {
default: WorkList, default: () =>
edit_worklist: EditWorkList import ('../components/Worklist.vue'),
edit_worklist: () =>
import ('../components/EditWorkList.vue')
} }
}] }]
} }
......
version: '3'
services:
app:
restart: on-failure
build:
context: .
dockerfile: docker/devel/Dockerfile
image: karname/app:1.0
ports:
- '5050:3000'
depends_on:
- mongo
links:
- mongo
environment:
ROOT_URL: ${APP_ROOT_URL:-http://localhost}
MONGO_URL: mongodb://mongo:27017/karname
PORT: 3000
METEOR_SETTINGS: '{"worklistUrl":"http://192.168.0.156"}'
mongo:
image: mongo:latest
command:
- --storageEngine=wiredTiger
volumes:
- data:/data/db
volumes:
data:
\ No newline at end of file
# The tag here should match the Meteor version of your app, per .meteor/release
FROM geoffreybooth/meteor-base:1.8.1
WORKDIR $APP_SOURCE_FOLDER/
# Copy app package.json and package-lock.json into container
COPY ./package*.json $APP_SOURCE_FOLDER/
RUN bash $SCRIPTS_FOLDER/build-app-npm-dependencies.sh
# Copy app source into container
COPY . $APP_SOURCE_FOLDER/
# COPY ./docker/build-meteor-bundle.sh $SCRIPTS_FOLDER/
RUN bash $SCRIPTS_FOLDER/build-meteor-bundle.sh
# Rather than Node 8 latest (Alpine), you can also use the specific version of Node expected by your Meteor release, per https://docs.meteor.com/changelog.html
FROM node:12-alpine
ENV APP_BUNDLE_FOLDER /opt/bundle
ENV SCRIPTS_FOLDER /docker
# Install OS build dependencies, which we remove later after we’ve compiled native Node extensions
RUN apk --no-cache --virtual .node-gyp-compilation-dependencies add \
g++ \
make \
python \
# And runtime dependencies, which we keep
&& apk --no-cache add \
bash \
ca-certificates
# Copy in entrypoint
COPY --from=0 $SCRIPTS_FOLDER $SCRIPTS_FOLDER/
# Copy in app bundle
COPY --from=0 $APP_BUNDLE_FOLDER/bundle $APP_BUNDLE_FOLDER/bundle/
RUN bash $SCRIPTS_FOLDER/build-meteor-npm-dependencies.sh --build-from-source \
&& apk del .node-gyp-compilation-dependencies
# Start app
ENTRYPOINT ["/docker/entrypoint.sh"]
CMD ["node", "main.js"]
\ No newline at end of file
# The tag here should match the Meteor version of your app, per .meteor/release
FROM geoffreybooth/meteor-base:1.8.1
WORKDIR $APP_SOURCE_FOLDER/
# Copy app package.json and package-lock.json into container
COPY ./package*.json $APP_SOURCE_FOLDER/
RUN bash $SCRIPTS_FOLDER/build-app-npm-dependencies.sh
# Copy app source into container
COPY . $APP_SOURCE_FOLDER/
# COPY ./docker/build-meteor-bundle.sh $SCRIPTS_FOLDER/
RUN bash $SCRIPTS_FOLDER/build-meteor-bundle.sh
# Rather than Node 8 latest (Alpine), you can also use the specific version of Node expected by your Meteor release, per https://docs.meteor.com/changelog.html
FROM node:12-alpine
ENV APP_BUNDLE_FOLDER /opt/bundle
ENV SCRIPTS_FOLDER /docker
# Install OS build dependencies, which we remove later after we’ve compiled native Node extensions
RUN apk --no-cache --virtual .node-gyp-compilation-dependencies add \
g++ \
make \
python \
# And runtime dependencies, which we keep
&& apk --no-cache add \
bash \
ca-certificates
# Copy in entrypoint
COPY --from=0 $SCRIPTS_FOLDER $SCRIPTS_FOLDER/
# Copy in app bundle
COPY --from=0 $APP_BUNDLE_FOLDER/bundle $APP_BUNDLE_FOLDER/bundle/
RUN bash $SCRIPTS_FOLDER/build-meteor-npm-dependencies.sh --build-from-source \
&& apk del .node-gyp-compilation-dependencies
# Start app
ENTRYPOINT ["/docker/entrypoint.sh"]
CMD ["node", "main.js"]
\ No newline at end of file
...@@ -11,7 +11,7 @@ Meteor.methods({ ...@@ -11,7 +11,7 @@ Meteor.methods({
this.unblock(); this.unblock();
if (this.userId) { if (this.userId) {
try { try {
const result = HTTP.call('GET', `http://192.168.0.156/Broker/HISIntegration.svc/rest/getdevicecodes`); const result = HTTP.call('GET', `${Meteor.settings.worklistUrl}/Broker/HISIntegration.svc/rest/getdevicecodes`);
let deviceCodeHttpResult = JSON.parse(result.content); let deviceCodeHttpResult = JSON.parse(result.content);
DeviceCode.remove({}); DeviceCode.remove({});
deviceCodeHttpResult.Devices.forEach((device) => { deviceCodeHttpResult.Devices.forEach((device) => {
......
...@@ -20,7 +20,7 @@ Meteor.methods({ ...@@ -20,7 +20,7 @@ Meteor.methods({
this.unblock(); this.unblock();
if (this.userId) { if (this.userId) {
try { try {
const result = HTTP.call('GET', `http://192.168.0.156/Broker/HISIntegration.svc/rest/Fetchworklist/${devicemap}`); const result = HTTP.call('GET', `${Meteor.settings.worklistUrl}/Broker/HISIntegration.svc/rest/Fetchworklist/${devicemap}`);
let worklistHttp = JSON.parse(result.content); let worklistHttp = JSON.parse(result.content);
Worklist.remove({ _userid: this.userId, _devicemap: devicemap }); Worklist.remove({ _userid: this.userId, _devicemap: devicemap });
worklistHttp.WorkListItems.forEach((patient) => { worklistHttp.WorkListItems.forEach((patient) => {
...@@ -84,24 +84,26 @@ Meteor.methods({ ...@@ -84,24 +84,26 @@ Meteor.methods({
// "StudyInstanceUID": "1.3.12.2.1107.5.2.30.26719.6.8122118808" // "StudyInstanceUID": "1.3.12.2.1107.5.2.30.26719.6.8122118808"
// } // }
// try { // try {
debugger; if (this.userId) {
delete item._id; delete item._id;
workListItemSchema.validate(item); workListItemSchema.validate(item);
var options = { var options = {
data: item, data: item,
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Accept': 'application/json' 'Accept': 'application/json'
}
} }
}
const result = HTTP.call('POST', `http://192.168.0.156/Broker/HISIntegration.svc/rest/EditworklistItem`, options); const result = HTTP.call('POST', `${Meteor.settings.worklistUrl}/Broker/HISIntegration.svc/rest/EditworklistItem`, options);
// console.log(result); // console.log(result);
let update = Worklist.update({ AdmissionID: item.AdmissionID }, { $set: JSON.parse(result.content) });
console.log(update);
return true;
}
let update = Worklist.update({ AdmissionID: item.AdmissionID }, { $set: JSON.parse(result.content) });
console.log(update);
return true;
// } // }
// catch (e) { // catch (e) {
......
{
"worklistUrl": "http://192.168.0.156"
}
\ No newline at end of file
...@@ -44,7 +44,12 @@ const clientConfig = { ...@@ -44,7 +44,12 @@ const clientConfig = {
rules: [{ rules: [{
test: /\.js$/, test: /\.js$/,
loader: 'babel-loader', loader: 'babel-loader',
exclude: /node_modules/ exclude: /node_modules/,
options: {
plugins: [
"@babel/plugin-syntax-dynamic-import"
]
}
}, },
{ {
test: /\.vue$/, test: /\.vue$/,
......
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