diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 9434ed123..c2b0abd5d 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -7,63 +7,22 @@ on: [push, pull_request] jobs: build: + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - with: - persist-credentials: false - - - name: Checkout core - run: git clone --depth=50 --branch=develop https://github.com/informatici/openhospital-core.git openhospital-core - - - name: Install core - run: cd openhospital-core && mvn install -DskipTests=true && cd .. - - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - - name: Generate JWT Token - id: jwt - run: echo "token=7DlyD1SHR5pCa4HGgTLWSYm8YQ7oRL1wpPbxyjWyHU44vUrqrooRu3lHVFSXWChesc" >> $GITHUB_OUTPUT - - - name: Store branch name - id: extract_branch - run: | - if [[ "${GITHUB_EVENT_NAME}" == "push" ]]; then - echo "branch=$(echo ${GITHUB_REF##*/})" >> $GITHUB_OUTPUT - elif [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then - echo "branch=$(echo ${GITHUB_HEAD_REF})" >> $GITHUB_OUTPUT - else - echo "branch=INVALID_EVENT_BRANCH_UNKNOWN" >> $GITHUB_OUTPUT - fi - - - name: Build with Maven - run: | - cp rsc/application.properties.dist rsc/application.properties - cp rsc/database.properties.dist rsc/database.properties - cp rsc/log4j.properties.dist rsc/log4j.properties - cp rsc/settings.properties.dist rsc/settings.properties - sed -e "s/JWT_TOKEN_SECRET/${{ steps.jwt.outputs.token }}/g" rsc/application.properties.dist > rsc/application.properties - mvn install -DskipTests=true - echo ${{ steps.extract_branch.outputs.branch }} - - - name: Run API - run: | - cd target - java -cp "openhospital-api-0.1.0.jar:rsc/:static/" org.springframework.boot.loader.JarLauncher & - sleep 60 - - - name: Generate OpenAPI yaml - run: mvn springdoc-openapi:generate - - - name: Update PR with OpenAPI specs changes (if any) - uses: gr2m/create-or-update-pull-request-action@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - commit-message: "GitHub Action: update openapi" - path: "openapi" - branch: ${{ steps.extract_branch.outputs.branch }} \ No newline at end of file + - uses: actions/checkout@v2 + + - name: Checkout core + run: git clone --depth=50 --branch=develop https://github.com/informatici/openhospital-core.git openhospital-core + + - name: Install core + run: cd openhospital-core && mvn install -DskipTests=true && cd .. + + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Build with Maven + run: mvn -B package --file pom.xml diff --git a/.github/workflows/openapi_update.yml b/.github/workflows/openapi_update.yml new file mode 100644 index 000000000..99b587c76 --- /dev/null +++ b/.github/workflows/openapi_update.yml @@ -0,0 +1,69 @@ +# This workflow will update OpenAPI specs file + +name: OpenAPI update + +on: + pull_request: + types: + - opened + - synchronize + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + persist-credentials: false + + - name: Checkout core + run: git clone --depth=50 --branch=develop https://github.com/informatici/openhospital-core.git openhospital-core + + - name: Install core + run: cd openhospital-core && mvn install -DskipTests=true && cd .. + + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Generate JWT Token + id: jwt + run: echo "token=7DlyD1SHR5pCa4HGgTLWSYm8YQ7oRL1wpPbxyjWyHU44vUrqrooRu3lHVFSXWChesc" >> $GITHUB_OUTPUT + + - name: Store branch name + id: extract_branch + run: | + echo "branch=$(echo ${GITHUB_HEAD_REF})" >> $GITHUB_OUTPUT + + - name: Build with Maven + run: | + cp rsc/application.properties.dist rsc/application.properties + cp rsc/database.properties.dist rsc/database.properties + cp rsc/log4j.properties.dist rsc/log4j.properties + cp rsc/settings.properties.dist rsc/settings.properties + sed -e "s/JWT_TOKEN_SECRET/${{ steps.jwt.outputs.token }}/g" rsc/application.properties.dist > rsc/application.properties + mvn install -DskipTests=true + + - name: Run API + run: | + cd target + java -cp "openhospital-api-0.1.0.jar:rsc/:static/" org.springframework.boot.loader.JarLauncher & + sleep 60 + + - name: Generate OpenAPI yaml + run: mvn springdoc-openapi:generate + + - name: Update PR with OpenAPI specs changes (if any) + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git clone --depth=1 --branch="${{ steps.extract_branch.outputs.branch }}" https://${{ github.repository_owner }}:${{ secrets.PAT_TOKEN }}@github.com/${{ github.repository_owner }}/openhospital-api.git origin-branch + cp -r openapi origin-branch/ + cd origin-branch + git add . + git commit -m "Update OpenAPI specs" + git push origin "${{ steps.extract_branch.outputs.branch }}" + env: + GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} diff --git a/TEST.md b/TEST.md new file mode 100644 index 000000000..8615dd105 --- /dev/null +++ b/TEST.md @@ -0,0 +1 @@ +TEST file for OH2-246 diff --git a/openapi/oh.yaml b/openapi/oh.yaml index a5c6a5086..cd98ba2f1 100644 --- a/openapi/oh.yaml +++ b/openapi/oh.yaml @@ -5855,11 +5855,11 @@ components: example: 0 opd: type: boolean - pharmacy: + female: type: boolean male: type: boolean - female: + pharmacy: type: boolean PatientDTO: required: @@ -7352,6 +7352,7 @@ components: - configName - configValue - id + - user type: object properties: id: @@ -7362,12 +7363,16 @@ components: configName: maxLength: 50 type: string - description: The the name of the setting + description: The name of the setting example: dashboard + user: + type: string + description: The name of the user + example: admin configValue: maxLength: 65535 type: string - description: The the value of the user + description: The value of the user UserMenuItemDTO: required: - altLabel @@ -7579,10 +7584,10 @@ components: $ref: '#/components/schemas/PatientProfilePhoto' patientConsensus: $ref: '#/components/schemas/PatientConsensus' - informations: - type: string searchString: type: string + informations: + type: string PatientConsensus: type: object properties: @@ -7703,8 +7708,6 @@ components: size: type: integer format: int32 - family: - type: string transform: type: object properties: @@ -7770,6 +7773,8 @@ components: italicAngle: type: number format: float + family: + type: string attributes: type: object additionalProperties: @@ -7788,8 +7793,6 @@ components: size: type: integer format: int32 - family: - type: string transform: type: object properties: @@ -7855,6 +7858,8 @@ components: italicAngle: type: number format: float + family: + type: string attributes: type: object additionalProperties: @@ -7871,15 +7876,6 @@ components: fontRenderContext: type: object properties: - antiAliasingHint: - type: object - fractionalMetricsHint: - type: object - antiAliased: - type: boolean - transformType: - type: integer - format: int32 transform: type: object properties: @@ -7919,6 +7915,15 @@ components: type: boolean transformed: type: boolean + antiAliasingHint: + type: object + fractionalMetricsHint: + type: object + antiAliased: + type: boolean + transformType: + type: integer + format: int32 maxAscent: type: integer format: int32 @@ -7967,25 +7972,25 @@ components: bounds2D: type: object properties: - maxX: + width: type: number format: double - maxY: + minX: type: number format: double - centerX: + minY: type: number format: double - centerY: + maxX: type: number format: double - width: + maxY: type: number format: double - minX: + centerX: type: number format: double - minY: + centerY: type: number format: double height: @@ -8013,25 +8018,25 @@ components: rect: type: object properties: - maxX: + width: type: number format: double - maxY: + minX: type: number format: double - centerX: + minY: type: number format: double - centerY: + maxX: type: number format: double - width: + maxY: type: number format: double - minX: + centerX: type: number format: double - minY: + centerY: type: number format: double height: @@ -8046,22 +8051,22 @@ components: empty: type: boolean writeOnly: true - maxX: + minX: type: number format: double - maxY: + minY: type: number format: double - centerX: + maxX: type: number format: double - centerY: + maxY: type: number format: double - minX: + centerX: type: number format: double - minY: + centerY: type: number format: double clip: @@ -8070,25 +8075,25 @@ components: bounds2D: type: object properties: - maxX: + width: type: number format: double - maxY: + minX: type: number format: double - centerX: + minY: type: number format: double - centerY: + maxX: type: number format: double - width: + maxY: type: number format: double - minX: + centerX: type: number format: double - minY: + centerY: type: number format: double height: @@ -8129,25 +8134,25 @@ components: bounds2D: type: object properties: - maxX: + width: type: number format: double - maxY: + minX: type: number format: double - centerX: + minY: type: number format: double - centerY: + maxX: type: number format: double - width: + maxY: type: number format: double - minX: + centerX: type: number format: double - minY: + centerY: type: number format: double height: @@ -8175,25 +8180,25 @@ components: rect: type: object properties: - maxX: + width: type: number format: double - maxY: + minX: type: number format: double - centerX: + minY: type: number format: double - centerY: + maxX: type: number format: double - width: + maxY: type: number format: double - minX: + centerX: type: number format: double - minY: + centerY: type: number format: double height: @@ -8208,22 +8213,22 @@ components: empty: type: boolean writeOnly: true - maxX: + minX: type: number format: double - maxY: + minY: type: number format: double - centerX: + maxX: type: number format: double - centerY: + maxY: type: number format: double - minX: + centerX: type: number format: double - minY: + centerY: type: number format: double clipRect: @@ -8253,25 +8258,25 @@ components: bounds2D: type: object properties: - maxX: + width: type: number format: double - maxY: + minX: type: number format: double - centerX: + minY: type: number format: double - centerY: + maxX: type: number format: double - width: + maxY: type: number format: double - minX: + centerX: type: number format: double - minY: + centerY: type: number format: double height: @@ -8299,25 +8304,25 @@ components: rect: type: object properties: - maxX: + width: type: number format: double - maxY: + minX: type: number format: double - centerX: + minY: type: number format: double - centerY: + maxX: type: number format: double - width: + maxY: type: number format: double - minX: + centerX: type: number format: double - minY: + centerY: type: number format: double height: @@ -8332,22 +8337,22 @@ components: empty: type: boolean writeOnly: true - maxX: + minX: type: number format: double - maxY: + minY: type: number format: double - centerX: + maxX: type: number format: double - centerY: + maxY: type: number format: double - minX: + centerX: type: number format: double - minY: + centerY: type: number format: double deprecated: true @@ -8414,13 +8419,13 @@ components: smsInt: type: integer format: int32 - medical: - type: integer - format: int32 notify: type: boolean sms: type: boolean + medical: + type: integer + format: int32 TherapyDTO: type: object properties: