Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
himanshu
committed
May 27, 2018
1 parent
abece1f
commit 9eae399
Showing
33 changed files
with
4,444 additions
and
4,168 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+1.03 KB
healthchain/himanshu1@healthchain.card → healthchain/himanshuchawla@healthchain.card
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
var express = require('express'); | ||
var router = express.Router(); | ||
|
||
var BusinessNetworkConnection = require('composer-client').BusinessNetworkConnection; | ||
|
||
router.post('/adddoctor',async (req,res)=>{ | ||
let businessNetworkConnection = new BusinessNetworkConnection(); | ||
try { | ||
await businessNetworkConnection.connect('himanshuchawla@healthchain'); | ||
//adding user to registry | ||
let assetRegistry = await businessNetworkConnection.getAssetRegistry('org.mpr.healthchain.personalDetails.PractitionerDetails'); | ||
let factory = businessNetworkConnection.getBusinessNetwork().getFactory(); | ||
let asset = factory.newResource('org.mpr.healthchain.personalDetails', 'PractitionerDetails', 'himanshuchawla@healthchain'); | ||
let prac = factory.newRelationship('org.mpr.healthchain.participant','Practitioner','00921202015'); | ||
asset.firstname = 'himanshu' | ||
asset.lastname = 'chawla' | ||
asset.email ='himanshuchawla2014@gmail.com' | ||
asset.dob = '30/may/1997' | ||
asset.practitioner= prac; | ||
await assetRegistry.add(asset); | ||
console.log("sucess doctor"); | ||
|
||
} | ||
catch(error) { | ||
console.log(error + "error occured"); | ||
process.exit(1); | ||
} | ||
}) | ||
|
||
module.exports = router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.