diff --git a/api/api.yaml b/api/api.yaml index 97a65cb3..fb5e9e53 100644 --- a/api/api.yaml +++ b/api/api.yaml @@ -1377,4 +1377,4 @@ security: - bearerAuth: [ ] # Apply Bearer Auth to all endpoints servers: - - url: "/web" + - url: "./web" diff --git a/api/patient.go b/api/patient.go index 2e9f6e76..a57caf20 100644 --- a/api/patient.go +++ b/api/patient.go @@ -2,6 +2,7 @@ package api import ( "errors" + "fmt" "net/http" "sort" "strings" @@ -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) } diff --git a/domain/zorginzage.go b/domain/zorginzage.go index 385d2c17..57c34055 100644 --- a/domain/zorginzage.go +++ b/domain/zorginzage.go @@ -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" @@ -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 diff --git a/web/src/ehr/episode/Edit.vue b/web/src/ehr/episode/Edit.vue index 9a93c69c..1c141f7c 100644 --- a/web/src/ehr/episode/Edit.vue +++ b/web/src/ehr/episode/Edit.vue @@ -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)) }, diff --git a/web/src/ehr/patient/ViewRemotePatient.vue b/web/src/ehr/patient/ViewRemotePatient.vue index 0aa868c2..8dcccf89 100644 --- a/web/src/ehr/patient/ViewRemotePatient.vue +++ b/web/src/ehr/patient/ViewRemotePatient.vue @@ -48,7 +48,7 @@ export default { loading: false, formErrors: [], patient: null, - chosenPatientSSN: null, + chosenPatientSSN: '1234567890', chosenOrganization: null, requestedScope: "homemonitoring", organizations: [], diff --git a/web/src/plugins/openapi-runtime.json b/web/src/plugins/openapi-runtime.json index f12edb14..7507e159 100644 --- a/web/src/plugins/openapi-runtime.json +++ b/web/src/plugins/openapi-runtime.json @@ -549,7 +549,7 @@ "components": {}, "servers": [ { - "url": "/web" + "url": "./web" } ] }