Users
Functions
userNew
function userNew(
address addr,
bytes32 IDHash,
Role role,
Attribute[] calldata attrs,
address signer,
uint deadline,
bytes calldata signature
) external onlyAllowed(msg.sender)
New user registration
Parameters
addr
address
New user address
IDHash
bytes32
New user ID hash. Sha3(userID+systemID)
signer
address
Address of the signer of the request
deadline
uint
Expiration timestamp of the request
signature
bytes
Cryptographic signature of the request performed by the signer's key
getUser
function getUser(address addr) external view returns(User memory)
Getting ehrID for userID
Parameters
addr
address
User address
Return Values:
getUserByCode
function getUserByCode(uint64 code) external view returns(User memory)
Retrieving a user by unique code. Useful for searching for a doctor by numeric code.
Parameters
code
uint64
User unique code
Return Values:
userGroupCreate
function userGroupCreate(
bytes32 groupIdHash,
Attribute[] calldata attrs,
address signer,
uint deadline,
bytes calldata signature
) external onlyAllowed(msg.sender)
Creating a user group
Parameters
groupIdHash
bytes32
signer
address
Address of the signer of the request
deadline
uint
Expiration timestamp of the request
signature
bytes
Cryptographic signature of the request performed by the signer's key
groupAddUser
function groupAddUser(GroupAddUserParams calldata p) external
Adding a user to a group
Parameters
groupRemoveUser
function groupRemoveUser(
bytes32 groupIDHash,
bytes32 userIDHash,
address signer,
uint deadline,
bytes calldata signature
) external
Removing a user from a group
Parameters
groupIDHash
bytes32
userIDHash
bytes32
signer
address
Address of the signer of the request
deadline
uint
Expiration timestamp of the request
signature
bytes
Cryptographic signature of the request performed by the signer's key
userGroupGetByID
function userGroupGetByID(bytes32 groupIdHash) external view returns(UserGroup memory)
Getting a user group by ID
Parameters
groupIDHash
bytes32
User group ID hash
Return Values:
setAccess
function setAccess(
bytes32 accessID,
IAccessStore.Access memory a,
address signer,
uint deadline,
bytes calldata signature
) external
Sets the access level to the object
Parameters
accessID
bytes32
signer
address
Address of the signer of the request
deadline
uint
Expiration timestamp of the request
signature
bytes
Cryptographic signature of the request performed by the signer's key
Models
Role
enum Role { Patient, Doctor }
Attribute
struct Attribute {
Code code;
bytes value;
}
AccessLevel
enum AccessLevel { NoAccess, Owner, Admin, Read }
User
struct User {
bytes32 IDHash;
Role role;
Attribute[] attrs;
}
UserGroup
struct UserGroup {
Attribute[] attrs;
GroupMember[] members;
}
Parameters
GroupMember
struct GroupMember {
bytes32 userIDHash;
bytes userIDEncr;
}
Parameters
userIDHash
bytes32
User id hash
userIDEncr
bytes
User ID encrypted by group key
GroupAddUserParams
struct GroupAddUserParams {
bytes32 groupIDHash;
bytes32 userIDHash;
AccessLevel level;
bytes userIDEncr;
bytes keyEncr;
address signer;
uint deadline;
bytes signature;
}
Parameters:
groupIDHash
bytes32
userIDHash
bytes32
userIDEncr
bytes
userID encrypted by group key
keyEncr
bytes
group key encrypted by adding user public key
signer
address
Address of the signer of the request
deadline
uint
Expiration timestamp of the request
signature
bytes
Cryptographic signature of the request performed by the signer's key
IAccessStore.Access
struct Access {
AccessKind kind;
bytes32 idHash;
bytes idEncr; // id encrypted by access key
bytes keyEncr; // access key encrypted by user private key
AccessLevel level;
}
Last updated