Beispiel #1
0
        public void PatientQueryStartingWithUpperCase()
        {
            var p1  = session.Load <Patient>(IntToGuid <Patient>(1));
            var res = PatientQuery.StartingWith(session)(p1.LastName.ToUpper());

            Assert.IsTrue(res.Contains(p1));
        }
Beispiel #2
0
 public GraphQLController(PatientQuery patientQuery, PatientMutation patientMutation, IDocumentExecuter documentExecuter, ILoggerFactory loggerFactory)
 {
     this.PatientQuery     = patientQuery;
     this.PatientMutation  = patientMutation;
     this.DocumentExecuter = documentExecuter;
     this.LoggerFactory    = loggerFactory;
     this.Logger           = loggerFactory.CreateLogger <GraphQLController>();
 }
        public async Task <ActionResult <PatientDto> > GetPatient(Guid patientId)
        {
            // add error handling
            var query         = new PatientQuery(patientId);
            var queryResponse = await _mediator.Send(query);

            var response = new Response <PatientDto>(queryResponse);

            return(Ok(response));
        }
        //[ActionName("PatientQuery")]
        //[Route("api/PatientQuery/{code}")]
        public async Task <ActionResult <IEnumerable <PatientModel> > > GetPatientByDisease(string code)
        {
            PatientQuery patientQuery = _context.PatientQueries.Where(qry => qry.disease.Code == code).FirstOrDefault();

            if (patientQuery == null)
            {
                return(null);
            }
            return(await _context.PatientModels.FromSqlRaw(patientQuery.Query).ToListAsync());
        }
        public async Task <ActionResult <PatientDto> > GetPatient(Guid patientId, CancellationToken cancellationToken)
        {
            var patientQuery = new PatientQuery(patientId);
            var patientDto   = await _mediator.Send(patientQuery, cancellationToken);

            if (patientDto == null)
            {
                return(NotFound());
            }

            var response = new Response <PatientDto>(patientDto);

            return(Ok(response));
        }
Beispiel #6
0
        /// <summary>
        /// Method to get patient from database based on user query.
        /// </summary>
        /// <param name="patientQuery">patientQuery contains query model to get patient from database</param>
        /// <returns>ResponseModel containing list of PatientDto</returns>
        public ResponseModel Get(PatientQuery patientQuery)
        {
            using (var unitOfWork = new UnitOfWork())
            {
                //Creating a parameter less query model if it is null from request
                if (patientQuery == null)
                {
                    patientQuery = new PatientQuery(id: CommonString.OptionalStringParamInteger, name: CommonString.OptionalStringParam, phoneNumber: CommonString.OptionalStringParam);
                }

                patientQuery.SetTypedVariables();
                var result = unitOfWork.Patients.FindAll(QueryExpressions.Patient(patientQuery));
                result = result.OrderByDescending(m => m.Id).ToList();
                return(ReturnStatements.SuccessResponse(CollectionConversions.ListPatient(result)));
            }
        }
Beispiel #7
0
        private void PatientMatchDelegate(PatientQuery patientResult, DicomDataSet ds)
        {
            PatientData patient = new PatientData( );

#if LEADTOOLS_V19_OR_LATER
            patient.BirthDate = (patientResult.PatientBirthDate == null) ? string.Empty : patientResult.PatientBirthDate.StartDate.Value.ToString( );
#else
            patient.BirthDate = (patientResult.PatientBirthDate == null) ? string.Empty : patientResult.PatientBirthDate.Value.ToString( );
#endif
            patient.Comments = patientResult.PatientComments;
            patient.ID       = patientResult.PatientId;
            patient.Name     = (string.IsNullOrEmpty(patientResult.PatientName)) ? string.Empty : patientResult.PatientName;
            patient.Sex      = patientResult.PatientSex;

            patient.NumberOfRelatedInstances = ds.GetValue <string> (DicomTag.NumberOfPatientRelatedInstances, string.Empty);
            patient.NumberOfRelatedSeries    = ds.GetValue <string> (DicomTag.NumberOfPatientRelatedSeries, string.Empty);
            patient.NumberOfRelatedStudies   = ds.GetValue <string> (DicomTag.NumberOfPatientRelatedStudies, string.Empty);
        }
Beispiel #8
0
 public bool IsPatientAllocated(int patientID)
 {
     return(PatientQuery.IsPatientAllocated(patientID));
 }
Beispiel #9
0
 public bool IsContactNumberExists(long contactNumber)
 {
     return(PatientQuery.IsContactNumberExists(contactNumber));
 }
Beispiel #10
0
 public bool IsBedExist(int bedNumber)
 {
     return(PatientQuery.IsBedExist(bedNumber));
 }
        private void btnFind_Click(object sender, EventArgs e)
        {
            if (!chkPatName.Checked && !chkInvoiceType.Checked && !chkVisitNo.Checked && !dtpFrom.Checked && !dtpTo.Checked)
            {
                MessageBox.Show("至少需要指定一个查询条件!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            string      patientName = "";
            OPDBillKind invoiceType = OPDBillKind.所有发票;
            string      invoiceNo   = "";
            string      visitNo     = "";
            DateTime?   beginDate   = null;
            DateTime?   endDate     = null;

            #region 查询参数
            if (chkPatName.Checked)
            {
                if (txtPatName.Text.Trim( ) != "")
                {
                    patientName = txtPatName.Text.Trim();
                }
                else
                {
                    MessageBox.Show("指定的查询条件:病人姓名没有填写!", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtPatName.Focus( );
                    return;
                }
            }
            if (chkInvoiceType.Checked)
            {
                foreach (object obj in Enum.GetValues(typeof(OPDBillKind)))
                {
                    if (((OPDBillKind)obj).ToString( ) == cboInvoiceType.Text)
                    {
                        invoiceType = (OPDBillKind)obj;
                        break;
                    }
                }
                if (txtInvoiceNo.Text.Trim( ) != "")
                {
                    invoiceNo = txtInvoiceNo.Text.Trim( );
                }
                else
                {
                    MessageBox.Show("指定的查询条件:发票号没有填写!", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtInvoiceNo.Focus( );
                    return;
                }
            }
            if (chkVisitNo.Checked)
            {
                if (txtVisitNo.Text.Trim( ) != "")
                {
                    visitNo = txtVisitNo.Text.Trim( );
                }
                else
                {
                    MessageBox.Show("指定的查询条件:门诊号没有填写!", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtVisitNo.Focus( );
                    return;
                }
            }
            if (dtpFrom.Checked)
            {
                beginDate = Convert.ToDateTime(dtpFrom.Value.ToString("yyyy-MM-dd") + " 00:00:00");
            }
            if (dtpTo.Checked)
            {
                endDate = Convert.ToDateTime(dtpTo.Value.ToString("yyyy-MM-dd") + " 23:59:59");
            }
            #endregion


            PatientQuery       patientQuery = new PatientQuery( );
            List <BasePatient> lstPatient   = patientQuery.GetPatient(invoiceNo, invoiceType, visitNo, patientName, beginDate, endDate);
            ShowPatientList(lstPatient);
        }
Beispiel #12
0
 /// <summary>
 /// Clears data from all the tables of DB
 /// </summary>
 public void ClearPatientDB()
 {
     PatientQuery.ClearPatientDB();
 }
Beispiel #13
0
 public string SearchPatientByContact(long contactNumber)
 {
     return(PatientQuery.SearchPatientByContact(contactNumber));
 }
Beispiel #14
0
 public void Discharge(int patientID)
 {
     PatientQuery.Discharge(patientID);
 }
Beispiel #15
0
 public bool AllocateResourceToPatient(long contactNumber, int patientId, string doctorName, string category, string disease, int wardNumber, int bedNumber, string indate, long emergencyContactNumber, string outdate, bool status)
 {
     return(PatientQuery.AllocateResourceToPatient(contactNumber, patientId, doctorName, category, disease, wardNumber, bedNumber, indate, emergencyContactNumber, outdate, status));
 }
Beispiel #16
0
 public void UpdateBedInformation(int bedNumber, int wardNumber, bool Availability)
 {
     PatientQuery.UpdateBedInformation(bedNumber, wardNumber, Availability);
 }
 public int GetAdmittedPatientID(int BedNumber)    //GetPatientId
 {
     return(PatientQuery.GetAdmittedPatientID(BedNumber));
 }
 /// <summary>
 /// Generic query expression for Patient service
 /// </summary>
 /// <param name="patientQuery">patientQuery having query on patient</param>
 /// <returns>Func delegate to return to the Entity framework of type Patient,bool</returns>
 public static Func <Patient, bool> Patient(PatientQuery patientQuery)
 {
     return(new Func <Patient, bool>(m => (!patientQuery.Id.Equals(CommonInteger.OptionalIntegerParam) ? m.Id.Equals(patientQuery.Id) : true) &&
                                     (!string.IsNullOrWhiteSpace(patientQuery.Name) ? m.FirstName.IndexOf(patientQuery.Name, StringComparison.OrdinalIgnoreCase) >= 0 : true) &&
                                     (!string.IsNullOrWhiteSpace(patientQuery.PhoneNumber) ? m.Phone.Equals(patientQuery.PhoneNumber) : true)));
 }
 public string GetPatientID(long contactNumber)    //GetPatientId
 {
     return(PatientQuery.SearchPatientByContact(contactNumber));
 }
Beispiel #20
0
 public bool IsWardExist(int wardnumber)
 {
     return(PatientQuery.IsWardExist(wardnumber));
 }
Beispiel #21
0
 public string RegisterPatient(long contactNumber, string patientName, string patientGender, double PatientAge)
 {
     return(PatientQuery.RegisterPatient(contactNumber, patientName, patientGender, PatientAge));
 }
Beispiel #22
0
 public bool GetAvailableBed(string wardType, out int wardNumber, out int bedNumber)
 {
     return(PatientQuery.GetAvailableBed(wardType, out wardNumber, out bedNumber));
 }
Beispiel #23
0
 public bool SearchPatientByPatientId(int patientId)
 {
     return(PatientQuery.SearchPatientByPatientId(patientId));
 }
 public int GetTotalNoOfWards()     //new
 {
     return(PatientQuery.GetTotalNoOfWards());
 }
 public int GetNoOfAvailableBeds()     //new
 {
     return(PatientQuery.GetNoOfAvailableBeds());
 }
Beispiel #26
0
 public bool IsBedAvailable(int bedNumber)
 {
     return(PatientQuery.IsBedAvailable(bedNumber));
 }
Beispiel #27
0
 public void InsertBedInformation(int bedNumber, int wardNumber)
 {
     PatientQuery.InsertBedInformation(bedNumber, wardNumber);
 }
 public bool IsPatientExists(int patientId)     //IsPatientExists
 {
     return(PatientQuery.SearchPatientByPatientId(patientId));
 }
Beispiel #29
0
 public void InsertWardInformation(string wardType, int wardNumber)
 {
     PatientQuery.InsertWardInformation(wardType, wardNumber);
 }
 public bool UpdatePatientDetails(int patientId, string patientName, string patientGender, int PatientAge, long contactNumber)                                            //new
 {
     return(PatientQuery.UpdatePatientDetails(patientId, patientName, patientGender, PatientAge, contactNumber));
 }