diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1849a85 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +# For emacs: +*~ +\#* +.\#* + diff --git a/application/Dockerfile b/application/Dockerfile index 27dcc69..e77646e 100644 --- a/application/Dockerfile +++ b/application/Dockerfile @@ -1,8 +1,8 @@ FROM java:8-jre -MAINTAINER Alessandro Fael Garcia +MAINTAINER Alessandro Fael Garcia , Shinji Kobayashi -LABEL EtherCIS-Version="1.1.0" \ +LABEL EtherCIS-Version="1.2.0" \ Description="Docker image for the EtherCIS application" # Create user and group ethercis @@ -22,11 +22,11 @@ RUN chown -R ethercis:ethercis /home/ethercis/logs \ && chown -R ethercis:ethercis /var/opt/ecis # Copy EtherCIS files into their corresponding directories -COPY ./ethercis-1.1.0/conf /etc/opt/ecis -COPY ./ethercis-1.1.0/bin /opt/ecis/bin -COPY ./ethercis-1.1.0/lib/application /opt/ecis/lib/application -COPY ./ethercis-1.1.0/lib/deploy /opt/ecis/lib/deploy -COPY ./ethercis-1.1.0/lib/system /opt/ecis/lib/system +COPY ./ethercis-1.2.0/conf /etc/opt/ecis +COPY ./ethercis-1.2.0/bin /opt/ecis/bin +COPY ./ethercis-1.2.0/lib/application /opt/ecis/lib/application +COPY ./ethercis-1.2.0/lib/deploy /opt/ecis/lib/deploy +COPY ./ethercis-1.2.0/lib/system /opt/ecis/lib/system COPY ./wait-for-it.sh /opt/ecis/bin/wait-for-it.sh # Make startup scripts executable diff --git a/application/ethercis-1.1.0/lib/deploy/ecis-party-identified-service-1.1.0-SNAPSHOT.jar b/application/ethercis-1.1.0/lib/deploy/ecis-party-identified-service-1.1.0-SNAPSHOT.jar deleted file mode 100644 index 772f4c0..0000000 Binary files a/application/ethercis-1.1.0/lib/deploy/ecis-party-identified-service-1.1.0-SNAPSHOT.jar and /dev/null differ diff --git a/application/ethercis-1.1.0/lib/deploy/ecis-resource-access-service-1.1.0-SNAPSHOT.jar b/application/ethercis-1.1.0/lib/deploy/ecis-resource-access-service-1.1.0-SNAPSHOT.jar deleted file mode 100644 index 724c4c6..0000000 Binary files a/application/ethercis-1.1.0/lib/deploy/ecis-resource-access-service-1.1.0-SNAPSHOT.jar and /dev/null differ diff --git a/application/ethercis-1.1.0/lib/deploy/ecis-vehr-service-1.1.0-SNAPSHOT.jar b/application/ethercis-1.1.0/lib/deploy/ecis-vehr-service-1.1.0-SNAPSHOT.jar deleted file mode 100644 index 093bcbb..0000000 Binary files a/application/ethercis-1.1.0/lib/deploy/ecis-vehr-service-1.1.0-SNAPSHOT.jar and /dev/null differ diff --git a/application/ethercis-1.1.0/lib/deploy/jooq-pg-1.1.0-SNAPSHOT.jar b/application/ethercis-1.1.0/lib/deploy/jooq-pg-1.1.0-SNAPSHOT.jar deleted file mode 100644 index 2b2ec4b..0000000 Binary files a/application/ethercis-1.1.0/lib/deploy/jooq-pg-1.1.0-SNAPSHOT.jar and /dev/null differ diff --git a/application/ethercis-1.1.0/LICENSE b/application/ethercis-1.2.0/LICENSE similarity index 100% rename from application/ethercis-1.1.0/LICENSE rename to application/ethercis-1.2.0/LICENSE diff --git a/application/ethercis-1.1.0/bin/ecis-dump-opt.sh b/application/ethercis-1.2.0/bin/ecis-dump-opt.sh similarity index 89% rename from application/ethercis-1.1.0/bin/ecis-dump-opt.sh rename to application/ethercis-1.2.0/bin/ecis-dump-opt.sh index bae0742..331b55f 100644 --- a/application/ethercis-1.1.0/bin/ecis-dump-opt.sh +++ b/application/ethercis-1.2.0/bin/ecis-dump-opt.sh @@ -27,10 +27,10 @@ export RUNTIME_LOG=/var/opt/ecis CLASSPATH=./:\ ${JAVA_HOME}/lib:\ -${LIB}/ecis-core-1.1.0-SNAPSHOT.jar:\ -${LIB}/ecis-knowledge-cache-1.1.0-SNAPSHOT.jar:\ -${LIB}/ecis-ehrdao-1.1.0-SNAPSHOT.jar:\ -${LIB}/jooq-pg-1.1.0-SNAPSHOT.jar:\ +${LIB}/ecis-core-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-knowledge-cache-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-ehrdao-1.2.0-SNAPSHOT.jar:\ +${LIB}/jooq-pg-1.2.0-SNAPSHOT.jar:\ ${APPLIB}/types.jar:\ ${APPLIB}/ecis-openehr.jar:\ ${SYSLIB}/fst-2.40-onejar.jar:\ diff --git a/application/ethercis-1.1.0/bin/ecis-server.sh b/application/ethercis-1.2.0/bin/ecis-server.sh similarity index 79% rename from application/ethercis-1.1.0/bin/ecis-server.sh rename to application/ethercis-1.2.0/bin/ecis-server.sh index d8c78a6..66315ff 100644 --- a/application/ethercis-1.1.0/bin/ecis-server.sh +++ b/application/ethercis-1.2.0/bin/ecis-server.sh @@ -53,22 +53,28 @@ export JOOQ_DB_PASSWORD=postgres CLASSPATH=./:\ ${JAVA_HOME}/lib:\ -${LIB}/ecis-core-1.1.0-SNAPSHOT.jar:\ -${LIB}/ecis-knowledge-cache-1.1.0-SNAPSHOT.jar:\ -${LIB}/ecis-ehrdao-1.1.0-SNAPSHOT.jar:\ -${LIB}/jooq-pg-1.1.0-SNAPSHOT.jar:\ -${LIB}/aql-processor-1.1.0-SNAPSHOT.jar:\ -${LIB}/ecis-servicemanager-1.1.0-SNAPSHOT.jar:\ -${LIB}/ecis-authenticate-service-1.1.0-SNAPSHOT.jar:\ -${LIB}/ecis-knowledge-service-1.1.0-SNAPSHOT.jar:\ -${LIB}/ecis-logon-service-1.1.0-SNAPSHOT.jar:\ -${LIB}/ecis-resource-access-service-1.1.0-SNAPSHOT.jar:\ -${LIB}/ecis-composition-service-1.1.0-SNAPSHOT.jar:\ -${LIB}/ecis-partyidentified-service-1.1.0-SNAPSHOT.jar:\ -${LIB}/ecis-system-service-1.1.0-SNAPSHOT.jar:\ -${LIB}/ecis-ehr-service-1.1.0-SNAPSHOT.jar:\ -${LIB}/ecis-vehr-service-1.1.0-SNAPSHOT.jar:\ -${APPLIB}/ehrxml.jar:\ +${LIB}/ecis-core-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-knowledge-cache-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-ehrdao-1.2.0-SNAPSHOT.jar:\ +${LIB}/jooq-pg-1.2.0-SNAPSHOT.jar:\ +${LIB}/aql-processor-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-servicemanager-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-authenticate-service-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-knowledge-service-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-logon-service-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-resource-access-service-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-composition-service-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-partyidentified-service-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-system-service-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-ehr-service-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-vehr-service-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-meta-data-cache-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-query-service-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-resource-access-service-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-transform-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-validation-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-webtemplate-1.2.0-SNAPSHOT.jar:\ +${APPLIB}/ehrxml-1.0.0.jar:\ ${APPLIB}/oet-parser.jar:\ ${APPLIB}/ecis-openehr.jar:\ ${APPLIB}/types.jar:\ diff --git a/application/ethercis-1.1.0/bin/populate-concept.sh b/application/ethercis-1.2.0/bin/populate-concept.sh similarity index 92% rename from application/ethercis-1.1.0/bin/populate-concept.sh rename to application/ethercis-1.2.0/bin/populate-concept.sh index 1d571b0..5b2e5d7 100644 --- a/application/ethercis-1.1.0/bin/populate-concept.sh +++ b/application/ethercis-1.2.0/bin/populate-concept.sh @@ -39,11 +39,11 @@ export JOOQ_DB_PASSWORD=postgres CLASSPATH=./:\ ${JAVA_HOME}/lib:\ -${LIB}/ecis-core-1.1.0-SNAPSHOT.jar:\ -${LIB}/ecis-knowledge-cache-1.1.0-SNAPSHOT.jar:\ -${LIB}/ecis-ehrdao-1.1.0-SNAPSHOT.jar:\ -${LIB}/jooq-pg-1.1.0-SNAPSHOT.jar:\ -${APPLIB}/ehrxml.jar:\ +${LIB}/ecis-core-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-knowledge-cache-1.2.0-SNAPSHOT.jar:\ +${LIB}/ecis-ehrdao-1.2.0-SNAPSHOT.jar:\ +${LIB}/jooq-pg-1.2.0-SNAPSHOT.jar:\ +${APPLIB}/ehrxml-1.0.0.jar:\ ${APPLIB}/oet-parser.jar:\ ${APPLIB}/ecis-openehr.jar:\ ${APPLIB}/types.jar:\ diff --git a/application/ethercis-1.1.0/conf/log4j.xml b/application/ethercis-1.2.0/conf/log4j.xml similarity index 100% rename from application/ethercis-1.1.0/conf/log4j.xml rename to application/ethercis-1.2.0/conf/log4j.xml diff --git a/application/ethercis-1.1.0/conf/logging.properties b/application/ethercis-1.2.0/conf/logging.properties similarity index 100% rename from application/ethercis-1.1.0/conf/logging.properties rename to application/ethercis-1.2.0/conf/logging.properties diff --git a/application/ethercis-1.1.0/conf/security/authenticate.ini b/application/ethercis-1.2.0/conf/security/authenticate.ini similarity index 100% rename from application/ethercis-1.1.0/conf/security/authenticate.ini rename to application/ethercis-1.2.0/conf/security/authenticate.ini diff --git a/application/ethercis-1.1.0/conf/services.properties b/application/ethercis-1.2.0/conf/services.properties similarity index 100% rename from application/ethercis-1.1.0/conf/services.properties rename to application/ethercis-1.2.0/conf/services.properties diff --git a/application/ethercis-1.1.0/conf/terminology.xml b/application/ethercis-1.2.0/conf/terminology.xml similarity index 100% rename from application/ethercis-1.1.0/conf/terminology.xml rename to application/ethercis-1.2.0/conf/terminology.xml diff --git a/application/ethercis-1.1.0/lib/application/adl-parser-1.0.9.jar b/application/ethercis-1.2.0/lib/application/adl-parser-1.0.9.jar similarity index 100% rename from application/ethercis-1.1.0/lib/application/adl-parser-1.0.9.jar rename to application/ethercis-1.2.0/lib/application/adl-parser-1.0.9.jar diff --git a/application/ethercis-1.1.0/lib/application/ecis-openehr.jar b/application/ethercis-1.2.0/lib/application/ecis-openehr.jar similarity index 100% rename from application/ethercis-1.1.0/lib/application/ecis-openehr.jar rename to application/ethercis-1.2.0/lib/application/ecis-openehr.jar diff --git a/application/ethercis-1.1.0/lib/application/ehrxml.jar b/application/ethercis-1.2.0/lib/application/ehrxml-1.0.0.jar similarity index 100% rename from application/ethercis-1.1.0/lib/application/ehrxml.jar rename to application/ethercis-1.2.0/lib/application/ehrxml-1.0.0.jar diff --git a/application/ethercis-1.1.0/lib/application/oet-parser.jar b/application/ethercis-1.2.0/lib/application/oet-parser.jar similarity index 100% rename from application/ethercis-1.1.0/lib/application/oet-parser.jar rename to application/ethercis-1.2.0/lib/application/oet-parser.jar diff --git a/application/ethercis-1.1.0/lib/application/types.jar b/application/ethercis-1.2.0/lib/application/types.jar similarity index 100% rename from application/ethercis-1.1.0/lib/application/types.jar rename to application/ethercis-1.2.0/lib/application/types.jar diff --git a/application/ethercis-1.1.0/lib/deploy/aql-processor-1.1.0-SNAPSHOT.jar b/application/ethercis-1.2.0/lib/deploy/aql-processor-1.2.0-SNAPSHOT.jar similarity index 61% rename from application/ethercis-1.1.0/lib/deploy/aql-processor-1.1.0-SNAPSHOT.jar rename to application/ethercis-1.2.0/lib/deploy/aql-processor-1.2.0-SNAPSHOT.jar index 8360da2..9a997fe 100644 Binary files a/application/ethercis-1.1.0/lib/deploy/aql-processor-1.1.0-SNAPSHOT.jar and b/application/ethercis-1.2.0/lib/deploy/aql-processor-1.2.0-SNAPSHOT.jar differ diff --git a/application/ethercis-1.2.0/lib/deploy/ecis-authenticate-service-1.2.0-SNAPSHOT.jar b/application/ethercis-1.2.0/lib/deploy/ecis-authenticate-service-1.2.0-SNAPSHOT.jar new file mode 100644 index 0000000..5ed5e3c Binary files /dev/null and b/application/ethercis-1.2.0/lib/deploy/ecis-authenticate-service-1.2.0-SNAPSHOT.jar differ diff --git a/application/ethercis-1.1.0/lib/deploy/ecis-composition-service-1.1.0-SNAPSHOT.jar b/application/ethercis-1.2.0/lib/deploy/ecis-composition-service-1.2.0-SNAPSHOT.jar similarity index 76% rename from application/ethercis-1.1.0/lib/deploy/ecis-composition-service-1.1.0-SNAPSHOT.jar rename to application/ethercis-1.2.0/lib/deploy/ecis-composition-service-1.2.0-SNAPSHOT.jar index 6876b0f..4dec4cc 100644 Binary files a/application/ethercis-1.1.0/lib/deploy/ecis-composition-service-1.1.0-SNAPSHOT.jar and b/application/ethercis-1.2.0/lib/deploy/ecis-composition-service-1.2.0-SNAPSHOT.jar differ diff --git a/application/ethercis-1.2.0/lib/deploy/ecis-core-1.2.0-SNAPSHOT.jar b/application/ethercis-1.2.0/lib/deploy/ecis-core-1.2.0-SNAPSHOT.jar new file mode 100644 index 0000000..7dba781 Binary files /dev/null and b/application/ethercis-1.2.0/lib/deploy/ecis-core-1.2.0-SNAPSHOT.jar differ diff --git a/application/ethercis-1.1.0/lib/deploy/ecis-ehr-service-1.1.0-SNAPSHOT.jar b/application/ethercis-1.2.0/lib/deploy/ecis-ehr-service-1.2.0-SNAPSHOT.jar similarity index 77% rename from application/ethercis-1.1.0/lib/deploy/ecis-ehr-service-1.1.0-SNAPSHOT.jar rename to application/ethercis-1.2.0/lib/deploy/ecis-ehr-service-1.2.0-SNAPSHOT.jar index d5d9443..e9a4441 100644 Binary files a/application/ethercis-1.1.0/lib/deploy/ecis-ehr-service-1.1.0-SNAPSHOT.jar and b/application/ethercis-1.2.0/lib/deploy/ecis-ehr-service-1.2.0-SNAPSHOT.jar differ diff --git a/application/ethercis-1.1.0/lib/deploy/ecis-system-service-1.1.0-SNAPSHOT.jar b/application/ethercis-1.2.0/lib/deploy/ecis-ehrdao-1.2.0-SNAPSHOT.jar similarity index 68% rename from application/ethercis-1.1.0/lib/deploy/ecis-system-service-1.1.0-SNAPSHOT.jar rename to application/ethercis-1.2.0/lib/deploy/ecis-ehrdao-1.2.0-SNAPSHOT.jar index 53d0023..fda4917 100644 Binary files a/application/ethercis-1.1.0/lib/deploy/ecis-system-service-1.1.0-SNAPSHOT.jar and b/application/ethercis-1.2.0/lib/deploy/ecis-ehrdao-1.2.0-SNAPSHOT.jar differ diff --git a/application/ethercis-1.1.0/lib/deploy/ecis-ehrdao-1.1.0-SNAPSHOT.jar b/application/ethercis-1.2.0/lib/deploy/ecis-knowledge-cache-1.2.0-SNAPSHOT.jar similarity index 60% rename from application/ethercis-1.1.0/lib/deploy/ecis-ehrdao-1.1.0-SNAPSHOT.jar rename to application/ethercis-1.2.0/lib/deploy/ecis-knowledge-cache-1.2.0-SNAPSHOT.jar index 7ac7170..604a326 100644 Binary files a/application/ethercis-1.1.0/lib/deploy/ecis-ehrdao-1.1.0-SNAPSHOT.jar and b/application/ethercis-1.2.0/lib/deploy/ecis-knowledge-cache-1.2.0-SNAPSHOT.jar differ diff --git a/application/ethercis-1.1.0/lib/deploy/ecis-logon-service-1.1.0-SNAPSHOT.jar b/application/ethercis-1.2.0/lib/deploy/ecis-knowledge-service-1.2.0-SNAPSHOT.jar similarity index 70% rename from application/ethercis-1.1.0/lib/deploy/ecis-logon-service-1.1.0-SNAPSHOT.jar rename to application/ethercis-1.2.0/lib/deploy/ecis-knowledge-service-1.2.0-SNAPSHOT.jar index cad42c7..2536826 100644 Binary files a/application/ethercis-1.1.0/lib/deploy/ecis-logon-service-1.1.0-SNAPSHOT.jar and b/application/ethercis-1.2.0/lib/deploy/ecis-knowledge-service-1.2.0-SNAPSHOT.jar differ diff --git a/application/ethercis-1.2.0/lib/deploy/ecis-logon-service-1.2.0-SNAPSHOT.jar b/application/ethercis-1.2.0/lib/deploy/ecis-logon-service-1.2.0-SNAPSHOT.jar new file mode 100644 index 0000000..81d53bd Binary files /dev/null and b/application/ethercis-1.2.0/lib/deploy/ecis-logon-service-1.2.0-SNAPSHOT.jar differ diff --git a/application/ethercis-1.2.0/lib/deploy/ecis-meta-data-cache-1.2.0-SNAPSHOT.jar b/application/ethercis-1.2.0/lib/deploy/ecis-meta-data-cache-1.2.0-SNAPSHOT.jar new file mode 100644 index 0000000..b8cc990 Binary files /dev/null and b/application/ethercis-1.2.0/lib/deploy/ecis-meta-data-cache-1.2.0-SNAPSHOT.jar differ diff --git a/application/ethercis-1.1.0/lib/deploy/ecis-servicemanager-1.1.0-SNAPSHOT.jar b/application/ethercis-1.2.0/lib/deploy/ecis-party-identified-service-1.2.0-SNAPSHOT.jar similarity index 74% rename from application/ethercis-1.1.0/lib/deploy/ecis-servicemanager-1.1.0-SNAPSHOT.jar rename to application/ethercis-1.2.0/lib/deploy/ecis-party-identified-service-1.2.0-SNAPSHOT.jar index caf3441..f15227a 100644 Binary files a/application/ethercis-1.1.0/lib/deploy/ecis-servicemanager-1.1.0-SNAPSHOT.jar and b/application/ethercis-1.2.0/lib/deploy/ecis-party-identified-service-1.2.0-SNAPSHOT.jar differ diff --git a/application/ethercis-1.2.0/lib/deploy/ecis-query-service-1.2.0-SNAPSHOT.jar b/application/ethercis-1.2.0/lib/deploy/ecis-query-service-1.2.0-SNAPSHOT.jar new file mode 100644 index 0000000..6b7b46a Binary files /dev/null and b/application/ethercis-1.2.0/lib/deploy/ecis-query-service-1.2.0-SNAPSHOT.jar differ diff --git a/application/ethercis-1.1.0/lib/deploy/ecis-authenticate-service-1.1.0-SNAPSHOT.jar b/application/ethercis-1.2.0/lib/deploy/ecis-resource-access-service-1.2.0-SNAPSHOT.jar similarity index 71% rename from application/ethercis-1.1.0/lib/deploy/ecis-authenticate-service-1.1.0-SNAPSHOT.jar rename to application/ethercis-1.2.0/lib/deploy/ecis-resource-access-service-1.2.0-SNAPSHOT.jar index dd5a05d..c26b3bd 100644 Binary files a/application/ethercis-1.1.0/lib/deploy/ecis-authenticate-service-1.1.0-SNAPSHOT.jar and b/application/ethercis-1.2.0/lib/deploy/ecis-resource-access-service-1.2.0-SNAPSHOT.jar differ diff --git a/application/ethercis-1.2.0/lib/deploy/ecis-servicemanager-1.2.0-SNAPSHOT.jar b/application/ethercis-1.2.0/lib/deploy/ecis-servicemanager-1.2.0-SNAPSHOT.jar new file mode 100644 index 0000000..297e0ec Binary files /dev/null and b/application/ethercis-1.2.0/lib/deploy/ecis-servicemanager-1.2.0-SNAPSHOT.jar differ diff --git a/application/ethercis-1.2.0/lib/deploy/ecis-system-service-1.2.0-SNAPSHOT.jar b/application/ethercis-1.2.0/lib/deploy/ecis-system-service-1.2.0-SNAPSHOT.jar new file mode 100644 index 0000000..4e7cfbe Binary files /dev/null and b/application/ethercis-1.2.0/lib/deploy/ecis-system-service-1.2.0-SNAPSHOT.jar differ diff --git a/application/ethercis-1.1.0/lib/deploy/ecis-core-1.1.0-SNAPSHOT.jar b/application/ethercis-1.2.0/lib/deploy/ecis-transform-1.2.0-SNAPSHOT.jar similarity index 69% rename from application/ethercis-1.1.0/lib/deploy/ecis-core-1.1.0-SNAPSHOT.jar rename to application/ethercis-1.2.0/lib/deploy/ecis-transform-1.2.0-SNAPSHOT.jar index bb85014..af9d958 100644 Binary files a/application/ethercis-1.1.0/lib/deploy/ecis-core-1.1.0-SNAPSHOT.jar and b/application/ethercis-1.2.0/lib/deploy/ecis-transform-1.2.0-SNAPSHOT.jar differ diff --git a/application/ethercis-1.1.0/lib/deploy/ecis-knowledge-cache-1.1.0-SNAPSHOT.jar b/application/ethercis-1.2.0/lib/deploy/ecis-validation-1.2.0-SNAPSHOT.jar similarity index 53% rename from application/ethercis-1.1.0/lib/deploy/ecis-knowledge-cache-1.1.0-SNAPSHOT.jar rename to application/ethercis-1.2.0/lib/deploy/ecis-validation-1.2.0-SNAPSHOT.jar index 208b116..df8e544 100644 Binary files a/application/ethercis-1.1.0/lib/deploy/ecis-knowledge-cache-1.1.0-SNAPSHOT.jar and b/application/ethercis-1.2.0/lib/deploy/ecis-validation-1.2.0-SNAPSHOT.jar differ diff --git a/application/ethercis-1.1.0/lib/deploy/ecis-knowledge-service-1.1.0-SNAPSHOT.jar b/application/ethercis-1.2.0/lib/deploy/ecis-vehr-service-1.2.0-SNAPSHOT.jar similarity index 70% rename from application/ethercis-1.1.0/lib/deploy/ecis-knowledge-service-1.1.0-SNAPSHOT.jar rename to application/ethercis-1.2.0/lib/deploy/ecis-vehr-service-1.2.0-SNAPSHOT.jar index 2fc27b6..0057bca 100644 Binary files a/application/ethercis-1.1.0/lib/deploy/ecis-knowledge-service-1.1.0-SNAPSHOT.jar and b/application/ethercis-1.2.0/lib/deploy/ecis-vehr-service-1.2.0-SNAPSHOT.jar differ diff --git a/application/ethercis-1.2.0/lib/deploy/ecis-webtemplate-1.2.0-SNAPSHOT.jar b/application/ethercis-1.2.0/lib/deploy/ecis-webtemplate-1.2.0-SNAPSHOT.jar new file mode 100644 index 0000000..7c76dca Binary files /dev/null and b/application/ethercis-1.2.0/lib/deploy/ecis-webtemplate-1.2.0-SNAPSHOT.jar differ diff --git a/application/ethercis-1.2.0/lib/deploy/jooq-pg-1.2.0-SNAPSHOT.jar b/application/ethercis-1.2.0/lib/deploy/jooq-pg-1.2.0-SNAPSHOT.jar new file mode 100644 index 0000000..c9d904e Binary files /dev/null and b/application/ethercis-1.2.0/lib/deploy/jooq-pg-1.2.0-SNAPSHOT.jar differ diff --git a/application/ethercis-1.1.0/lib/system/commons-collections4-4.0.jar b/application/ethercis-1.2.0/lib/system/commons-collections4-4.0.jar similarity index 100% rename from application/ethercis-1.1.0/lib/system/commons-collections4-4.0.jar rename to application/ethercis-1.2.0/lib/system/commons-collections4-4.0.jar diff --git a/application/ethercis-1.1.0/lib/system/dom4j-1.6.1.jar b/application/ethercis-1.2.0/lib/system/dom4j-1.6.1.jar similarity index 100% rename from application/ethercis-1.1.0/lib/system/dom4j-1.6.1.jar rename to application/ethercis-1.2.0/lib/system/dom4j-1.6.1.jar diff --git a/application/ethercis-1.1.0/lib/system/fst-2.40-onejar.jar b/application/ethercis-1.2.0/lib/system/fst-2.40-onejar.jar similarity index 100% rename from application/ethercis-1.1.0/lib/system/fst-2.40-onejar.jar rename to application/ethercis-1.2.0/lib/system/fst-2.40-onejar.jar diff --git a/application/ethercis-1.1.0/lib/system/gson-2.4.jar b/application/ethercis-1.2.0/lib/system/gson-2.4.jar similarity index 100% rename from application/ethercis-1.1.0/lib/system/gson-2.4.jar rename to application/ethercis-1.2.0/lib/system/gson-2.4.jar diff --git a/application/ethercis-1.2.0/lib/system/gson-jodatime-serialisers-1.2.0.jar b/application/ethercis-1.2.0/lib/system/gson-jodatime-serialisers-1.2.0.jar new file mode 100644 index 0000000..73ceb3c Binary files /dev/null and b/application/ethercis-1.2.0/lib/system/gson-jodatime-serialisers-1.2.0.jar differ diff --git a/application/ethercis-1.2.0/lib/system/jackson-annotations-2.7.0.jar b/application/ethercis-1.2.0/lib/system/jackson-annotations-2.7.0.jar new file mode 100644 index 0000000..96fb17c Binary files /dev/null and b/application/ethercis-1.2.0/lib/system/jackson-annotations-2.7.0.jar differ diff --git a/application/ethercis-1.2.0/lib/system/jackson-core-2.7.2.jar b/application/ethercis-1.2.0/lib/system/jackson-core-2.7.2.jar new file mode 100644 index 0000000..ecddad3 Binary files /dev/null and b/application/ethercis-1.2.0/lib/system/jackson-core-2.7.2.jar differ diff --git a/application/ethercis-1.2.0/lib/system/jackson-databind-2.7.2.jar b/application/ethercis-1.2.0/lib/system/jackson-databind-2.7.2.jar new file mode 100644 index 0000000..d220589 Binary files /dev/null and b/application/ethercis-1.2.0/lib/system/jackson-databind-2.7.2.jar differ diff --git a/application/ethercis-1.2.0/lib/system/jackson-datatype-joda-2.7.2.jar b/application/ethercis-1.2.0/lib/system/jackson-datatype-joda-2.7.2.jar new file mode 100644 index 0000000..28074c9 Binary files /dev/null and b/application/ethercis-1.2.0/lib/system/jackson-datatype-joda-2.7.2.jar differ diff --git a/application/ethercis-1.1.0/lib/system/javolution-5.2.3.jar b/application/ethercis-1.2.0/lib/system/javolution-5.2.3.jar similarity index 100% rename from application/ethercis-1.1.0/lib/system/javolution-5.2.3.jar rename to application/ethercis-1.2.0/lib/system/javolution-5.2.3.jar diff --git a/application/ethercis-1.1.0/lib/system/jdom-1.1.3.jar b/application/ethercis-1.2.0/lib/system/jdom-1.1.3.jar similarity index 100% rename from application/ethercis-1.1.0/lib/system/jdom-1.1.3.jar rename to application/ethercis-1.2.0/lib/system/jdom-1.1.3.jar diff --git a/application/ethercis-1.1.0/lib/system/jersey-json-1.19.jar b/application/ethercis-1.2.0/lib/system/jersey-json-1.19.jar similarity index 100% rename from application/ethercis-1.1.0/lib/system/jersey-json-1.19.jar rename to application/ethercis-1.2.0/lib/system/jersey-json-1.19.jar diff --git a/application/ethercis-1.2.0/lib/system/jetty-servlet-9.2.10.v20150310.jar b/application/ethercis-1.2.0/lib/system/jetty-servlet-9.2.10.v20150310.jar new file mode 100644 index 0000000..9dc9523 Binary files /dev/null and b/application/ethercis-1.2.0/lib/system/jetty-servlet-9.2.10.v20150310.jar differ diff --git a/application/ethercis-1.2.0/lib/system/joda-time-2.4.jar b/application/ethercis-1.2.0/lib/system/joda-time-2.4.jar new file mode 100644 index 0000000..ace67d7 Binary files /dev/null and b/application/ethercis-1.2.0/lib/system/joda-time-2.4.jar differ diff --git a/application/ethercis-1.1.0/lib/system/jooq-3.5.3.jar b/application/ethercis-1.2.0/lib/system/jooq-3.5.3.jar similarity index 100% rename from application/ethercis-1.1.0/lib/system/jooq-3.5.3.jar rename to application/ethercis-1.2.0/lib/system/jooq-3.5.3.jar diff --git a/application/ethercis-1.1.0/lib/system/jscience-4.3.1.jar b/application/ethercis-1.2.0/lib/system/jscience-4.3.1.jar similarity index 100% rename from application/ethercis-1.1.0/lib/system/jscience-4.3.1.jar rename to application/ethercis-1.2.0/lib/system/jscience-4.3.1.jar diff --git a/application/ethercis-1.1.0/lib/system/postgresql-9.4-1204.jdbc42.jar b/application/ethercis-1.2.0/lib/system/postgresql-9.4-1204.jdbc42.jar similarity index 100% rename from application/ethercis-1.1.0/lib/system/postgresql-9.4-1204.jdbc42.jar rename to application/ethercis-1.2.0/lib/system/postgresql-9.4-1204.jdbc42.jar diff --git a/application/ethercis-1.2.0/lib/system/thinkehr-framework-jsonlib-2.3.0-JL32.jar b/application/ethercis-1.2.0/lib/system/thinkehr-framework-jsonlib-2.3.0-JL32.jar new file mode 100644 index 0000000..07d046e Binary files /dev/null and b/application/ethercis-1.2.0/lib/system/thinkehr-framework-jsonlib-2.3.0-JL32.jar differ diff --git a/docker-compose.yml b/docker-compose.yml index b472816..1921e09 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,3 +19,5 @@ services: build: ./postgres # Name image image: ethercis-db + ports: + - "2345:5432" diff --git a/postgres/Dockerfile b/postgres/Dockerfile index 2233c7f..1766790 100644 --- a/postgres/Dockerfile +++ b/postgres/Dockerfile @@ -1,8 +1,8 @@ -FROM postgres:9.4 +FROM postgres:10.4 -MAINTAINER Alessandro Fael Garcia +MAINTAINER Alessandro Fael Garcia , Shinji Kobayashi -LABEL EtherCIS-Version="1.1.0" \ +LABEL EtherCIS-Version="1.2.0" \ Description="Docker image for the EtherCIS database" # The following list of commands is executed in the same RUN block to @@ -13,7 +13,7 @@ RUN apt-get update && apt-get install -y \ flex \ gcc \ git \ - postgresql-server-dev-9.4 \ + postgresql-server-dev-10.4 \ make \ # Install temporal tables extension && git clone https://github.com/arkhipov/temporal_tables \ @@ -35,7 +35,7 @@ RUN apt-get update && apt-get install -y \ flex \ gcc \ git \ - postgresql-server-dev-9.4 \ + postgresql-server-dev-10.4 \ make \ && apt-get autoremove -y diff --git a/postgres/scripts/pgsql_ehr.ddl b/postgres/scripts/pgsql_ehr.ddl index 091130c..55c827c 100644 --- a/postgres/scripts/pgsql_ehr.ddl +++ b/postgres/scripts/pgsql_ehr.ddl @@ -1,4 +1,4 @@ --- Generate EtherCIS tables for PostgreSQL 9.4 +-- Generate EtherCIS tables for PostgreSQL 9.3 -- Author: Christian Chevalley -- -- @@ -8,35 +8,31 @@ -- -- alter table com.ethercis.ehr.consult_req_attachement -- drop constraint FKC199A3AA4204581F; --- Rev 1.1 2/8/16 CCH -- drop schema if exists ehr cascade; -- drop schema if exists common cascade; create schema ehr; -CREATE EXTENSION IF NOT EXISTS "temporal_tables" WITH SCHEMA ehr; +CREATE EXTENSION IF NOT EXISTS temporal_tables WITH SCHEMA ehr; -CREATE EXTENSION IF NOT EXISTS "ltree"; - -CREATE EXTENSION IF NOT EXISTS "jsquery"; -- required to be able to auto generate uuids -CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA ehr; +CREATE EXTENSION "uuid-ossp" WITH SCHEMA ehr; -- storeComposition schema common; -- storeComposition common_im entities -- CREATE TABLE "system" --------------------------------------- -CREATE TABLE ehr.system ( +CREATE TABLE ehr.system ( id UUid PRIMARY KEY DEFAULT ehr.uuid_generate_v4(), - description Character Varying( 100 ) NOT NULL, + description Character Varying( 100 ) NOT NULL, settings Character Varying( 250 ) NOT NULL ); - + COMMENT ON TABLE ehr.system IS 'system table for reference'; -CREATE TABLE ehr.territory ( +CREATE TABLE ehr.territory ( code int unique primary key, -- numeric code twoLetter char(2), threeLetter char(3), @@ -45,15 +41,15 @@ CREATE TABLE ehr.territory ( COMMENT ON TABLE ehr.territory IS 'ISO 3166-1 countries codeset'; -CREATE TABLE ehr.language ( - code varchar(5) unique primary key, +CREATE TABLE ehr.language ( + code varchar(5) unique primary key, description Character Varying( 100 ) NOT NULL ); COMMENT ON TABLE ehr.language IS 'ISO 639-1 language codeset'; - -CREATE TABLE ehr.terminology_provider ( - code varchar(20) unique primary key, + +CREATE TABLE ehr.terminology_provider ( + code varchar(20) unique primary key, source Character Varying( 100 ) NOT NULL, authority varchar(50) ); @@ -62,7 +58,7 @@ COMMENT ON TABLE ehr.terminology_provider IS 'openEHR identified terminology pr CREATE TABLE ehr.concept ( id UUID unique primary key DEFAULT ehr.uuid_generate_v4(), - conceptID int, + conceptID int, language varchar(5) references ehr.language(code), description varchar(250) ); @@ -96,9 +92,9 @@ create table ehr.access ( settings varchar(250), scheme char(50) -- name of access control scheme ); - + COMMENT ON TABLE ehr.access IS 'defines the modality for accessing an com.ethercis.ehr (security strategy implementation)'; --- +-- -- storeComposition ehr_im entities -- EHR Class emr_im 4.7.1 @@ -304,6 +300,17 @@ create TABLE ehr.containment ( path text ); +CREATE INDEX label_idx ON ehr.containment USING BTREE(label); +CREATE INDEX comp_id_idx ON ehr.containment USING BTREE(comp_id); + +-- simple cross reference table to link INSTRUCTIONS with ACTIONS or other COMPOSITION +CREATE TABLE ehr.compo_xref ( + master_uuid UUID REFERENCES ehr.composition(id), + child_uuid UUID REFERENCES ehr.composition(id), + sys_transaction TIMESTAMP NOT NULL +); +CREATE INDEX ehr_compo_xref ON ehr.compo_xref USING BTREE (master_uuid); + -- views to abstract querying -- EHR STATUS CREATE VIEW ehr.ehr_status AS @@ -357,7 +364,23 @@ CREATE OR REPLACE VIEW ehr.comp_expand AS INNER JOIN ehr.status status ON status.ehr_id = ehr.id LEFT JOIN ehr.party_identified party ON status.party = party.id -- LEFT JOIN ehr.system sys ON ctx.setting = sys.id - LEFT JOIN ehr.party_identified fclty ON ctx.facility = fclty.id + LEFT JOIN ehr.party_identified fclty ON ctx.facility = fclty.id; + +--- CREATED INDEX +CREATE INDEX label_idx ON ehr.containment USING GIST (label); +CREATE INDEX comp_id_idx ON ehr.containment USING BTREE(comp_id); +CREATE INDEX gin_entry_path_idx ON ehr.entry USING gin(entry jsonb_path_ops); +CREATE INDEX template_entry_idx ON ehr.entry (template_id); + +-- to optimize comp_expand, index FK's +CREATE INDEX entry_composition_id_idx ON ehr.entry (composition_id); +CREATE INDEX composition_composer_idx ON ehr.composition (composer); +CREATE INDEX composition_ehr_idx ON ehr.composition (ehr_id); +CREATE INDEX status_ehr_idx ON ehr.status (ehr_id); +CREATE INDEX status_party_idx ON ehr.status (party); +CREATE INDEX context_facility_idx ON ehr.event_context (facility); +CREATE INDEX context_composition_id_idx ON ehr.event_context (composition_id); +CREATE INDEX context_setting_idx ON ehr.event_context (setting); -- AUDIT TRAIL has been replaced by CONTRIBUTION @@ -371,3 +394,4 @@ CREATE OR REPLACE VIEW ehr.comp_expand AS -- serial_version VARCHAR(50), -- system_id UUID references ehr.system(id) -- ); + diff --git a/postgres/scripts/pgsql_ehr.ddl.old b/postgres/scripts/pgsql_ehr.ddl.old new file mode 100644 index 0000000..091130c --- /dev/null +++ b/postgres/scripts/pgsql_ehr.ddl.old @@ -0,0 +1,373 @@ +-- Generate EtherCIS tables for PostgreSQL 9.4 +-- Author: Christian Chevalley +-- +-- +-- +-- alter table com.ethercis.ehr.consult_req_attachement +-- drop constraint FKC199A3AAB95913AB; +-- +-- alter table com.ethercis.ehr.consult_req_attachement +-- drop constraint FKC199A3AA4204581F; +-- Rev 1.1 2/8/16 CCH +-- +drop schema if exists ehr cascade; +-- drop schema if exists common cascade; + +create schema ehr; + +CREATE EXTENSION IF NOT EXISTS "temporal_tables" WITH SCHEMA ehr; + +CREATE EXTENSION IF NOT EXISTS "ltree"; + +CREATE EXTENSION IF NOT EXISTS "jsquery"; +-- required to be able to auto generate uuids +CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA ehr; + +-- storeComposition schema common; + + +-- storeComposition common_im entities +-- CREATE TABLE "system" --------------------------------------- +CREATE TABLE ehr.system ( + id UUid PRIMARY KEY DEFAULT ehr.uuid_generate_v4(), + description Character Varying( 100 ) NOT NULL, + settings Character Varying( 250 ) NOT NULL + ); + +COMMENT ON TABLE ehr.system IS 'system table for reference'; + +CREATE TABLE ehr.territory ( + code int unique primary key, -- numeric code + twoLetter char(2), + threeLetter char(3), + text Character Varying( 100 ) NOT NULL + ); + +COMMENT ON TABLE ehr.territory IS 'ISO 3166-1 countries codeset'; + +CREATE TABLE ehr.language ( + code varchar(5) unique primary key, + description Character Varying( 100 ) NOT NULL + ); + +COMMENT ON TABLE ehr.language IS 'ISO 639-1 language codeset'; + +CREATE TABLE ehr.terminology_provider ( + code varchar(20) unique primary key, + source Character Varying( 100 ) NOT NULL, + authority varchar(50) + ); + +COMMENT ON TABLE ehr.terminology_provider IS 'openEHR identified terminology provider'; + +CREATE TABLE ehr.concept ( + id UUID unique primary key DEFAULT ehr.uuid_generate_v4(), + conceptID int, + language varchar(5) references ehr.language(code), + description varchar(250) + ); + +COMMENT ON TABLE ehr.concept IS 'openEHR common concepts (e.g. terminology) used in the system'; + +create table ehr.party_identified ( + id UUID primary key DEFAULT ehr.uuid_generate_v4(), + name varchar(50), + -- optional party ref attributes + party_ref_value VARCHAR(50), + party_ref_scheme VARCHAR(100), + party_ref_namespace VARCHAR(50), + party_ref_type VARCHAR(50) +); + +-- list of identifiers for a party identified +create table ehr.identifier ( + id_value VARCHAR(50), -- identifier value + issuer VARCHAR(50), -- authority responsible for the identification (ex. France ASIP, LDAP server etc.) + assigner VARCHAR(50), -- assigner of the identifier + type_name VARCHAR(50), -- coding origin f.ex. INS-C, INS-A, NHS etc. + party UUID not null references ehr.party_identified(id) -- entity identified with this identifier (normally a person, patient etc.) +); + +COMMENT ON TABLE ehr.identifier IS 'specifies an identifier for a party identified, more than one identifier is possible'; + +-- defines the modality for accessing an com.ethercisrcis.ehr +create table ehr.access ( + id UUID PRIMARY KEY DEFAULT ehr.uuid_generate_v4(), + settings varchar(250), + scheme char(50) -- name of access control scheme + ); + +COMMENT ON TABLE ehr.access IS 'defines the modality for accessing an com.ethercis.ehr (security strategy implementation)'; +-- + +-- storeComposition ehr_im entities +-- EHR Class emr_im 4.7.1 +create table ehr.ehr ( + id UUID NOT NULL PRIMARY KEY DEFAULT ehr.uuid_generate_v4(), + date_created timestamp default CURRENT_DATE, + date_created_tzid VARCHAR(15), -- timezone id: GMT+/-hh:mm + access UUID references ehr.access(id), -- access decision support (f.e. consent) +-- status UUID references ehr.status(id), + system_id UUID references ehr.system(id), + directory UUID null +); +COMMENT ON TABLE ehr.ehr IS 'EHR itself'; + +create table ehr.status ( + id UUID NOT NULL PRIMARY KEY DEFAULT ehr.uuid_generate_v4(), + ehr_id UUID references ehr.ehr(id) ON DELETE CASCADE, + is_queryable boolean default true, + is_modifiable boolean default true, + party UUID not null references ehr.party_identified(id), -- subject (e.g. patient) + other_details JSONB, + sys_transaction TIMESTAMP NOT NULL, + sys_period tstzrange NOT NULL -- temporal table +); + +-- change history table +create table ehr.status_history (like ehr.status); +CREATE INDEX ehr_status_history ON ehr.status_history USING BTREE (id); + +CREATE TRIGGER versioning_trigger BEFORE INSERT OR UPDATE OR DELETE ON ehr.status +FOR EACH ROW EXECUTE PROCEDURE ehr.versioning('sys_period', 'ehr.status_history', true); + +COMMENT ON TABLE ehr.status IS 'specifies an ehr modality and ownership (patient)'; + +--storeComposition table ehr.event_participation ( +-- context UUID references ehr.event_context(id), +-- participation UUID references ehr.participation(id) +--); + +-- COMMENT ON TABLE ehr.event_participation IS 'specifies parties participating in an event context'; + +-- TODO make it compliant with openEHR common IM section 6 +-- storeComposition table ehr.versioned ( +-- id UUID PRIMARY KEY DEFAULT ehr.uuid_generate_v4(),-- this is used by the object which this version def belongs to (composition etc.) +-- object UUID not null, -- a versioning strategy identifier, can be generated by the RDBMS (PG) +-- created timestamp default NOW() +-- ); + +-- COMMENT ON TABLE ehr.versioned IS 'used to reference a versioning system'; +create type ehr.contribution_data_type as enum('composition', 'folder', 'ehr', 'system', 'other'); +create type ehr.contribution_state as enum('complete', 'incomplete', 'deleted'); +create type ehr.contribution_change_type as enum('creation', 'amendment', 'modification', 'synthesis', 'Unknown', 'deleted'); + +-- COMMON IM +-- change control + +create table ehr.contribution ( + id UUID primary key DEFAULT ehr.uuid_generate_v4(), + ehr_id UUID references ehr.ehr(id) ON DELETE CASCADE , + contribution_type ehr.contribution_data_type, -- specifies the type of data it contains + state ehr.contribution_state, -- current state in lifeCycleState + signature TEXT, + system_id UUID references ehr.system(id), + committer UUID references ehr.party_identified(id), + time_committed timestamp default NOW(), + time_committed_tzid VARCHAR(15), -- timezone id + change_type ehr.contribution_change_type, + description varchar(100), -- is a DvCodedText + sys_transaction TIMESTAMP NOT NULL, + sys_period tstzrange NOT NULL -- temporal table +); + +create table ehr.attestation ( + id UUID PRIMARY KEY DEFAULT ehr.uuid_generate_v4(), + contribution_id UUID REFERENCES ehr.contribution(id) ON DELETE CASCADE , + proof TEXT, + reason VARCHAR(50), + is_pending BOOLEAN +); + +CREATE TABLE ehr.attested_view ( + id UUID PRIMARY KEY DEFAULT ehr.uuid_generate_v4(), + attestation_id UUID REFERENCES ehr.attestation(id) ON DELETE CASCADE, + -- DvMultimedia + alternate_text VARCHAR(50), + compression_algorithm VARCHAR(50), + media_type VARCHAR(50), + data BYTEA, + integrity_check BYTEA, + integrity_check_algorithm VARCHAR(50), + thumbnail UUID, -- another multimedia holding the thumbnail + uri TEXT +); + +-- change history table +CREATE TABLE ehr.contribution_history (like ehr.contribution); +CREATE INDEX ehr_contribution_history ON ehr.contribution_history USING BTREE (id); + +COMMENT ON TABLE ehr.contribution IS 'Contribution table, compositions reference this table'; + +CREATE TRIGGER versioning_trigger BEFORE INSERT OR UPDATE OR DELETE ON ehr.contribution +FOR EACH ROW EXECUTE PROCEDURE ehr.versioning('sys_period', 'ehr.contribution_history', true); + +create table ehr.composition ( + id UUID PRIMARY KEY DEFAULT ehr.uuid_generate_v4(), + ehr_id UUID references ehr.ehr(id) ON DELETE CASCADE, +-- version UUID references ehr.versioned(id), + in_contribution UUID references ehr.contribution(id) ON DELETE CASCADE , -- in contribution version + active boolean default true, -- true if this composition is still valid (e.g. not replaced yet) + is_persistent boolean default true, + language varchar(5) references ehr.language(code), -- pointer to the language codeset. Indicates what broad category this Composition is belogs to, e.g. �persistent� - of longitudinal validity, �event�, �process� etc. + territory int references ehr.territory(code), -- Name of territory in which this Composition was written. Coded fromBinder openEHR �countries� code set, which is an expression of the ISO 3166 standard. + composer UUID not null references ehr.party_identified(id), -- points to the PARTY_PROXY who has created the composition + sys_transaction TIMESTAMP NOT NULL, + sys_period tstzrange NOT NULL -- temporal table + -- item UUID not null, -- point to the first section in composition +); + +-- change history table +CREATE TABLE ehr.composition_history (like ehr.composition); +CREATE INDEX ehr_composition_history ON ehr.composition_history USING BTREE (id); + +COMMENT ON TABLE ehr.composition IS 'Composition table'; + +CREATE TRIGGER versioning_trigger BEFORE INSERT OR UPDATE OR DELETE ON ehr.composition +FOR EACH ROW EXECUTE PROCEDURE ehr.versioning('sys_period', 'ehr.composition_history', true); + +create table ehr.event_context ( + id UUID primary key DEFAULT ehr.uuid_generate_v4(), + composition_id UUID references ehr.composition(id) ON DELETE CASCADE , -- belong to composition + start_time TIMESTAMP not null, + start_time_tzid VARCHAR(15), -- time zone id: format GMT +/- hh:mm + end_time TIMESTAMP null, + end_time_tzid VARCHAR(15), -- time zone id: format GMT +/- hh:mm + facility UUID references ehr.party_identified(id), -- points to a party identified + location varchar(50), + other_context JSONB, -- supports a cluster for other context definition + setting UUID references ehr.concept(id), -- codeset setting, see ehr_im section 5 +-- program UUID references ehr.program(id), -- the program defined for this context (only in full ddl version) + sys_transaction TIMESTAMP NOT NULL, + sys_period tstzrange NOT NULL -- temporal table +); + +-- change history table +create table ehr.event_context_history (like ehr.event_context); +CREATE INDEX ehr_event_context_history ON ehr.event_context_history USING BTREE (id); + +CREATE TRIGGER versioning_trigger BEFORE INSERT OR UPDATE OR DELETE ON ehr.event_context +FOR EACH ROW EXECUTE PROCEDURE ehr.versioning('sys_period', 'ehr.event_context_history', true); + +COMMENT ON TABLE ehr.event_context IS 'defines the context of an event (time, who, where... see openEHR IM 5.2'; + +create table ehr.participation ( + id UUID primary key DEFAULT ehr.uuid_generate_v4(), + event_context UUID NOT NULL REFERENCES ehr.event_context(id) ON DELETE CASCADE, + performer UUID references ehr.party_identified(id), + function VARCHAR(50), + mode VARCHAR(50), + start_time timestamp, + start_time_tzid VARCHAR(15), -- timezone id + sys_transaction TIMESTAMP NOT NULL, + sys_period tstzrange NOT NULL -- temporal table +); + +-- change history table +create table ehr.participation_history (like ehr.participation); +CREATE INDEX ehr_participation_history ON ehr.participation_history USING BTREE (id); + +CREATE TRIGGER versioning_trigger BEFORE INSERT OR UPDATE OR DELETE ON ehr.participation +FOR EACH ROW EXECUTE PROCEDURE ehr.versioning('sys_period', 'ehr.participation_history', true); + +COMMENT ON TABLE ehr.participation IS 'define a participating party for an event f.ex.'; + +create type ehr.entry_type as enum('section','care_entry', 'admin', 'proxy'); + +create table ehr.entry ( + id UUID primary key DEFAULT ehr.uuid_generate_v4(), + composition_id UUID references ehr.composition(id) ON DELETE CASCADE , -- belong to composition + sequence int, -- ordering sequence number + item_type ehr.entry_type, + template_id VARCHAR(250), -- operational template to rebuild the structure entry + template_uuid UUID, -- optional, used with operational template for consistency + archetype_id VARCHAR(250), -- ROOT archetype id (not sure still in use...) + category UUID null references ehr.concept(id), -- used to specify the type of content: Evaluation, Instruction, Observation, Action with different languages + entry JSONB, -- actual content version dependent (9.3: json, 9.4: jsonb). entry is either CARE_ENTRY or ADMIN_ENTRY + sys_transaction TIMESTAMP NOT NULL, + sys_period tstzrange NOT NULL -- temporal table +); + +-- change history table +CREATE TABLE ehr.entry_history (like ehr.entry); +CREATE INDEX ehr_entry_history ON ehr.entry_history USING BTREE (id); + +COMMENT ON TABLE ehr.entry IS 'this table hold the actual archetyped data values (fromBinder a template)'; + +CREATE TRIGGER versioning_trigger BEFORE INSERT OR UPDATE OR DELETE ON ehr.entry +FOR EACH ROW EXECUTE PROCEDURE ehr.versioning('sys_period', 'ehr.entry_history', true); + +-- CONTAINMENT "pseudo" index for CONTAINS clause resolution +create TABLE ehr.containment ( + comp_id UUID, + label ltree, + path text +); + +-- views to abstract querying +-- EHR STATUS +CREATE VIEW ehr.ehr_status AS + SELECT ehr.id, party.name AS name, + party.party_ref_value AS ref, + party.party_ref_scheme AS scheme, + party.party_ref_namespace AS namespace, + party.party_ref_type AS type, + identifier.* + FROM ehr.ehr ehr + INNER JOIN ehr.status status ON status.ehr_id = ehr.id + INNER JOIN ehr.party_identified party ON status.party = party.id + LEFT JOIN ehr.identifier identifier ON identifier.party = party.id; + +-- Composition expanded view (include context and other meta_data +CREATE OR REPLACE VIEW ehr.comp_expand AS + SELECT + ehr.id AS ehr_id, + party.party_ref_value AS subject_externalref_id_value, + party.party_ref_namespace AS subject_externalref_id_namespace, + entry.composition_id, + entry.template_id, + entry.archetype_id, + entry.entry, + trim(LEADING '''' FROM (trim(TRAILING ''']' FROM + (regexp_split_to_array(json_object_keys(entry.entry :: JSON), 'and name/value=')) [2 + ]))) AS composition_name, + compo.language, + compo.territory, + ctx.start_time, + ctx.start_time_tzid, + ctx.end_time, + ctx.end_time_tzid, + ctx.other_context, + ctx.location AS ctx_location, + fclty.name AS facility_name, + fclty.party_ref_value AS facility_ref, + fclty.party_ref_scheme AS facility_scheme, + fclty.party_ref_namespace AS facility_namespace, + fclty.party_ref_type AS facility_type, + compr.name AS composer_name, + compr.party_ref_value AS composer_ref, + compr.party_ref_scheme AS composer_scheme, + compr.party_ref_namespace AS composer_namespace, + compr.party_ref_type AS composer_type + FROM ehr.entry + INNER JOIN ehr.composition compo ON compo.id = ehr.entry.composition_id + INNER JOIN ehr.event_context ctx ON ctx.composition_id = ehr.entry.composition_id + INNER JOIN ehr.party_identified compr ON compo.composer = compr.id + INNER JOIN ehr.ehr ehr ON ehr.id = compo.ehr_id + INNER JOIN ehr.status status ON status.ehr_id = ehr.id + LEFT JOIN ehr.party_identified party ON status.party = party.id + -- LEFT JOIN ehr.system sys ON ctx.setting = sys.id + LEFT JOIN ehr.party_identified fclty ON ctx.facility = fclty.id + + +-- AUDIT TRAIL has been replaced by CONTRIBUTION +-- create table ehr.audit_trail ( +-- id UUID PRIMARY KEY DEFAULT ehr.uuid_generate_v4(), +-- composition_id UUID references ehr.composition(id), +-- committer UUID not null references ehr.party_identified(id), -- contributor +-- date_created TIMESTAMP, +-- date_created_tzid VARCHAR(15), -- timezone id +-- party UUID not null references ehr.party_identified(id), -- patient +-- serial_version VARCHAR(50), +-- system_id UUID references ehr.system(id) +-- );