1 | <img src="http://medimage.co.nz/wp-content/uploads/2018/04/icon-60.png">
|
2 |
|
3 | # MedImage Server
|
4 |
|
5 | The MedImage Server is a companion product to the MedImage apps on smart-phones. See http://medimage.co.nz
|
6 |
|
7 | The combined product enables the medical practitioner to take a photo of a patient with their mobile phone, and have the image transferred directly into a specific folder on their PC or server. The image is tagged with a patient id immediately before the photo is taken.
|
8 |
|
9 | The most common way to install this package is to use an internet connected PC as a 'proxy' (typically linux based), which temporarily holds the photos that are uploaded from the phone via 3G/4G to the server. A Windows Med Image reader sits on the Doctor's PC, which reads the proxy on a regular basis, and downloads images directly into a chosen folder (or folders) on the PC
|
10 |
|
11 | ## 1. To Install Your Proxy
|
12 |
|
13 | This is useful when you cannot have a Wifi connection, and must go via a secure internet connection.
|
14 |
|
15 | On a linux based server, first install NodeJS and npm.
|
16 | See https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-an-ubuntu-14-04-server
|
17 |
|
18 | Then:
|
19 |
|
20 | ```
|
21 | eval "$(curl -fsSL -H 'Cache-Control: no-cache' https://git.atomjump.com/medimageserv-linstaller.git/install)"
|
22 | ```
|
23 |
|
24 | (Or for a super user installation, which is sometimes required)
|
25 |
|
26 | ```
|
27 | eval "$(curl -fsSL -H 'Cache-Control: no-cache' https://git.atomjump.com/medimageserv-linstaller.git/install-root)"
|
28 | ```
|
29 |
|
30 | Alternatively, if these do not match your server's permissions, you can find the list of individual commands at
|
31 | https://git.atomjump.com/medimageserv-linstaller.git/install
|
32 | https://git.atomjump.com/medimageserv-linstaller.git/install-root
|
33 |
|
34 | Run the command the last part of the script displays, to get autostart at boot-up.
|
35 |
|
36 | You may have to open the firewall to port 5566 for reading and writing eg.:
|
37 | ```
|
38 | sudo ufw allow 5566/tcp
|
39 | ```
|
40 |
|
41 |
|
42 | To start MedImage server
|
43 | ```
|
44 | pm2 start medimage-server
|
45 | ```
|
46 |
|
47 | To stop MedImage server:
|
48 | ```
|
49 | pm2 stop medimage-server
|
50 | ```
|
51 |
|
52 | To restart (after any config.json changes):
|
53 | ```
|
54 | pm2 restart medimage-server
|
55 | ```
|
56 |
|
57 | For logging or and any permissions issues, see the section 'Troubleshooting' below.
|
58 |
|
59 |
|
60 |
|
61 |
|
62 | Note: this proxy daemon is always on, but the images are only kept on this machine for a few seconds.
|
63 |
|
64 |
|
65 |
|
66 | ## 2. On your Windows PC/local server
|
67 |
|
68 | Download and run the installable MedImageServer.exe from http://medimage.co.nz
|
69 |
|
70 | If you have installed your own proxy using npm, above, enter the URL of your proxy server eg. 'https://myproxy.mycompany.com:5566' into the third large button. You will be given a 4 digit pairing code.
|
71 |
|
72 |
|
73 |
|
74 | ## 3. On your MedImage Android/iPhone app
|
75 |
|
76 | Search the Play Store or App store for 'MedImage'. Purchase and install.
|
77 |
|
78 | Click the large blue/purple button on the app to connect and start taking photos. If you have no wifi connection it will ask you for your 4 character pairing code from your server.
|
79 |
|
80 | Enter the patient id in the box at the top, specific to each photo. Note: #tags will allocate a directory (this will create another subdirectory inside your directory.). eg.
|
81 | ```
|
82 | #elderly Fred
|
83 | ```
|
84 | would create a directory called elderly/ on your PC and upload a file called 'Fred-[datetime]'
|
85 |
|
86 |
|
87 |
|
88 | ## Options
|
89 |
|
90 | These are located in the file config.json.
|
91 |
|
92 |
|
93 | * **backupTo** should be an array of linux-style paths where the files are backed up to.
|
94 | * **readProxy** should be null if this is the master 'proxy' server, but will be set automatically after you sync.
|
95 | * **listenPort** is the port on your server which is open to being read
|
96 | * **httpsKey** is optional. If you are on an https server, it is required (an http server should leave this blank). It is a file path to the key .pem file which includes your private ssl key.
|
97 | * **httpsCert** is optional. If you are on an https server, it is required (an http server should leave this blank). It is a file path to the certificate .pem file which includes your server's ssl certificate.
|
98 | * **onStartBackupDriveDetect** is optional. If set to 'true' it autodetects new drives added when starting, and will backup your new photos to:
|
99 | New Drive:\MedImage\photos
|
100 | * **allowPhotosLeaving** If set to 'true', this allows photos to leave the machine and be downloaded by other installations of the server. Leave 'true' for proxy servers, but false for client Windows machines.
|
101 | * **allowGettingRemotePhotos** If set to 'true', this allows photos to be downloaded from a remote proxy server. If this is a proxy server, this should be set to 'false', otherwise for client Windows machines, set to 'true'.
|
102 | * **webProxy** If your web browser usually requires a proxy server (i.e. for normal web requests), then use the option"webProxy", in this format: "http://yourUser:yourPassword@webProxyIPaddress:webProxyPort"
|
103 | * **lockDown** You can switch a server into 'lock down' mode, where the interface cannot change any settings, add-ons, or see any technical logs, by setting this to 'true'. Ver >= 1.3.6
|
104 | * **basicAuthent** Enter a human readable password for addons that need some light security. This is a global password visible only within the config file (anyone with file level access to the server can see this). Ver >= 1.3.8
|
105 | * **allowedTypes** Provide the ability to upload additional file types other than basic .jpg photos, e.g. PDF. You need to specify the extension and the MIME type in a new array element e.g. { "extension": ".pdf", "mime": "application/pdf" }
|
106 |
|
107 |
|
108 |
|
109 | ## Troubleshooting
|
110 |
|
111 | Once the server is running, you can check the logs with
|
112 |
|
113 | ```
|
114 | pm2 logs
|
115 | ```
|
116 |
|
117 | Note: the permissions and ownership of the following files/directories may need to be expanded (try with 'chmod 777' at first, and then restrict the permissions once this is working).
|
118 |
|
119 | ```
|
120 | /usr/lib/node_modules/medimage/config.json # must be writable by the sudo node script
|
121 | /usr/lib/node_modules/medimage/photos
|
122 | ```
|
123 |
|
124 | ```
|
125 | chmod 777 config.json
|
126 | chown nobody:ubuntu config.json # nobody:ubuntu will vary slightly depending on platform
|
127 | chmod 777 photos
|
128 | chown nobody:ubuntu photos
|
129 | ```
|
130 |
|
131 | If you are having problems installing the medimage software on a small machine (e.g. with 512MB RAM), please try
|
132 |
|
133 | ```
|
134 | sudo npm install -g medimage -production
|
135 | ```
|
136 |
|
137 |
|
138 |
|
139 | ## Upgrade script
|
140 |
|
141 |
|
142 | The way to upgrade Medimage Server:
|
143 |
|
144 | ```
|
145 | eval "$(curl -fsSL -H 'Cache-Control: no-cache' https://git.atomjump.com/medimageserv-linstaller.git/upgrade)"
|
146 | ```
|
147 |
|
148 | But, please note, that any files in the lib/node_modules/medimage/ directory may be removed, during the 'npm install' command. If you store any other files such as keys, ensure you copy them out before running this command.
|
149 |
|
150 | (Or for a super user installation, which is sometimes required)
|
151 |
|
152 | ```
|
153 | eval "$(curl -fsSL -H 'Cache-Control: no-cache' https://git.atomjump.com/medimageserv-linstaller.git/upgrade-root)"
|
154 | ```
|
155 |
|
156 | You also may wish to save your config file somewhere else first, and then run:
|
157 |
|
158 | ```
|
159 | npm config set medimage:configFile /path/to/your/medimage/config.json
|
160 | ```
|
161 | Your settings will be kept between upgrades, provided the config.json is out of your global medimage directory,
|
162 | without having to copy them out.
|
163 |
|
164 |
|
165 |
|
166 |
|
167 | ## Uninstall script
|
168 |
|
169 | To remove any instances of MedImage Server:
|
170 |
|
171 | ```
|
172 | eval "$(curl -fsSL -H 'Cache-Control: no-cache' https://git.atomjump.com/medimageserv-linstaller.git/uninstall)"
|
173 | ```
|
174 |
|
175 |
|
176 | # License
|
177 |
|
178 | Application source code copyright (c) 2018 AtomJump Ltd. (New Zealand). All rights reserved.
|
179 |
|
180 |
|
181 | Licensed under the Apache License, Version 2.0 (the "License");
|
182 | you may not use this file except in compliance with the License.
|
183 | You may obtain a copy of the License at
|
184 |
|
185 | http://www.apache.org/licenses/LICENSE-2.0
|
186 |
|
187 | Unless required by applicable law or agreed to in writing, software
|
188 | distributed under the License is distributed on an "AS IS" BASIS,
|
189 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
190 | See the License for the specific language governing permissions and
|
191 | limitations under the License.
|
192 |
|