Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
reinkrul committed Mar 28, 2024
1 parent 1f435d2 commit 4cab357
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion api/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1377,4 +1377,4 @@ security:
- bearerAuth: [ ] # Apply Bearer Auth to all endpoints

servers:
- url: "/web"
- url: "./web"
3 changes: 2 additions & 1 deletion api/patient.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package api

import (
"errors"
"fmt"
"net/http"
"sort"
"strings"
Expand Down Expand Up @@ -108,7 +109,7 @@ func (w Wrapper) GetRemotePatient(ctx echo.Context, params GetRemotePatientParam
}
patient, err := w.ZorginzageService.RemotePatient(ctx.Request().Context(), *customer.Did, params.RemotePartyDID, params.PatientSSN)
if err != nil {
return errors.New("unable to load remote patient")
return fmt.Errorf("unable to load remote patient: %w", err)
}
return ctx.JSON(http.StatusOK, patient)
}
Expand Down
7 changes: 3 additions & 4 deletions domain/zorginzage.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package domain

import (
"context"
"errors"
"fmt"
"github.com/monarko/fhirgo/STU3/resources"
"github.com/nuts-foundation/nuts-demo-ehr/domain/fhir"
Expand Down Expand Up @@ -33,16 +32,16 @@ func (z ZorginzageService) RemotePatient(ctx context.Context, localDID, remotePa
func (z ZorginzageService) fhirClient(ctx context.Context, localDID string, remotePartyDID string, scope string, serviceName string) (fhir.Client, error) {
endpointsInterf, err := z.NutsClient.ResolveServiceEndpoint(ctx, remotePartyDID, serviceName, "object")
if err != nil {
return nil, err
return nil, fmt.Errorf("resolve DID service (DID=%s, service=%s): %w", remotePartyDID, serviceName, err)
}
endpoints := endpointsInterf.(map[string]string)
fhirEndpoint := endpoints["fhir"]
if fhirEndpoint == "" {
return nil, errors.New("remote XIS does not have its FHIR endpoint registered")
return nil, fmt.Errorf("remote XIS does not have its FHIR endpoint registered (DID=%s)", remotePartyDID)
}
accessToken, err := z.NutsClient.RequestServiceAccessToken(ctx, localDID, remotePartyDID, scope)
if err != nil {
return nil, fmt.Errorf("unable to get access token: %w", err)
return nil, fmt.Errorf("unable to get access token (DID=%s,scope=%s): %w", remotePartyDID, scope, err)
}
fhirClient := z.FHIRFactory(fhir.WithURL(fhirEndpoint), fhir.WithAuthToken(accessToken))
return fhirClient, nil
Expand Down
2 changes: 1 addition & 1 deletion web/src/ehr/episode/Edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export default {
.catch(error => this.$status.error(error))
},
searchOrganizations(query) {
this.$api.searchOrganizations(null, {query: {"credentialSubject.organization.name": query + '*'}})
this.$api.searchOrganizations(null, {query: {"credentialSubject.organization.name": query + '*'}, excludeOwn: true})
.then((result) => this.organizations = Object.values(result.data))
.catch(error => this.$status.error(error))
},
Expand Down
2 changes: 1 addition & 1 deletion web/src/ehr/patient/ViewRemotePatient.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default {
loading: false,
formErrors: [],
patient: null,
chosenPatientSSN: null,
chosenPatientSSN: '1234567890',
chosenOrganization: null,
requestedScope: "homemonitoring",
organizations: [],
Expand Down
2 changes: 1 addition & 1 deletion web/src/plugins/openapi-runtime.json
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@
"components": {},
"servers": [
{
"url": "/web"
"url": "./web"
}
]
}

0 comments on commit 4cab357

Please sign in to comment.