Skip to content

Feature/update grip structs #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 15, 2025
Merged

Conversation

matthewpeterkort
Copy link
Collaborator

No description provided.

Copy link

@quinnwai quinnwai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment about namespaces:

Testing script used to ensure namespace IDs were being generated

package main

import (
	"fmt"

	"github.com/google/uuid"
)

func main() {
	// initial edge
	// {
	// 	"edge": {
	// 		"_from": "7040d174-ecae-5bf5-a5b8-917dabe238bc",
	// 		"_id": "3110c4ad-38f9-5b62-853e-d9eff19035b9",
	// 		"_label": "subject_Patient",
	// 		"_to": "c68979ba-3cb6-5002-a6cf-88d09ca3a9c7"
	// 	}
	// }
	elem := "c68979ba-3cb6-5002-a6cf-88d09ca3a9c7"
	id := "7040d174-ecae-5bf5-a5b8-917dabe238bc"
	label := "subject_Patient"
	expectedId := "3110c4ad-38f9-5b62-853e-d9eff19035b9"

	namespaceDNS := "calypr.ohsu.edu"
	namespace := uuid.NewMD5(uuid.NameSpaceDNS, []byte(namespaceDNS))
	actualId := uuid.NewSHA1(namespace, []byte(fmt.Sprintf("%s-%s-%s", elem, id, label))).String()

	// assert they're the same
	if expectedId != actualId {
		fmt.Printf("Expected ID %s does not match actual ID %s\n", expectedId, actualId)
	} else {
		fmt.Println("IDs match!")
	}
}

data, err = s.CleanAndValidate(class, data)
if err != nil {
return nil, err
class := s.GetClass(classID)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the namespaceDNS above still referring to caliper? namespaceDNS := "caliper-idp.org" More generally, should it be hardcoded to something agnostic of the CALYPR concept

Copy link
Collaborator Author

@matthewpeterkort matthewpeterkort May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved over slack

@matthewpeterkort matthewpeterkort merged commit 16a0a1c into main May 15, 2025
@matthewpeterkort matthewpeterkort deleted the feature/update-grip-structs branch May 15, 2025 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants