public List <PharmacyFields> getPharmacyFields(string patientMasterVisitID) { lock (this) { ClsObject PatientEncounter = new ClsObject(); ClsUtility.Init_Hashtable(); ClsUtility.AddParameters("@PatientMasterVisitID", SqlDbType.Int, patientMasterVisitID); DataTable theDT = (DataTable)PatientEncounter.ReturnObject(ClsUtility.theParams, "sp_getPharmacyFields", ClsUtility.ObjectEnum.DataTable); List <PharmacyFields> list = new List <PharmacyFields>(); for (int i = 0; i < theDT.Rows.Count; i++) { PharmacyFields drg = new PharmacyFields(); drg.TreatmentProgram = theDT.Rows[i]["ProgID"].ToString(); drg.PeriodTaken = theDT.Rows[i]["pharmacyPeriodTaken"].ToString(); drg.TreatmentPlan = theDT.Rows[i]["TreatmentStatusId"].ToString(); drg.TreatmentPlanReason = theDT.Rows[i]["TreatmentStatusReasonId"].ToString(); drg.RegimenLine = theDT.Rows[i]["RegimenLineId"].ToString(); drg.Regimen = theDT.Rows[i]["RegimenId"].ToString(); drg.prescriptionDate = theDT.Rows[i]["OrderedByDate"].ToString(); drg.dispenseDate = theDT.Rows[i]["DispensedByDate"].ToString(); list.Add(drg); } return(list); } }
public async Task <Result <GetPharmacyCurrentRegimenResponse> > Handle(GetPharmacyCurrentRegimenCommand request, CancellationToken cancellationToken) { using (_pharmUnitOfWork) { try { StringBuilder sql = new StringBuilder(); sql.Append("sp_getCurrentRegimen @PatientID"); var patientId = new SqlParameter("@PatientID", request.PatientId); var currentregimenlist = await _pharmUnitOfWork.Context.Query <PatientCurrentRegimenTracker>().FromSql(sql.ToString(), parameters: new[] { patientId }).ToListAsync(); List <PharmacyFields> lst = new List <PharmacyFields>(); if (currentregimenlist.Count > 0) { currentregimenlist.ForEach(x => { PharmacyFields flds = new PharmacyFields(); flds.RegimenLine = x.RegimenLineId.ToString(); flds.Regimen = x.RegimenId.ToString(); lst.Add(flds); }); } return(Result <GetPharmacyCurrentRegimenResponse> .Valid(new GetPharmacyCurrentRegimenResponse() { pharmacyFields = lst })); } catch (Exception ex) { return(Result <GetPharmacyCurrentRegimenResponse> .Invalid(ex.Message)); } } }
public List <PharmacyFields> getPharmacyCurrentRegimen(string patientId) { lock (this) { ClsObject PatientEncounter = new ClsObject(); ClsUtility.Init_Hashtable(); ClsUtility.AddParameters("@PatientID", SqlDbType.VarChar, patientId); DataTable theDT = (DataTable)PatientEncounter.ReturnObject(ClsUtility.theParams, "sp_getCurrentRegimen", ClsUtility.ObjectEnum.DataTable); List <PharmacyFields> lst = new List <PharmacyFields>(); if (theDT.Rows.Count > 0) { PharmacyFields flds = new PharmacyFields(); flds.RegimenLine = theDT.Rows[0]["RegimenLineId"].ToString(); flds.Regimen = theDT.Rows[0]["RegimenId"].ToString(); lst.Add(flds); } return(lst); } }