Skip to content

Commit

Permalink
ready to debug pip data addition and checking
Browse files Browse the repository at this point in the history
  • Loading branch information
woutslakhorst committed Sep 11, 2024
1 parent 7c22388 commit df946ba
Show file tree
Hide file tree
Showing 31 changed files with 2,174 additions and 238 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,14 @@ networks:
- issue an NutsOrganizationCredential for the subject's DIDs from the subject's DIDs
- use https://admin.right.local and add "1" as identity
- issue an NutsOrganizationCredential for the subject's DIDs from the subject's DIDs
- enable services for discovery
- add services to the DID document using curl statement from below
- activate services for discovery using curl statement from below
- create `customers.json` files for demo-ehr config
- wait

curl statement to add services to DID document:
```shell
docker exec nuts-demo-ehr-node-left-1 curl -X POST "http://localhost:8081/internal/vdr/v2/subject/1/service" -H "Content-Type: application/json" -d '{"type": "eOverdracht-sender","serviceEndpoint": {"auth": "https://node.left.local/oauth2/1","fhir": "https://left.local/fhir/1"}}'
docker exec nuts-demo-ehr-node-left-1 curl -X POST "http://localhost:8081/internal/vdr/v2/subject/1/service" -H "Content-Type: application/json" -d '{"type": "eOverdracht-receiver","serviceEndpoint": {"auth": "https://node.left.local/oauth2/1","notification": "https://left.local/web/external/transfer/notify"}}'
docker exec nuts-demo-ehr-node-right-1 curl -X POST "http://localhost:8081/internal/vdr/v2/subject/1/service" -H "Content-Type: application/json" -d '{"type": "eOverdracht-sender","serviceEndpoint": {"auth": "https://node.right.local/oauth2/1","fhir": "https://right.local/fhir/1"}}'
docker exec nuts-demo-ehr-node-right-1 curl -X POST "http://localhost:8081/internal/vdr/v2/subject/1/service" -H "Content-Type: application/json" -d '{"type": "eOverdracht-receiver","serviceEndpoint": {"auth": "https://node.right.local/oauth2/1","notification": "https://right.local/web/external/transfer/notify"}}'
docker exec nuts-demo-ehr-node-left-1 curl -X POST "http://localhost:8081/internal/discovery/v1/urn:nuts.nl:usecase:eOverdrachtDemo2024/1" -H "Content-Type: application/json" -d '{"registrationParameters": {"fhir": "https://left.local/fhir/1", "notification":"https://left.local/web/external/transfer/notify"}}'
docker exec nuts-demo-ehr-node-right-1 curl -X POST "http://localhost:8081/internal/discovery/v1/urn:nuts.nl:usecase:eOverdrachtDemo2024/1" -H "Content-Type: application/json" -d '{"registrationParameters": {"fhir": "https://right.local/fhir/1", "notification":"https://right.local/web/external/transfer/notify"}}'
```

### Run
Expand Down
12 changes: 6 additions & 6 deletions api/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -876,14 +876,14 @@ components:
type: object
required:
- episodeID
- organizationDID
- organizationID
- organizationName
properties:
id:
$ref: '#/components/schemas/ObjectID'
episodeID:
$ref: '#/components/schemas/ObjectID'
organizationDID:
organizationID:
type: string
description: The DID of the collaborator
organizationName:
Expand Down Expand Up @@ -1035,10 +1035,10 @@ components:
description: An request object to create a new transfer negotiation.
type: object
required:
- organizationDID
- organizationID
- transferDate
properties:
organizationDID:
organizationID:
description: Decentralized Identifier of the organization to which transfer of a patient is requested.
type: string
transferDate:
Expand All @@ -1064,7 +1064,7 @@ components:
required:
- id
- transferID
- organizationDID
- organizationID
- organization
- taskID
- transferDate
Expand All @@ -1073,7 +1073,7 @@ components:
$ref: '#/components/schemas/ObjectID'
transferID:
$ref: '#/components/schemas/ObjectID'
organizationDID:
organizationID:
description: Decentralized Identifier of the organization to which transfer of a patient is requested.
type: string
taskID:
Expand Down
2 changes: 1 addition & 1 deletion api/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (w Wrapper) SearchOrganizations(ctx echo.Context) error {
if err := ctx.Bind(&request); err != nil {
return echo.NewHTTPError(http.StatusBadRequest, err)
}
organizations, err := w.NutsClient.SearchDiscoveryService(ctx.Request().Context(), request.Query, request.DiscoveryServiceID, request.DidServiceType)
organizations, err := w.NutsClient.SearchDiscoveryService(ctx.Request().Context(), request.Query, request.DiscoveryServiceID)
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, err)
}
Expand Down
13 changes: 6 additions & 7 deletions api/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (w Wrapper) StartTransferNegotiation(ctx echo.Context, transferID string) e
if err != nil {
return err
}
negotiation, err := w.TransferSenderService.CreateNegotiation(ctx.Request().Context(), cid, transferID, request.OrganizationDID)
negotiation, err := w.TransferSenderService.CreateNegotiation(ctx.Request().Context(), cid, transferID, request.OrganizationID)
if err != nil {
return err
}
Expand All @@ -143,11 +143,11 @@ func (w Wrapper) AssignTransferDirect(ctx echo.Context, transferID string) error
if err := ctx.Bind(&request); err != nil {
return err
}
cid, err := w.getCustomerID(ctx)
customer, err := w.getCustomer(ctx)
if err != nil {
return err
}
_, err = w.TransferSenderService.AssignTransfer(ctx.Request().Context(), cid, transferID, request.OrganizationDID)
_, err = w.TransferSenderService.AssignTransfer(ctx.Request().Context(), *customer, transferID, request.OrganizationID)
if err != nil {
return err
}
Expand All @@ -165,9 +165,9 @@ func (w Wrapper) ListTransferNegotiations(ctx echo.Context, transferID string) e
}
// Enrich with organization info
for i, negotiation := range negotiations {
organization, err := w.OrganizationRegistry.Get(ctx.Request().Context(), negotiation.OrganizationDID)
organization, err := w.OrganizationRegistry.Get(ctx.Request().Context(), negotiation.OrganizationID)
if err != nil {
logrus.Warnf("Error while fetching organization info for negotiation (DID=%s): %v", negotiation.OrganizationDID, err)
logrus.Warnf("Error while fetching organization info for negotiation (DID=%s): %v", negotiation.OrganizationID, err)
continue
}
negotiations[i].Organization = types.FromNutsOrganization(*organization)
Expand Down Expand Up @@ -228,7 +228,6 @@ func (w Wrapper) NotifyTransferUpdate(ctx echo.Context, taskID string) error {
issuerURLStr := target["iss"].(string)
// get senderDID via custom policy param
senderClientID := target["client_id"].(string)
senderDID := target["organization_did"].(string)
// we need the subjectID, which is at the end of the path, not panic safe
issuerURL, _ := url.Parse(issuerURLStr)
idx := strings.LastIndex(issuerURL.Path, "/")
Expand Down Expand Up @@ -281,7 +280,7 @@ func (w Wrapper) NotifyTransferUpdate(ctx echo.Context, taskID string) error {

if err := w.NotificationHandler.Handle(ctx.Request().Context(), notification.Notification{
TaskID: taskID,
SenderDID: senderDID,
SenderID: senderClientID,
CustomerID: customerID,
}); err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/left/config/demo/customers.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"1":{"active":false,"city":"Enske","domain":"","id":"1","name":"Left"}
"1":{"active":false,"city":"Enske","domain":"https://nuts.left.local","id":"1","name":"Left"}
}
26 changes: 26 additions & 0 deletions docker-compose/left/config/node/discovery/eOverdracht.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,32 @@
}
]
}
},
{
"id": "id_registration_cred",
"constraints": {
"fields": [
{
"path": [
"$.type"
],
"filter": {
"type": "string",
"const": "DiscoveryRegistrationCredential"
}
},
{
"id": "fhir endpoint",
"path": [
"$.credentialSubject.fhir",
"$.credentialSubject[0].fhir"
],
"filter": {
"type": "string"
}
}
]
}
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/left/config/node/nuts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ discovery:
definitions:
directory: /nuts/discovery
client:
refresh_interval: 1m
refresh_interval: 10m
server:
ids:
- urn:nuts.nl:usecase:eOverdrachtDemo2024
Expand Down
Binary file modified docker-compose/left/data/hapi/database/h2.mv.db
Binary file not shown.
2 changes: 1 addition & 1 deletion docker-compose/right/config/demo/customers.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"1":{"active":false,"city":"Enske","domain":"","id":"1","name":"Right"}
"1":{"active":false,"city":"Enske","domain":"https://nuts.right.local","id":"1","name":"Right"}
}
26 changes: 26 additions & 0 deletions docker-compose/right/config/node/discovery/eOverdracht.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,32 @@
}
]
}
},
{
"id": "id_registration_cred",
"constraints": {
"fields": [
{
"path": [
"$.type"
],
"filter": {
"type": "string",
"const": "DiscoveryRegistrationCredential"
}
},
{
"id": "fhir endpoint",
"path": [
"$.credentialSubject.fhir",
"$.credentialSubject[0].fhir"
],
"filter": {
"type": "string"
}
}
]
}
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/right/config/node/nuts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ discovery:
definitions:
directory: /nuts/discovery
client:
refresh_interval: 1m
refresh_interval: 10m
vdr:
didmethods:
- web
Binary file modified docker-compose/right/data/hapi/database/h2.mv.db
Binary file not shown.
Loading

0 comments on commit df946ba

Please sign in to comment.