-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ajustement 5_base/data * OP-975 Added additional filters to uspAPIGetClaims (#157) * OP-1066: modular IMIS: time correlations don't work (#158) * SubmitSingleClaim SP is now includes historical timestamp for ProductItems/ProductServices * SubmitSingleClaim SP is now taking historical data for items/services * Historical Price lists are taken care while processing claims * OTC-780: update business logic (#160) * OTC-780: update business logic: items/serives left is now being calculate as a sum of quantity in all valid claims assigned to insuree * OTC-780: refactor the code * Update openmis-module-test.yml * Devision by 0 while calculating Allocated amount (#159) * change encoding to UTF-8 * UTF-8 + LF * Merge docker and fix SQL * remove run that never stops * to unblock CI on other repo * fix end date for batch process the old code does a process date between start and stop date BUT processdate is a DateTime so any datetime after 0.00 on the last day was NOT taken into account * Capitation : Wrong formula to calculate allocation is fixed * Change type of env INIT_MODE from 'empty' to empty * Update Dockerfile * Update Dockerfile * Fixed the INIT_MODE variable * utf-8 * Update docker.yml --------- Co-authored-by: mngoe <[email protected]> Co-authored-by: Kamil Malinowski <[email protected]> Co-authored-by: Hiren Soni <[email protected]> Co-authored-by: Jan <[email protected]> Co-authored-by: Patrick Delcroix <[email protected]> Co-authored-by: Patrick Delcroix <[email protected]> Co-authored-by: Hiren Soni <[email protected]> Co-authored-by: Damian Borowiecki <[email protected]>
- Loading branch information
1 parent
b34fd20
commit e644f1d
Showing
20 changed files
with
6,101 additions
and
4,540 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: publish | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
default: latest | ||
description: build tag | ||
required: false | ||
jobs: | ||
publish-docker-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build the hello-docker Docker image | ||
run: | | ||
TAG_INPUT=${{ github.event.inputs.tag }} | ||
docker build . --tag ghcr.io/openimis/openimis-mssql:${TAG_INPUT:-"latest"} | ||
docker push ghcr.io/openimis/openimis-mssql:${TAG_INPUT:-"latest"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM mcr.microsoft.com/mssql/server:2017-latest | ||
ARG ACCEPT_EULA=Y | ||
ENV ACCEPT_EULA=N | ||
ARG SA_PASSWORD=IMISuserP@s | ||
ENV SA_PASSWORD=IMISuserP@s | ||
ENV DB_USER_PASSWORD=IMISuserP@s | ||
ENV DB_NAME=IMIS | ||
ENV DB_USER=IMISUser | ||
ENV INIT_MODE=empty | ||
RUN mkdir -p /app | ||
COPY script/* /app/ | ||
COPY sql /app/sql | ||
WORKDIR /app | ||
RUN chmod a+x /app/*.sh | ||
CMD /bin/bash ./entrypoint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
mkdir output | ||
cat sql/migrations/1_migration_latest.sql sql/stored_procedures/*.sql > output/fullMigrationScipt.sql | ||
cat sql/base/*.sql sql/stored_procedures/*.sql > output/fullEmptyDatabase.sql | ||
cat sql/base/*.sql sql/stored_procedures/*.sql sql/demo/*.sql> output/fullDemoDatabase.sql | ||
cat sql/base/*.sql sql/stored_procedures/*.sql sql/offline/central.sql > output/fullOfflineCentralDatabase.sql | ||
cat sql/base/*.sql sql/stored_procedures/*.sql sql/offline/hf.sql > output/fullOfflineHFDatabase.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# https://www.softwaredeveloper.blog/initialize-mssql-in-docker-container | ||
|
||
# Run Microsoft SQl Server and initialization script (at the same time) | ||
/app/run-initialization.sh & /opt/mssql/bin/sqlservr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
data=$(/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P $SA_PASSWORD -Q "SELECT COUNT(*) FROM master.dbo.sysdatabases WHERE name = N'$DB_NAME'" | tr -dc '0-9'| cut -c1 ) | ||
if [ ${data} -eq "1" ]; then | ||
exit 0 | ||
else | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
|
||
# Wait to be sure that SQL Server came up | ||
sleep 60s | ||
|
||
|
||
# DATABSE initialisation | ||
|
||
echo "Database initialisaton" | ||
# if the table does not exsit it will create the table | ||
|
||
# get "1" if the database exist : tr get only the integer, cut only the first integer (the second is the number of row affected) | ||
data=$(/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P $SA_PASSWORD -Q "SELECT COUNT(*) FROM master.dbo.sysdatabases WHERE name = N'$DB_NAME'" | tr -dc '0-9'| cut -c1 ) | ||
if [ ${data} -eq "0" ]; then | ||
echo 'download full demo database' | ||
echo 'create database user' | ||
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P $SA_PASSWORD -Q "CREATE LOGIN $DB_USER WITH PASSWORD='${SA_PASSWORD}', CHECK_POLICY = OFF" | ||
echo "merging files" | ||
./concatenate_files.sh | ||
echo 'create database' | ||
#/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P $SA_PASSWORD -Q "DROP DATABASE IF EXISTS $DB_NAME" | ||
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P $SA_PASSWORD -Q "CREATE DATABASE $DB_NAME" | ||
|
||
if [ "$INIT_MODE" = "demo" ]; then | ||
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P $SA_PASSWORD -i output/fullDemoDatabase.sql -d $DB_NAME | grep . | uniq -c | ||
else | ||
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P $SA_PASSWORD -i output/fullEmptyDatabase.sql -d $DB_NAME | grep . | uniq -c | ||
fi | ||
echo ' give to the user the access to the database' | ||
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P $SA_PASSWORD -Q "EXEC sp_changedbowner '$DB_USER'" -d $DB_NAME | ||
else | ||
echo "database already existing, nothing to do" | ||
fi | ||
|
||
# manual cleaning command | ||
# /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P $SA_PASSWORD -Q "DROP DATABASE $DB_NAME" | ||
# /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P $SA_PASSWORD -Q "DROP LOGIN $DB_USER" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.