Beispiel #1
0
        private static Occurrence_Code LoadOccurrenceCodes(DataRow row)
        {
            Occurrence_Code code = new Occurrence_Code();

            code.OccurrenceCode = row["occurrence_cd"].ToString();
            code.OccurrenceDate = CernerCommon.ConvertDateString(row["occurrence_dt_tm"].ToString());
            return(code);
        }
        private static Encounter LoadEncounter(DataRow row)
        {
            string    npi       = "";
            Encounter encounter = new Encounter();

            encounter.Active_Ind = row["Active_Ind"].ToString().Replace(".0000", "");

            string dischDisp = CernerCommon.StripDecimalsForMap(row["Disch_Disposition_Cd"].ToString());

            encounter.Disch_Disposition_Cd = CernerMapDAL.GetMap("CERNER_DISCHARGE_DISPOSITION", dischDisp, dischDisp);
            encounter.Cerner_Disch_Disposition_Cd_Display = CodeValueDAL.GetCodeValueDisplay(dischDisp);

            encounter.Disch_Dt_Tm          = row["Disch_Dt_Tm"].ToString();
            encounter.Encntr_type_class_cd = row["Encntr_type_class_cd"].ToString().Replace(".0000", "");

            encounter.Original_Encounter_Id = row["Encntr_Id"].ToString().Replace(".0000", "");
            string encntrId = Encounter_AliasDAL.GetEncounterVisitNumber(row["Encntr_Id"].ToString().Replace(".0000", ""));

            encounter.Encounter_Id = encntrId;

            string encounterTypeCd = CernerCommon.StripDecimalsForMap(row["Encntr_Type_Cd"].ToString());

            encounter.Cerner_Encoutner_Type_Cd         = encounterTypeCd;                                   //used for special logic in mpi conversion record 02
            encounter.Cerner_Encounter_Type_Cd_Display = CodeValueDAL.GetCodeValueDisplay(encounterTypeCd); //for data sheet

            encounter.Encounter_Type_Cd     = CernerMapDAL.GetMap("CERNER_REGTYPE", encounterTypeCd, encounterTypeCd);
            encounter.Inpatient_Admit_Dt_Tm = row["Inpatient_Admit_Dt_Tm"].ToString();

            //From Encounter Table use field E_LOC_NURSE_UNIT_CD to retrieve the  DISPLAY_KEY (col E) in CodeSet 220.
            //Use the DISPLAY_KEY to retrieve the Meditech location from the spreadsheet - "Approved locations"
            string loc = CodeValueDAL.GetCodeValueDisplay_Key(row["Loc_Nurse_Unit_Cd"].ToString().Replace(".0000", ""));

            encounter.Cerner_Loc_Nurse_Unit_Cd_Display = loc; //for data sheet
            encounter.Loc_Nurse_Unit_Cd = CernerMapDAL.GetMap("CERNER_LOCATION", loc, loc);

            //string attendPhys = EncntrPrsnlReltnDAL.GetAttendPhysician(row["Encntr_Id"].ToString());
            encounter.AttendPhysicianId = ""; //attendPhys;
            //MPIOrganization org = MPIOrganizationDAL.GetOrganization(CernerCommon.StripDecimalsForMap(encounter.Organization_Id));
            //npi = PrsnlAliasDAL.GetPrsnlAlias(attendPhys);
            encounter.AttendPhysician = "";//CernerMapDAL.GetMapDR(npi, facility, "Z.CONVPROV");

            encounter.Person_Id         = row["Person_Id"].ToString().Replace(".0000", "");
            encounter.Reason_For_Visit  = row["Reason_For_Visit"].ToString();
            encounter.Reg_Dt_Tm         = row["Reg_Dt_Tm"].ToString();
            encounter.ConfidentialVisit = row["confid_level_cd"].ToString();
            encounter.VIP_Cd            = row["vip_cd"].ToString().Replace(".0000", "");
            encounter.Organization_Id   = row["organization_id"].ToString().Replace(".0000", "");
            encounter.Med_Serv_Cd       = row["med_service_cd"].ToString().Replace(".0000", "");
            //DateTime? d = GMTtoTZ(encounter.Disch_Dt_Tm, "Mountain Standard Time");


            //for BAR
            encounter.BAR_Encounter_Type_Cd = CernerMapDAL.GetMap("CERNER_REGTYPE", encounterTypeCd, encounterTypeCd);
            encounter.Admit_Src_Cd          = row["admit_src_cd"].ToString().Replace(".0000", "");
            encounter.Admit_Type_Cd         = row["admit_type_cd"].ToString().Replace(".0000", "");

            return(encounter);
        }
        private static Person LoadPerson(DataRow row)
        {
            Person person = new Person();

            person.PersonId       = row["Person_Id"].ToString();
            person.Birth_Dt_Tm    = row["Birth_Dt_Tm"].ToString();
            person.Deceased_Dt_Tm = row["Deceased_Dt_Tm"].ToString();
            person.Deceased_Tz    = row["Deceased_Tz"].ToString();

            string languageCd = CernerCommon.StripDecimalsForMap(row["Language_Cd"].ToString());

            person.Language_Cd = CernerMapDAL.GetMap("CERNER_LANGUAGE", languageCd, languageCd);

            string maritalStatus = CernerCommon.StripDecimalsForMap(row["Marital_Type_Cd"].ToString());

            person.Marital_Type_Cd = CernerMapDAL.GetMap("CERNER_MARITALSTATUS", maritalStatus, maritalStatus);


            person.Mother_Maiden_Name  = row["Mother_Maiden_Name"].ToString();
            person.Name_Full_Formatted = row["Name_Full_Formatted"].ToString();

            string raceCd = CernerCommon.StripDecimalsForMap(row["Race_Cd"].ToString());

            person.Race_Cd = CernerMapDAL.GetMap("CERNER_RACE", raceCd, raceCd);

            string religionCd = CernerCommon.StripDecimalsForMap(row["Religion_Cd"].ToString());

            person.Religion_Cd = CernerMapDAL.GetMap("CERNER_RELIGION", religionCd, religionCd);

            string sexCd = CernerCommon.StripDecimalsForMap(row["Sex_Cd"].ToString());

            person.Sex_Cd = CernerMapDAL.GetMap("CERNER_GENDER", sexCd, sexCd);

            person.Vip_Cd = CernerCommon.StripDecimalsForMap(row["Vip_Cd"].ToString());

            person.SocialSecurityNumber = PersonAliasDAL.GetPersonAlias_SSN(person.PersonId);

            person.HomeAddress  = AddressDAL.GetHomeAddress(person.PersonId);
            person.EmailAddress = AddressDAL.GetEmailAddress(person.PersonId);

            person.HomePhone = PhoneDAL.GetHomePhone(person.PersonId);
            //person.OtherPhone = PhoneDAL.GetOtherPhone(person.PersonId);
            person.MobilePhone = PhoneDAL.GetMobilePhone(person.PersonId);
            person.WorkPhone   = PhoneDAL.GetWorkPhone(person.PersonId);

            person.Name_First  = row["Name_First"].ToString().ToUpper();
            person.Name_Last   = row["Name_Last"].ToString().ToUpper();
            person.Name_Middle = CheckCode(row["Name_Middle"].ToString().ToUpper());

            string ethnicGroupCd = CernerCommon.StripDecimalsForMap(row["ethnic_grp_cd"].ToString());

            person.Ethnic_Group_Cd = CernerMapDAL.GetMap("CERNER_ETHNIC_GROUP_CD", ethnicGroupCd, ethnicGroupCd);

            person.PrimaryCarePhysician     = ""; // Person_Prsnl_ReltnDAL.GetPrimaryCarePhysician(person.PersonId);
            person.PrimaryCarePhysicianName = ""; // Person_Prsnl_ReltnDAL.GetPrimaryCarePhysicianName(person.PersonId);
            return(person);
        }
        private static PftProration LoadProration(DataRow row)
        {
            PftProration proration = new PftProration();

            proration.CurrAmtDue    = CernerCommon.ConvertDecimalString(row["curr_amt_due"].ToString());
            proration.CurrAmtDueFlg = row["curr_amount_dr_cr_flag"].ToString();
            proration.HealthPlanID  = row["health_plan_id"].ToString();
            proration.PftEncntrID   = row["pft_encntr_id"].ToString();
            proration.PrioritySeq   = row["priority_seq"].ToString();
            return(proration);
        }
Beispiel #5
0
        private static Occurrence_Code LoadOccurrenceCodes(DataRow row)
        {
            string ocode = "";

            string[]        items;
            Occurrence_Code code = new Occurrence_Code();

            ocode = CodeValueDAL.GetCodeValueDisplay(row["occurrence_cd"].ToString().Trim());
            items = ocode.Split(' ');
            code.OccurrenceCode = items[0].Trim();
            code.OccurrenceDate = CernerCommon.ConvertDateString(row["occurrence_dt_tm"].ToString());
            return(code);
        }
Beispiel #6
0
        private static Person LoadPersons(DataRow row)
        {
            string personId     = row["related_person_id"].ToString();
            string relationship = CernerCommon.StripDecimalsForMap(row["related_person_reltn_cd"].ToString());

            Person person = PersonDAL.GetPerson(personId);

            if (person != null)
            {
                person.Cerner_Relationship = CodeValueDAL.GetCodeValueDisplay(relationship);
                person.RelationShip        = CernerMapDAL.GetMap("CERNER_RELATIONSHIP", relationship, relationship);
            }
            return(person);
        }
Beispiel #7
0
        public static DateTime?GetCernerDate(string dateValue, string hcis)
        {
            string   timeZone = GetHCISTimeZone(hcis);
            DateTime?dt2      = null;

            TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById(timeZone);
            DateTime?    dt  = CernerCommon.GetCernerDate(dateValue);

            if (dt.HasValue)
            {
                dt2 = TimeZoneInfo.ConvertTimeFromUtc(dt.Value, tzi);
            }
            return(dt2);
        }
        private static Address LoadAddress(DataRow row)
        {
            Address address = new Address();

            address.Street_Addr  = row["street_addr"].ToString();
            address.Street_Addr2 = row["street_addr2"].ToString();
            address.Street_Addr2 = row["street_addr2"].ToString();
            address.City         = row["city"].ToString();
            address.Country      = row["country_cd"].ToString();

            string stateCd = CernerCommon.StripDecimalsForMap(row["state_cd"].ToString());

            address.State_Cd = CernerMapDAL.GetMap("CERNER_STATE", stateCd, stateCd);
            address.ZipCode  = row["zipcode"].ToString();
            return(address);
        }
        private static PFT_Encntr LoadPFTEncntr(DataRow row)
        {
            PFT_Encntr pft = new PFT_Encntr();

            pft.Pft_Encntr_Id             = row["pft_encntr_id"].ToString();
            pft.Encntr_Id                 = row["encntr_id"].ToString();
            pft.Acct_Id                   = row["acct_id"].ToString();
            pft.Pft_Encntr_Status_Cd      = row["pft_encntr_status_cd"].ToString();
            pft.Pft_Encntr_Status_Cd_Desc = row["pft_encntr_status_cd"].ToString();
            pft.Fin_Class_Cd              = row["fin_class_cd"].ToString();
            pft.Fin_Class_Cd_Desc         = row["fin_class_cd"].ToString();
            pft.Active_Ind                = row["active_ind"].ToString();
            pft.Beg_Effective_Dt_Tm       = CernerCommon.ConvertDateString(row["beg_effective_dt_tm"].ToString());
            pft.End_Effective_Dt_Tm       = CernerCommon.ConvertDateString(row["end_effective_dt_tm"].ToString());
            pft.Billing_Entity_Id         = row["billing_entity_id"].ToString();
            pft.Adjustment_Balance        = CernerCommon.ConvertDecimalString(row["Adjustment_Balance"].ToString());
            pft.Applied_Payment_Balance   = CernerCommon.ConvertDecimalString(row["Applied_Payment_Balance"].ToString());
            pft.Balance                   = CernerCommon.ConvertDecimalString(row["balance"].ToString());
            pft.Charge_Balance            = CernerCommon.ConvertDecimalString(CheckAmt(row["charge_balance"].ToString()));
            pft.Collection_State_Cd       = row["collection_state_cd"].ToString();
            pft.Collection_State_Cd_Desc  = row["collection_state_cd"].ToString();
            pft.Last_Adjustment_Dt_Tm     = CernerCommon.ConvertDateString(row["last_adjustment_dt_tm"].ToString());
            pft.Last_Payment_Dt_Tm        = CernerCommon.ConvertDateString(row["last_payment_dt_tm"].ToString());
            pft.Recur_Ind                 = row["recur_ind"].ToString();
            pft.Recur_Seq                 = row["recur_seq"].ToString();
            pft.Pft_Encntr_Alias          = row["pft_encntr_alias"].ToString();
            pft.Bill_Status_Cd            = row["bill_status_cd"].ToString();
            pft.Bill_Status_Cd_Desc       = row["bill_status_cd"].ToString();
            pft.Last_Claim_Dt_Tm          = CernerCommon.ConvertDateString(row["last_claim_dt_tm"].ToString());
            pft.Last_Stmt_Dt_Tm           = CernerCommon.ConvertDateString(row["last_stmt_dt_tm"].ToString());
            pft.Last_Patient_Pay_dt_Tm    = CernerCommon.ConvertDateString(row["last_patient_pay_dt_tm"].ToString());
            pft.Statement_Cycle_Id        = row["statement_cycle_id"].ToString();
            pft.Pat_Bal_Fwd               = CernerCommon.ConvertDecimalString(row["pat_bal_fwd"].ToString());
            pft.Nbr_Of_Stmts              = row["Nbr_Of_Stmts"].ToString();
            pft.Bad_Debt_Dt_Tm            = CernerCommon.ConvertDateString(row["bad_debt_dt_tm"].ToString());
            pft.Recur_Current_Year        = row["recur_current_year"].ToString();
            pft.Zero_Balance_Dt_Tm        = CernerCommon.ConvertDateString(row["zero_balance_dt_tm"].ToString());
            pft.Recur_Type_Cd             = row["recur_type_cd"].ToString();
            pft.Recur_Type_Desc           = row["recur_type_cd"].ToString();
            pft.Bad_Debt_Balance          = CernerCommon.ConvertDecimalString(CheckAmt(row["bad_debt_balance"].ToString()));
            pft.Bad_Debt_Bal_Dr_Cr_Flag   = row["bad_debt_bal_dr_cr_flag"].ToString();
            pft.Dr_Cr_Flag                = row["dr_cr_flag"].ToString();
            pft.Chrg_Bal_Dr_Cr_Flag       = row["chrg_bal_dr_cr_flag"].ToString();
            return(pft);
        }
Beispiel #10
0
        private static List <Person> LoadPersons(DataTable dt)
        {
            List <Person> persons = new List <Person>();

            foreach (DataRow row in dt.Rows)
            {
                string personId     = row["related_person_id"].ToString();
                string relationship = CernerCommon.StripDecimalsForMap(row["related_person_reltn_cd"].ToString());

                Person person = PersonDAL.GetPerson(personId);
                if (person != null)
                {
                    person.Cerner_Relationship = CodeValueDAL.GetCodeValueDisplay(relationship);
                    person.RelationShip        = CernerMapDAL.GetMap("CERNER_RELATIONSHIP", relationship, relationship);
                    persons.Add(person);
                }
            }
            return(persons);
        }
        public static List <Provider> GetEncounterPhysicians(string encounterId)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("SELECT epr.prsnl_person_id, epr.encntr_prsnl_r_cd, epr.encntr_id, epr.beg_effective_dt_tm,  ");
            sb.Append("epr.end_effective_dt_tm, epr.encntr_type_cd, cv.display, cv.code_value  ");
            sb.Append("FROM ENCNTR_PRSNL_RELTN epr  ");
            sb.Append("JOIN CODE_VALUE cv on cv.code_value = epr.encntr_prsnl_r_cd ");
            sb.Append("Where epr.Encntr_id = '" + encounterId + "' ");
            sb.Append("AND(epr.encntr_prsnl_r_cd = '1116.0000' OR epr.encntr_prsnl_r_cd = '1119.0000' ");
            sb.Append("OR epr.encntr_prsnl_r_cd = '1121.0000') ");

            DataTable dt = new DataTable();

            using (var conn = new SqlConnection(GlobalSettings.SqlConnectionString()))
                using (var cmd = new SqlCommand(sb.ToString(), conn))
                    using (var da = new SqlDataAdapter(cmd))
                    {
                        cmd.CommandType = CommandType.Text;
                        da.Fill(dt);
                    }

            List <Provider> providers = new List <Provider>();

            foreach (DataRow row in dt.Rows)
            {
                Provider provider = LoadPhysician(row);
                if (provider != null)
                {
                    string phys     = row["prsnl_person_id"].ToString();
                    string physType = CernerCommon.GetPhysiicanType(row["encntr_prsnl_r_cd"].ToString());

                    provider.Mnemonic      = phys.Replace(".0000", "");// CernerMapDAL.GetMap("CERNER_PROVIDER", phys, "Z.CONVPROV");
                    provider.PhysicianType = physType;
                    providers.Add(provider);
                }
            }
            return(providers);
        }