public static string TranslateRegionalLymphNodesState(RegionalLymphNodesState state) { var lymphNodesState = ""; if (state == RegionalLymphNodesState.N0) { lymphNodesState += "N0 no regional lymph node metastases"; } else if (state == RegionalLymphNodesState.N1) { lymphNodesState += "N1 metastases to moveable ipsilateral axillary lymph nodes"; } else if (state == RegionalLymphNodesState.N2) { lymphNodesState += "N2 metastases in ipsilateral axillary lymph nodes that are clinically fixed"; } else if (state == RegionalLymphNodesState.N3) { lymphNodesState += "N3 metastases that are more extensive"; } return(lymphNodesState); }
public async Task <IActionResult> CreateAsync(string patientId, PrimaryTumorState primaryTumor, DistantMetastasisState distantMetastasis, RegionalLymphNodesState regionalLymphNodes) { Patient patient = await _patientService.GetByIdAsync(patientId); Doctor doctor = await _doctorService.GetByUserIdAsync(_userManager.GetUserId(HttpContext.User)); if (patient.ActiveDiagnoseId != 0) { var oldDiagnose = await _diagnoseService.GetByIdAsync(patient.ActiveDiagnoseId); if (oldDiagnose != null && oldDiagnose.Treatment != null) { oldDiagnose.Treatment.End = DateTime.Now; await _diagnoseService.UpdateAsync(); } } Diagnose diagnose = new Diagnose() { Patient = patient, Doctor = doctor, DistantMetastasis = distantMetastasis, PrimaryTumor = primaryTumor, RegionalLymphNodes = regionalLymphNodes, Stage = _diagnoseService.DetermineStage(distantMetastasis, primaryTumor, regionalLymphNodes) }; HealthCheck healthCheck = new HealthCheck() { Diagnose = diagnose, Timestamp = DateTime.Now }; var healthCheckId = await _healthCheckService.CreateAsync(healthCheck); healthCheck = await _healthCheckService.GetByIdAsync(healthCheckId); patient.ActiveDiagnoseId = healthCheck.Diagnose.Id; await _patientService.UpdateAsync(); return(RedirectToAction("", "DoctorDashboard")); }
/** * A method that allows us to determine the stage of the breast cancer. Stages are computed based on the rules given by Digital Health Assistant. */ internal short DetermineStage(DistantMetastasisState distantMetastasis, PrimaryTumorState primaryTumor, RegionalLymphNodesState regionalLymphNodes) { // Stage 4 cancer if (distantMetastasis == DistantMetastasisState.M1) { return(4); } // Stage 0 cancer if (regionalLymphNodes == RegionalLymphNodesState.N0 && primaryTumor == PrimaryTumorState.T0) { return(0); } // Stage 1 cancer if ((regionalLymphNodes == RegionalLymphNodesState.N1 && primaryTumor == PrimaryTumorState.T0) || (regionalLymphNodes == RegionalLymphNodesState.N1 && primaryTumor == PrimaryTumorState.T1) || (regionalLymphNodes == RegionalLymphNodesState.N1 && primaryTumor == PrimaryTumorState.T1)) { return(1); } // Stage 2 cancer if ((regionalLymphNodes == RegionalLymphNodesState.N1 && primaryTumor == PrimaryTumorState.T1) || (regionalLymphNodes == RegionalLymphNodesState.N0 && primaryTumor == PrimaryTumorState.T2) || (regionalLymphNodes == RegionalLymphNodesState.N1 && primaryTumor == PrimaryTumorState.T2) || (regionalLymphNodes == RegionalLymphNodesState.N0 && primaryTumor == PrimaryTumorState.T3)) { return(2); } // Everything inbetween falls into the Stage 3 category return(3); }