Ich schreibe eine Transaktion, die einen Teilnehmer und ein Asset zum Netzwerk hinzufügt. Das Hinzufügen des Teilnehmers zum Netzwerk funktioniert, aber wenn ich versuche, auf die Registrierungsdatei der medizinischen Anlage zuzugreifen, gibt die Funktion undefined zurück.Nicht definiert ist nicht aufrufbar
Error: TypeError: undefined not callable
Die Logik der Transaktion:
return getParticipantRegistry(namespace + '.Patient')
.then(function (patientRegistry) {
return patientRegistry.add(newPatient);
}).then(function() {
return getAssetRegistry('nl.epd.blockchain.MedicalFile');
}).then(function (registry) {
var medicalFile = factory.newResource(namespace, 'MedicalFile', "test");
medicalFile.id = "test";
medicalFile.owner = newPatient.bsn;
medicalFile.mentors = [];
medicalFile.permissions = [];
medicalFile.allergies = [];
medicalFile.treatments = [];
medicalFile.medicine = [];
// registry is undefined
return registry.add(medicalFile);
});
}
Modelle:
namespace nl.epd.blockchain
asset MedicalFile identified by id {
o String id
--> Patient owner
--> Patient[] mentors
o OrganisationPermission[] permissions
o Visit[] visits
o String[] allergies
o Treatment[] treatments
o Medicine[] medicine
}
participant Patient identified by bsn {
o String bsn
o String firstName
o String namePrefix optional
o String lastName
o String email
o String telephoneNumber
o String birthday
o String gender
o String city
o String zipCode
o String street
o String houseNumber
o String houseNumberExtra optional
}
NPM Abhängigkeiten:
"dependencies": {
"fabric-ca-client": "1.0.0-alpha.0",
"fabric-client": "1.0.0-alpha",
"homedir": "^0.6.0",
"composer-client": "^0.7.0",
"composer-rest-server": "^0.7.0"
}
Jede Idee, was falsch ist?