0

Here's the smart contract.

pragma solidity ^0.4.8;

contract RecordCreation {

uint public count;
mapping (address => string) public usertype;
struct Patientdetails{

}
Patientdetails[] public patientdetails;

mapping (address => uint[]) public PatientDocuments;
function RecordCreation(){

}
//Function user type definition
function userDefinition(string utype1) payable returns(bool result) {

}
 //Data Submission Function
 function patientDataSubmission() payable returns (bool result){

 }
 //Documents Count Retrieval Function for  a Patient
 function countOfDataSubmission(address patientaddress) payable returns (uint result){

 }
 function getPatientsCount(address patientaddress)
    constant returns (uint count) {

 }

}

How can I define the contract for usecase -Patient holds any number of documents?

6
  • I can sort it out but it calls for a data restructure and I need some clarity about what we're trying to achieve. Does each patient have a document with basic info, PLUS a series of related documents, or is it JUST a series of documents related to patient ID? Jul 12, 2017 at 15:35
  • A series of documents related to patient Id @Rob Hitchens Jul 12, 2017 at 15:57
  • @Rob Hitchens How can I restructure it?? Jul 12, 2017 at 16:08
  • It sounds like you're aiming for this: medium.com/@robhitchens/…. Jul 12, 2017 at 18:17
  • @RobHitchens I have followed your writeup..It worked perfectly.....It's good article to follow...Thank you once again Jul 14, 2017 at 4:53

1 Answer 1

1

It sounds like you're aiming for this: https://medium.com/@robhitchens/enforcing-referential-integrity-in-ethereum-smart-contracts-a9ab1427ff42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.