protected void cmbMedicalType_SelectedIndexChanged(object sender, EventArgs e)
        {
            MedicalType mt = SelectedMedicalType;

            UpdateForMedicalType(mt);
            UpdateNextMedical();
        }
        protected void UpdateForMedicalType(MedicalType mt)
        {
            bool fNeedsDOB = ProfileCurrency.RequiresBirthdate(mt);

            rowDOB.Visible           = valDOBRequired.Enabled = fNeedsDOB;
            rowOtherMedical.Visible  = mt == MedicalType.Other;
            valMonthsMedical.Enabled = !fNeedsDOB;
        }
Esempio n. 3
0
    public void Init(MedicalType type, GameObject targetTrans)
    {
        mtype = type;
        Client.IGameOption option = Client.ClientGlobal.Instance().gameOption;
        if (option == null)
        {
            return;
        }
        int itemid = 0;

        if (type != MedicalType.HpAtOnce)
        {
            List <uint>         medicalIDs = new List <uint>();
            List <ItemDataBase> items      = GameTableManager.Instance.GetTableList <ItemDataBase>();
            uint level = (uint)((null != DataManager.Instance.MainPlayer)
               ? DataManager.Instance.MainPlayer.GetProp((int)Client.CreatureProp.Level) : 0);
            for (int i = 0; i < items.Count; i++)
            {
                if (items[i].useLevel <= level)
                {
                    if (items[i].baseType == 2 && items[i].subType == (uint)type + 1)
                    {
                        medicalIDs.Add(items[i].itemID);
                    }
                }
            }
            if (medicalIDs.Count > 0)
            {
                int exeTimes = 0;
                for (int m = 0; m < medicalIDs.Count; m++)
                {
                    int num = DataManager.Manager <ItemManager>().GetItemNumByBaseId(medicalIDs[m]);
                    if (num != 0)
                    {
                        itemid = (int)medicalIDs[m];
                    }
                    else
                    {
                        exeTimes++;
                    }
                }
                if (exeTimes == medicalIDs.Count)
                {
                    itemid = (int)medicalIDs[medicalIDs.Count - 1];
                }
            }
        }
        else
        {
            itemid = option.GetInt("MedicalSetting", type.ToString() + "itemid", 0);
        }
        UpdateItem((uint)itemid, targetTrans);
    }
Esempio n. 4
0
 public static bool RequiresBirthdate(MedicalType mt)
 {
     return(mt != MedicalType.Other && mt != MedicalType.CASAClass1);
 }
Esempio n. 5
0
        /// <summary>
        /// Returns an enumerable of medical status based on https://www.law.cornell.edu/cfr/text/14/61.23 for FAA medicals, or else expiration and type
        /// </summary>
        /// <returns></returns>
        public static IEnumerable <CurrencyStatusItem> MedicalStatus(DateTime lastMedical, int monthsToMedical, MedicalType mt, DateTime?dob, bool fUsesICAOMedical)
        {
            // if no last medical, then this is easy: we know nothing.
            if (!lastMedical.HasValue())
            {
                return(Array.Empty <CurrencyStatusItem>());
            }

            if (RequiresBirthdate(mt) && (dob == null || !dob.HasValue))
            {
                return new CurrencyStatusItem[] { new CurrencyStatusItem(Resources.Currency.NextMedical, Resources.Currency.NextMedicalRequiresBOD, CurrencyState.NotCurrent)
                                                  {
                                                      CurrencyGroup = CurrencyStatusItem.CurrencyGroups.Medical
                                                  } }
            }
            ;

            bool fWas40AtExam = dob != null && dob.Value.AddYears(40).CompareTo(lastMedical) < 0;
            bool fWas60AtExam = dob != null && dob.Value.AddYears(60).CompareTo(lastMedical) < 0;
            bool fWas50AtExam = dob != null && dob.Value.AddYears(50).CompareTo(lastMedical) < 0;

            List <CurrencyStatusItem> lst = new List <CurrencyStatusItem>();

            switch (mt)
            {
            case MedicalType.Other:
                AddOtherMedicalItems(lst, lastMedical, monthsToMedical, fUsesICAOMedical);

                break;

            case MedicalType.EASA1stClass:
                AddEASA1stClassItems(lst, lastMedical, fWas40AtExam, fWas60AtExam);
                break;

            case MedicalType.EASA2ndClass:
                AddEASA2ndClassItems(lst, lastMedical, fWas40AtExam, fWas50AtExam, dob.Value);
                break;

            case MedicalType.EASALAPL:
                AddEASALAPLItems(lst, lastMedical, fWas40AtExam, dob.Value);
                break;

            case MedicalType.FAA1stClass:
                AddFAA1stClassItems(lst, lastMedical, fWas40AtExam);
                break;

            case MedicalType.FAA2ndClass:
                AddFAA2ndClassItems(lst, lastMedical, fWas40AtExam);
                break;

            case MedicalType.FAA3rdClass:
                lst.Add(StatusForDate(lastMedical.AddCalendarMonths(fWas40AtExam ? 24 : 60), Resources.Currency.NextMedical, CurrencyStatusItem.CurrencyGroups.Medical));
                break;

            case MedicalType.CASAClass1:
                AddCASA1stClassItems(lst, lastMedical);
                break;

            case MedicalType.CASAClass2:
                AddCASA2ndClassItems(lst, lastMedical, fWas40AtExam);
                break;

            case MedicalType.CanadaPPL:
                // Canadian rules: https://laws-lois.justice.gc.ca/eng/regulations/sor-96-433/page-36.html#h-991075 and https://tc.canada.ca/sites/default/files/2021-09/AIM-2021-2_LRA-E.pdf
                // Under 40 years of age: 60 month, Over 40 years of age: 24 month
                lst.Add(StatusForDate(lastMedical.AddCalendarMonths(fWas40AtExam ? 24 : 60), Resources.Currency.NextMedicalCanadaPPL, CurrencyStatusItem.CurrencyGroups.Medical));
                break;

            case MedicalType.CanadaGlider:
                // Canadian rules: https://laws-lois.justice.gc.ca/eng/regulations/sor-96-433/page-36.html#h-991075 and https://tc.canada.ca/sites/default/files/2021-09/AIM-2021-2_LRA-E.pdf
                // Glider or ultralight - 60 months
                lst.Add(StatusForDate(lastMedical.AddCalendarMonths(60), Resources.Currency.NextMedicalCanadaGlider, CurrencyStatusItem.CurrencyGroups.Medical));
                break;

            case MedicalType.CanadaCommercial:
                AddCanadaCommercialItems(lst, lastMedical, fWas40AtExam, fWas60AtExam);
                break;
            }
            return(lst);
        }
Esempio n. 6
0
    private void InitData()
    {
        Item                item                  = null;
        MedicalType         drugMedicalType       = null;
        MeasurementUnit     boxMeasUnit           = null;
        ItemType            inventoryItemType     = null;
        Contact             muzahid               = null;
        Department          entDepartment         = null;
        ServiceProviderType doctorServiceProvider = null;

        using (Repository <Contact> contactRepo = new Repository <Contact>())
        {
            contactRepo.DeleteAll();
            muzahid = new Contact {
                FirstName = "Muzahidul", LastName = "Islam", PhoneNumber = "01833353657", Email = "*****@*****.**", City = "Dhaka"
            };
            Contact rashed = new Contact {
                FirstName = "Rashidul", LastName = "Alam", PhoneNumber = "017xxxxxxx", Email = "*****@*****.**", City = "Dhaka"
            };
            Contact kashpia = new Contact {
                FirstName = "Kashpia", LastName = "Naharin", PhoneNumber = "0171xxxxxx", Email = "*****@*****.**", City = "Feni"
            };
            contactRepo.Insert(muzahid);
            contactRepo.Insert(rashed);
            contactRepo.Insert(kashpia);
        }
        using (Repository <Department> deptRepo = new Repository <Department>())
        {
            deptRepo.DeleteAll();
            entDepartment = new Department {
                Name = "ENT"
            };
            deptRepo.Insert(entDepartment);
            deptRepo.Insert(new Department {
                Name = "Dermatology"
            });
            deptRepo.Insert(new Department {
                Name = "Cosmetology"
            });
            deptRepo.Insert(new Department {
                Name = "Diabetology"
            });
            deptRepo.Insert(new Department {
                Name = "Gastroentrology"
            });
            deptRepo.Insert(new Department {
                Name = "Medicine"
            });
            deptRepo.Insert(new Department {
                Name = "Nephrology"
            });
            deptRepo.Insert(new Department {
                Name = "Neurology"
            });
            deptRepo.Insert(new Department {
                Name = "Nutririon & Dietetics"
            });
            deptRepo.Insert(new Department {
                Name = "Gynecology"
            });
            deptRepo.Insert(new Department {
                Name = "Oncology"
            });
            deptRepo.Insert(new Department {
                Name = "Paediatrics"
            });
            deptRepo.Insert(new Department {
                Name = "Urology"
            });
        }
        using (Repository <ServiceProvider> serviceProvidereRepo = new Repository <ServiceProvider>())
        {
            serviceProvidereRepo.DeleteAll();
            serviceProvidereRepo.Insert(new ServiceProvider
            {
                Contact            = muzahid,
                Department         = entDepartment,
                AssignedToAllUsers = true,
                Code                = "D001",
                IsReferer           = false,
                Speciality          = "Surgery",
                ServiceProviderType = doctorServiceProvider
            });
        }
        using (Repository <ServiceProviderType> serviceProviderTypeRepo = new Repository <ServiceProviderType>())
        {
            serviceProviderTypeRepo.DeleteAll();
            doctorServiceProvider = new ServiceProviderType {
                Name = "Doctor"
            };
            serviceProviderTypeRepo.Insert(doctorServiceProvider);
            serviceProviderTypeRepo.Insert(new ServiceProviderType {
                Name = "Surgeon"
            });
            serviceProviderTypeRepo.Insert(new ServiceProviderType {
                Name = "Anesthetist"
            });
            serviceProviderTypeRepo.Insert(new ServiceProviderType {
                Name = "Nurse"
            });
        }
        using (Repository <MedicalType> medicalTypeRepo = new Repository <MedicalType>())
        {
            medicalTypeRepo.DeleteAll();
            drugMedicalType = new MedicalType {
                Name = "Drug"
            };
            medicalTypeRepo.Insert(drugMedicalType);
            medicalTypeRepo.Insert(new MedicalType {
                Name = "Treatment"
            });
            medicalTypeRepo.Insert(new MedicalType {
                Name = "Laboratory Test"
            });
            medicalTypeRepo.Insert(new MedicalType {
                Name = "Surgery"
            });
            medicalTypeRepo.Insert(new MedicalType {
                Name = "Inpatient Accomodation"
            });
        }
        using (Repository <MeasurementUnit> measurementUnitRepo = new Repository <MeasurementUnit>())
        {
            measurementUnitRepo.DeleteAll();
            boxMeasUnit = new MeasurementUnit {
                Name = "Box"
            };
            measurementUnitRepo.Insert(boxMeasUnit);
            measurementUnitRepo.Insert(new MeasurementUnit {
                Name = "File"
            });
            measurementUnitRepo.Insert(new MeasurementUnit {
                Name = "Inch"
            });
            measurementUnitRepo.Insert(new MeasurementUnit {
                Name = "Kg"
            });
        }
        using (Repository <ItemType> itemTypeRepo = new Repository <ItemType>())
        {
            itemTypeRepo.DeleteAll();
            inventoryItemType = new ItemType {
                Name = "Inventory"
            };
            itemTypeRepo.Insert(inventoryItemType);
            itemTypeRepo.Insert(new ItemType {
                Name = "Service"
            });
        }
        using (Repository <Item> itemRepo = new Repository <Item>())
        {
            itemRepo.DeleteAll();
            item = new Item
            {
                Name         = "Napa Extend",
                MedicalType  = drugMedicalType,
                ItemType     = inventoryItemType,
                BuyPrice     = 10,
                SalePrice    = 14.5M,
                Code         = "P001",
                GenericName  = "Paracetamol",
                ItemCategory = new ItemCategory {
                    Name = "CAT-1", MedicalType = drugMedicalType
                },
                MeasurementUnit = boxMeasUnit
            };
            itemRepo.Insert(item);
        }
        using (Repository <ItemCategory> itemCategoryRepo = new Repository <ItemCategory>())
        {
            itemCategoryRepo.DeleteAll();
            var aiItemCategory = new ItemCategory {
                Name = "Anti-Inflammatory", MedicalType = drugMedicalType
            };
            itemCategoryRepo.Insert(aiItemCategory);
            itemCategoryRepo.Insert(new ItemCategory {
                Name = "Antihistamine", MedicalType = drugMedicalType
            });
        }
        using (Repository <PatientService> patientServiceRepo = new Repository <PatientService>())
        {
            patientServiceRepo.DeleteAll();
        }
        using (Repository <Patient> patientRepo = new Repository <Patient>())
        {
            patientRepo.DeleteAll();
            patientRepo.Insert(new Patient
            {
                FirstName   = "Masum",
                LastName    = "Ahammed",
                Gender      = true,
                NationalId  = "269321844923",
                PhoneNumber = "01713738465",
                Occupation  = "Service",
                Email       = "*****@*****.**",
                FatherName  = "ABC Ahammed",
                DOB         = new DateTime(1980, 6, 21),
                City        = "Dhaka",
                Country     = "Bangladesh",
                BloodGroup  = "O+",
                Street      = "Mohammadia Housing Society",
                Zip         = "1207"
            });
        }
    }
 private static bool WasMedicalTypeSelected(MedicalType medicalType, SearchData lastSearchData)
 {
     return lastSearchData.SearchedMedicalTypes.Contains(medicalType);
 }
Esempio n. 8
0
 public static MedicalTypeGoogleService ToGoogleService(MedicalType medicalType)
 {
     return (MedicalTypeGoogleService)medicalType;
 }
Esempio n. 9
0
 public static MedicalTypeDatabaseService ToDatabaseService(MedicalType medicalType)
 {
     return (MedicalTypeDatabaseService)medicalType;
 }
Esempio n. 10
0
 public static PushpinType FromMedicalType(MedicalType medicalType)
 {
     return new PushpinType { MedicalType = medicalType };
 }
        public void Initialize(Patient_cu patient, ScanningMode scanningMode, MedicalType medicalType)
        {
            ActiveSelectedPatient = patient;
            ActiveScanningMode    = scanningMode;
            MedicalType           = medicalType;
            BackColor             = Color.White;

            List <PatientAttachment_cu> list = null;

            switch (ActiveScanningMode)
            {
            case ScanningMode.Regular:
                if (ActiveSelectedPatient != null)
                {
                    if (ImagesList == null)
                    {
                        ImagesList = new List <PatientAttachment_cu>();
                    }
                }
                ImagesList = PatientAttachment_cu.ItemsList.FindAll(item =>
                                                                    Convert.ToInt32(item.Patient_CU_ID)
                                                                    .Equals(Convert.ToInt32(ActiveSelectedPatient.Person_CU_ID)) &&
                                                                    Convert.ToInt32(item.ImageType_P_ID).Equals(Convert.ToInt32(ImageType_P_ID)));
                emptySpaceItem3.Visibility     = LayoutVisibility.Always;
                layoutControlItem4.Visibility  = LayoutVisibility.Always;
                layoutControlItem3.Visibility  = LayoutVisibility.Always;
                layoutControlGroup2.Visibility = LayoutVisibility.Always;
                layoutControlGroup3.Visibility = LayoutVisibility.Always;
                layoutControlItem5.Visibility  = LayoutVisibility.Always;
                layoutControlItem15.Visibility = LayoutVisibility.Always;
                simpleSeparator4.Visibility    = LayoutVisibility.Always;
                layoutControlGroup2.Visibility = LayoutVisibility.Always;
                layoutControlGroup3.Visibility = LayoutVisibility.Always;
                layoutControlItem5.Visibility  = LayoutVisibility.Always;
                lytSelectAll.Visibility        = LayoutVisibility.Never;
                break;

            case ScanningMode.MedicalVisit:
                if (PEMRBusinessLogic.ActivePEMRObject != null &&
                    PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_Attachment != null)
                {
                    foreach (VisitTiming_Attachment visitTimingAttachement in PEMRBusinessLogic.ActivePEMRObject
                             .List_VisitTiming_Attachment)
                    {
                        PatientAttachment_cu patientAttachment = PatientAttachment_cu.ItemsList.Find(item =>
                                                                                                     Convert.ToInt32(item.ID)
                                                                                                     .Equals(Convert.ToInt32(visitTimingAttachement.PatientAttachement_CU_ID)));
                        if (patientAttachment != null)
                        {
                            if (ImagesList == null)
                            {
                                ImagesList = new List <PatientAttachment_cu>();
                            }
                            ImagesList.Add(patientAttachment);
                        }
                    }
                }

                emptySpaceItem3.Visibility     = LayoutVisibility.Never;
                layoutControlItem4.Visibility  = LayoutVisibility.Never;
                layoutControlItem3.Visibility  = LayoutVisibility.Never;
                layoutControlGroup2.Visibility = LayoutVisibility.Never;
                layoutControlGroup3.Visibility = LayoutVisibility.Never;
                layoutControlItem5.Visibility  = LayoutVisibility.Never;
                layoutControlItem15.Visibility = LayoutVisibility.Never;
                simpleSeparator4.Visibility    = LayoutVisibility.Never;
                layoutControlGroup2.Visibility = LayoutVisibility.Never;
                layoutControlGroup3.Visibility = LayoutVisibility.Never;
                layoutControlItem5.Visibility  = LayoutVisibility.Never;
                lytSelectAll.Visibility        = LayoutVisibility.Always;
                break;
            }

            switch (medicalType)
            {
            case MedicalType.InvestigationResult:
                chkPersonalPhoto.Enabled = false;
                chkID.Enabled            = false;
                chkPassport.Enabled      = false;
                chkInvestigation.Enabled = true;
                chkSurgery.Enabled       = false;
                chkLab.Enabled           = false;
                chkOther.Enabled         = false;
                chkInvestigation.Checked = true;
                break;

            case MedicalType.LabResult:
                chkPersonalPhoto.Enabled = false;
                chkID.Enabled            = false;
                chkPassport.Enabled      = false;
                chkInvestigation.Enabled = false;
                chkSurgery.Enabled       = false;
                chkLab.Enabled           = true;
                chkOther.Enabled         = false;
                chkLab.Checked           = true;
                break;

            case MedicalType.SurgeryResult:
                chkPersonalPhoto.Enabled = false;
                chkID.Enabled            = false;
                chkPassport.Enabled      = false;
                chkInvestigation.Enabled = false;
                chkLab.Enabled           = false;
                chkSurgery.Enabled       = true;
                chkOther.Enabled         = false;
                chkSurgery.Checked       = true;
                break;

            case MedicalType.None:
                chkPersonalPhoto.Enabled = true;
                chkID.Enabled            = true;
                chkPassport.Enabled      = true;
                chkSurgery.Enabled       = true;
                chkInvestigation.Enabled = true;
                chkLab.Enabled           = true;
                chkOther.Enabled         = true;
                chkPersonalPhoto.Checked = true;
                break;
            }

            CommonViewsActions.FillListBoxControl(lstImageNames, ImagesList, "ImageName");
            lstImageNames.Refresh();

            if (!string.IsNullOrEmpty(ApplicationStaticConfiguration.SkinName) &&
                !string.IsNullOrWhiteSpace(ApplicationStaticConfiguration.SkinName))
            {
                if (ApplicationStaticConfiguration.SkinName.Equals("McSkin"))
                {
                    lblPatientID.ForeColor               = Color.DarkOrange;
                    lblPatientName.ForeColor             = lblInsuranceCarrierName.ForeColor = lblInsuranceLevelName.ForeColor =
                        lblInsurancePercentage.ForeColor = Color.DarkBlue;
                    labelControl1.ForeColor              = labelControl3.ForeColor =
                        labelControl5.ForeColor          = labelControl7.ForeColor = Color.Black;
                    btnClose.Image = Properties.Resources.ExitIcon_8;
                }
                else
                {
                    lblPatientID.ForeColor               = Color.OrangeRed;
                    lblPatientName.ForeColor             = lblInsuranceCarrierName.ForeColor = lblInsuranceLevelName.ForeColor =
                        lblInsurancePercentage.ForeColor = Color.Ivory;
                    labelControl1.ForeColor              = labelControl3.ForeColor =
                        labelControl5.ForeColor          = labelControl7.ForeColor = Color.OldLace;
                    btnClose.Image = Properties.Resources.Exit_1_16;
                }
            }

            lblPatientID.Text   = ActiveSelectedPatient.Person_CU_ID.ToString();
            lblPatientName.Text = ActiveSelectedPatient.PatientFullName;
            if (ActiveSelectedPatient.InsuranceCarrier_InsuranceLevel_CU_ID != null)
            {
                InsuranceCarrier_InsuranceLevel_cu insuranceBridge =
                    InsuranceCarrier_InsuranceLevel_cu.ItemsList.Find(
                        item =>
                        Convert.ToInt32(item.ID)
                        .Equals(Convert.ToInt32(ActiveSelectedPatient.InsuranceCarrier_InsuranceLevel_CU_ID)));
                if (insuranceBridge != null)
                {
                    InsuranceCarrier_cu insuranceCarrier =
                        InsuranceCarrier_cu.ItemsList.Find(
                            item => Convert.ToInt32(item.ID).Equals(Convert.ToInt32(insuranceBridge.InsuranceCarrier_CU_ID)));
                    if (insuranceCarrier != null)
                    {
                        lblInsuranceCarrierName.Text = insuranceCarrier.Name_P;
                    }
                    InsuranceLevel_cu insurancelevel =
                        InsuranceLevel_cu.ItemsList.Find(
                            item => Convert.ToInt32(item.ID).Equals(Convert.ToInt32(insuranceBridge.InsuranceLevel_CU_ID)));
                    if (insurancelevel != null)
                    {
                        lblInsuranceLevelName.Text = insurancelevel.Name_P;
                    }
                    lblInsurancePercentage.Text = Convert.ToString(insuranceBridge.InsurancePercentage * 100);
                }
            }
        }