This repository holds the files of the openIMIS Backend Patient_managment reference module. It is dedicated to be deployed as a module of openimis-be_py.
When programming for openIMIS backend, you are highly encouraged to used the features provided in the openimis-be-core module. This includes (but is not limited to) date handling, user info,... |
- clone the
openimis-be_py
repo (creates theopenimis-be_py
directory) - install python 3, recommended in a venv or virtualenv
- install pip
- within
openimis-be_py
directory- install openIMIS (external) dependencies:
pip install -r requirements.txt
. For development workstations, one can usepip install -r dev-requirements.txt
instead for more modules. - generate the openIMIS modules dependencies file (from openimis.json config):
python modules-requirements.py openimis.json > modules-requirements.txt
- if you previously installed openIMIS on another version, it seems safe to uninstall all previous modules-requirement to be sure it match current version
pip uninstall -r modules-requirements.txt
- install openIMIS current modules:
pip install -r modules-requirements.txt
- Copy the example environment setup and adjust the settings (like database connection):
cp .env.example .env
. Refer to .env.example for more info.
- install openIMIS (external) dependencies:
- start openIMIS from within
openimis-be_py/openIMIS
:python manage.py runserver
At this stage, you may (depends on the database you connect to) need to:
- apply django migrations, from
openimis-be_py/openIMIS
:python manage.py migrate
- create a superuser for django admin console, from
openimis-be_py/openIMIS
:python manage.py createsuperuser
(will not prompt for a password) and thenpython manage.py changepassword <username>
- clone this
openimis-be-medical_data_py
repo outside ofopenimis-be_py
, just next to it where other modules are located. - Go to
/openimis-be_py/openIMIS
and from there:- register your module in the pip requirements of openIMIS, referencing your 'local' codebase:
pip install -e ../../openimis-be-medical_data_py/
- register your module to openIMIS django site in
/openimis-be_py/openimis.json
with{ "name": "medical_data", "pip": "openimis-be-medical_data==1.0.0" }
- register your module in the pip requirements of openIMIS, referencing your 'local' codebase:
- From here on, your local openIMIS has this new module, directly loaded from your directory.
- Run
python manage.py migrate medical_data
to get new tables reflected in your database. - Go to
openimis-be_py/openIMIS/openIMIS/settings.py
settings file, append"django_filters"
to help modules endpoint to be searched and filtered. - Add
path('api/patients/', include('medical_data.urls')),
to the global urls.py patterns.
Go back to /openimis-be_py/openIMIS
and
start the server by python manage.py runserver
###1 Note: The default auth is by default basic access.
This module exposes endpoints for creating, reading, updating and deleting medical records.
insurees
for medical records retrieval
createMedicalRecord
for medical record creationupdateMedicalRecord
for medical record updatedeleteMedicalRecord
for medical record deletion