public PNDTMsg AddPNDTest(AddPNDTestRequest aData) { string stProc = AddPNDTestData; var pList = new List <SqlParameter>() { new SqlParameter("@PrePNDTCounsellingId", aData.prePNDTCounsellingId), new SqlParameter("@ANWSubjectId", aData.anwsubjectId ?? aData.anwsubjectId), new SqlParameter("@SpouseSubjectId", aData.spouseSubjectId ?? aData.spouseSubjectId), new SqlParameter("@PNDTDateTime", aData.pndtDateTime ?? aData.pndtDateTime), new SqlParameter("@CounsellorId", aData.counsellorId), new SqlParameter("@ObstetricianId", aData.obstetricianId), new SqlParameter("@ClinicalHistory", aData.clinicalHistory ?? aData.clinicalHistory), new SqlParameter("@Examination", aData.examination ?? aData.examination), new SqlParameter("@ProcedureOfTestingId", aData.procedureOfTestingId), new SqlParameter("@OthersPOT", aData.othersProcedureofTesting ?? aData.othersProcedureofTesting), new SqlParameter("@PNDTComplecationsId", aData.pndtComplecationsId ?? aData.pndtComplecationsId), new SqlParameter("@OthersComplecations", aData.othersComplecations ?? aData.othersComplecations), new SqlParameter("@PNDTDiagnosisId", aData.pndtDiagnosisId), new SqlParameter("@PNDTResultId", aData.pndtResultId), new SqlParameter("@MotherVoided", aData.motherVoided ?? aData.motherVoided), new SqlParameter("@MotherVitalStable", aData.motherVitalStable ?? aData.motherVitalStable), new SqlParameter("@FoetalHeartRateDocumentScan", aData.foetalHeartRateDocumentScan ?? aData.foetalHeartRateDocumentScan), new SqlParameter("@PlanForPregnencyContinue", aData.planForPregnencyContinue ?? aData.planForPregnencyContinue), new SqlParameter("@IsCompletePNDT", aData.isCompletePNDT), new SqlParameter("@CreatedBy", aData.userId), }; var schedulingData = UtilityDL.FillEntity <PNDTMsg>(stProc, pList); return(schedulingData); }
public async Task <AddPNDTResponse> AddPNDTest(AddPNDTestRequest aData) { var sResponse = new AddPNDTResponse(); try { if (aData.obstetricianId <= 0) { sResponse.Status = "false"; sResponse.Message = "Invalid Obstetrician"; return(sResponse); } else if (string.IsNullOrEmpty(aData.pndtDateTime)) { sResponse.Status = "false"; sResponse.Message = "PNDT date and time is missing"; return(sResponse); } else if (string.IsNullOrEmpty(aData.clinicalHistory)) { sResponse.Status = "false"; sResponse.Message = "Clinical history is missing"; return(sResponse); } else if (string.IsNullOrEmpty(aData.examination)) { sResponse.Status = "false"; sResponse.Message = "Examination is missing"; return(sResponse); } else if (aData.procedureOfTestingId <= 0) { sResponse.Status = "false"; sResponse.Message = "Invalid procedure for testing id"; return(sResponse); } else if (string.IsNullOrEmpty(aData.pndtComplecationsId)) { sResponse.Status = "false"; sResponse.Message = "Complications are missing"; return(sResponse); } else { var pndtMsg = _pndtObstetricianData.AddPNDTest(aData); sResponse.Status = "true"; sResponse.Message = string.Empty; sResponse.data = pndtMsg; return(sResponse); } } catch (Exception e) { sResponse.Status = "false"; sResponse.Message = $"Unable to add PND Test - {e.Message}"; return(sResponse); } }
public async Task <IActionResult> AddPNDTest(AddPNDTestRequest aData) { _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}"); var pndTest = await _pndtObstetricianService.AddPNDTest(aData); _logger.LogInformation($"Add PNDTest for the counselled positive subjects {pndTest}"); return(Ok(new AddPNDTResponse { Status = pndTest.Status, Message = pndTest.Message, data = pndTest.data, })); }