-
Notifications
You must be signed in to change notification settings - Fork 144
Adding Disease Variants to a SORMAS Server
Maté Strysewske edited this page Apr 6, 2021
·
2 revisions
This guide explains how to add a new disease variant to SORMAS.
First step is to retrieve the identifiers of the diseases.
An exhaustive list can be found inside the enum de.symeda.sormas.api.Disease
.
- Get into pgAdmin or into the postgreSQL shell to be able to execute the following queries into the PostgreSQL database.
- Replace the variable
{{ DISEASE ID }}
in the following query with the Disease ID taken from the Java enum indicated in step I. - Replace the variable
{{ VARIANT NAME }}
in the following query with the name of the disease variant. - Replace the
[...]
by all other rows you need to add. - Execute the generated query.
- Let's verify that the table
diseasevariant
is well completed with your data.
Here is the SQL query to execute:
INSERT INTO diseasevariant (id, uuid, creationdate, changedate, disease, name)
VALUES
(nextval('entity_seq'), gen_random_uuid(), now(), now(), '{{ DISEASE ID }}', '{{ VARIANT NAME }}'),
[...];
Here is an example of the query with sample data:
INSERT INTO diseasevariant (id, uuid, creationdate, changedate, disease, name)
VALUES
(nextval('entity_seq'), gen_random_uuid(), now(), now(), 'YELLOW_FEVER', 'Yellow Fever Variant 1'),
(nextval('entity_seq'), gen_random_uuid(), now(), now(), 'YELLOW_FEVER', 'Yellow Fever Variant 2'),
(nextval('entity_seq'), gen_random_uuid(), now(), now(), 'DENGUE', 'Dengue Variant 1'),
(nextval('entity_seq'), gen_random_uuid(), now(), now(), 'MALARIA', 'Malaria Variant 1'),
(nextval('entity_seq'), gen_random_uuid(), now(), now(), 'MALARIA', 'Malaria Variant 2');
In case PostgreSQL complains about unknown function gen_random_uuid()
, it means the pgcrypto
extension is not enabled.
To enable it, please login with a superadmin account on your PostgreSQL server and execute the following query:
create extension pgcrypto;
That's it. The forms in the web application and Android app will now have their Disease variant
fields filled.