public bool RealizePrescription(string prescriptionId, string pharmacistId) { if (realizedPrescriptions.blockChainClient.GetNumberOfConnectedPeers() >= 2) { if (realizedPrescriptions.Find(prescriptionId) == null) { Block block = prescriptions.Find(prescriptionId); if (block != null) { block.GetPrescription().pharmacistId = pharmacistId; realizedPrescriptions.Add(block.GetPrescription()); return(true); } else { // TODO Logger // Prescription not found. return(false); } } else { // TODO Logger // Prescription is already realized. return(false); } } TraceingManager.Message(LogMessages.LessThen2pearsMessage); return(false); }
public bool AddPrescription(string patientId, string doctorId, DateTime validSinceDate, ObservableCollection <Medicine> medicines) { if (prescriptions.blockChainClient.GetNumberOfConnectedPeers() >= 2) { Prescription prescription = new Prescription(patientId, doctorId, DateTime.Now, validSinceDate, medicines); prescriptions.Add(prescription); return(true); } else { TraceingManager.Message(LogMessages.LessThen2pearsMessage); return(false); } }