Skip to content

Commit

Permalink
Debug. pull record functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
SanoferSameera committed Mar 26, 2024
1 parent e5757fb commit e6004a3
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 34 deletions.
69 changes: 35 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- master
- 'release-*'
- debug
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
Expand Down Expand Up @@ -48,38 +49,38 @@ jobs:
file: package/docker/Dockerfile
push: true
tags: bahmniindiadistro/hip:${{env.ARTIFACT_VERSION}},bahmniindiadistro/hip:latest
- name: Helm - Update Version and Image Tag
run: |
yq --inplace '.image.tag = "${{ env.ARTIFACT_VERSION }}"' $HELM_CHART_PATH/values.yaml
yq --inplace '.version = "${{ env.ARTIFACT_VERSION }}"' $HELM_CHART_PATH/Chart.yaml
- name: Helm Lint
run: helm lint $HELM_CHART_PATH

- name: Helm Package
run: helm package $HELM_CHART_PATH

- name: Helm - Checkout Charts Repository
uses: actions/checkout@v2
with:
repository: Bahmniindiadistro/helm-charts
ref: gh-pages
path: helm-charts
persist-credentials: false

- name: Helm - Copy chart
run: mkdir -p helm-charts/hip/ && cp hip-${{ env.ARTIFACT_VERSION }}.tgz helm-charts/hip/

- name: Helm - reIndex
working-directory: helm-charts/
run: helm repo index --merge index.yaml --url https://bahmniindiadistro.github.io/helm-charts/ .

- name: Helm - Publish Chart
working-directory: helm-charts/
run: |
git config user.name ${{ secrets.BAHMNI_USERNAME}}
git config user.email ${{ secrets.BAHMNI_EMAIL}}
git add .
git commit -m "Release of hip-${{ env.ARTIFACT_VERSION }}"
git push 'https://${{ secrets.BAHMNI_USERNAME}}:${{ secrets.BAHMNI_PAT}}@github.com/bahmniindiadistro/helm-charts.git' gh-pages
# - name: Helm - Update Version and Image Tag
# run: |
# yq --inplace '.image.tag = "${{ env.ARTIFACT_VERSION }}"' $HELM_CHART_PATH/values.yaml
# yq --inplace '.version = "${{ env.ARTIFACT_VERSION }}"' $HELM_CHART_PATH/Chart.yaml
#
# - name: Helm Lint
# run: helm lint $HELM_CHART_PATH
#
# - name: Helm Package
# run: helm package $HELM_CHART_PATH
#
# - name: Helm - Checkout Charts Repository
# uses: actions/checkout@v2
# with:
# repository: Bahmniindiadistro/helm-charts
# ref: gh-pages
# path: helm-charts
# persist-credentials: false
#
# - name: Helm - Copy chart
# run: mkdir -p helm-charts/hip/ && cp hip-${{ env.ARTIFACT_VERSION }}.tgz helm-charts/hip/
#
# - name: Helm - reIndex
# working-directory: helm-charts/
# run: helm repo index --merge index.yaml --url https://bahmniindiadistro.github.io/helm-charts/ .
#
# - name: Helm - Publish Chart
# working-directory: helm-charts/
# run: |
# git config user.name ${{ secrets.BAHMNI_USERNAME}}
# git config user.email ${{ secrets.BAHMNI_EMAIL}}
# git add .
# git commit -m "Release of hip-${{ env.ARTIFACT_VERSION }}"
# git push 'https://${{ secrets.BAHMNI_USERNAME}}:${{ secrets.BAHMNI_PAT}}@github.com/bahmniindiadistro/helm-charts.git' gh-pages

21 changes: 21 additions & 0 deletions src/In.ProjectEKA.HipService/DataFlow/DataFlowClient.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Reflection;

namespace In.ProjectEKA.HipService.DataFlow
{
using System;
Expand Down Expand Up @@ -53,6 +55,15 @@ private async Task PostTo(string consentId,
{
// TODO: Need to handle non 2xx response also
httpClient.DefaultRequestHeaders.Remove("Authorization");
Log.Information("Encrtpted data------->");
System.Type type = dataResponse.GetType();
PropertyInfo[] properties = type.GetProperties();

foreach (PropertyInfo property in properties)
{
object value = property.GetValue(dataResponse);
Log.Information($"{property.Name}: {value}");
}
await httpClient.SendAsync(CreateHttpRequest(HttpMethod.Post, dataPushUrl, dataResponse, correlationId)).ConfigureAwait(false);
}
catch (Exception exception)
Expand All @@ -76,6 +87,16 @@ private async Task PostTo(string consentId,
new StatusNotification(sessionStatus, gatewayConfiguration.ClientId, statusResponses),
consentId,
Guid.NewGuid());
Log.Information("Data Notification request------->");

System.Type type = dataNotificationRequest.GetType();
PropertyInfo[] properties = type.GetProperties();

foreach (PropertyInfo property in properties)
{
object value = property.GetValue(dataNotificationRequest);
Log.Information($"{property.Name}: {value}");
}
await GetDataNotificationRequest(dataNotificationRequest, cmSuffix, correlationId).ConfigureAwait(false);
}
catch (Exception ex)
Expand Down
10 changes: 10 additions & 0 deletions src/In.ProjectEKA.HipService/DataFlow/DataFlowMessageHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Reflection;
using In.ProjectEKA.HipLibrary.Patient.Model;
using In.ProjectEKA.HipService.Logger;

namespace In.ProjectEKA.HipService.DataFlow
{
Expand All @@ -25,6 +27,14 @@ public async Task HandleDataFlowMessage(TraceableDataRequest dataRequest)
{
var sentKeyMaterial = dataRequest.KeyMaterial;
var data = await collectHipService.CollectData(dataRequest).ConfigureAwait(false);
System.Type type = data.GetType();
PropertyInfo[] properties = type.GetProperties();

foreach (PropertyInfo property in properties)
{
object value = property.GetValue(data);
Log.Information($"{property.Name}: {value}");
}
var encryptedEntries = data.FlatMap(entries =>
dataEntryFactory.Process(entries, sentKeyMaterial, dataRequest.TransactionId));
encryptedEntries.MatchSome(async entries =>
Expand Down

0 comments on commit e6004a3

Please sign in to comment.