Esempio n. 1
0
        //=======================================================================================================================================
        //DO NOT ALTER any of these Convert... methods for use with any other HL7 bridge.
        //Each bridge tends to have slightly different implementation.
        //No bridge can share any of these.
        //Instead, copy them into other classes.
        //This set of methods is ONLY for ECW, and will have to be renamed and grouped if any other DFT bridge is built.
        //=======================================================================================================================================

        ///<summary>Convert the patient race entries to the deprecated PatientRaceOld enum before calling this method.</summary>
        private string ConvertRace(PatientRaceOld race)
        {
            switch (race)
            {
            case PatientRaceOld.AmericanIndian:
                return("American Indian Or Alaska Native");

            case PatientRaceOld.Asian:
                return("Asian");

            case PatientRaceOld.HawaiiOrPacIsland:
                return("Native Hawaiian or Other Pacific");

            case PatientRaceOld.AfricanAmerican:
                return("Black or African American");

            case PatientRaceOld.White:
                return("White");

            case PatientRaceOld.HispanicLatino:
                return("Hispanic");

            case PatientRaceOld.Other:
                return("Other Race");

            default:
                return("Other Race");
            }
        }
Esempio n. 2
0
        ///<summary>Uses deprecated PatientRaceOld enum which should be converted from PatientRace entries before this function is called.</summary>
        private string ConvertRace(PatientRaceOld race)
        {
            switch (race)
            {
            case PatientRaceOld.AmericanIndian:
                return("1002-5^American Indian Or Alaska Native^HL70005");

            case PatientRaceOld.Asian:
                return("2028-9^Asian^HL70005");

            case PatientRaceOld.AfricanAmerican:
                return("2054-5^Black or African American^HL70005");

            case PatientRaceOld.HawaiiOrPacIsland:
                return("2076-8^Native Hawaiian or Other Pacific Islander^HL70005");

            case PatientRaceOld.White:
                return("2106-3^White^HL70005");

            case PatientRaceOld.Other:
                return("2131-1^Other Race^HL70005");

            default:                    //including hispanic
                return("2131-1^Other Race^HL70005");
            }
        }
Esempio n. 3
0
        ///<summary>Uses deprecated PatientRaceOld enum which should be converted from PatientRace entries before this function is called.</summary>
        private string ConvertEthnicGroup(PatientRaceOld race)
        {
            switch (race)
            {
            case PatientRaceOld.HispanicLatino:
                return("H^Hispanic or Latino^HL70189");

            default:
                return("N^Not Hispanic or Latino^HL70189");
            }
        }
Esempio n. 4
0
        ///<summary>Gets a list of PatRaces that correspond to a PatientRaceOld enum.</summary>
        public static List <PatRace> GetPatRacesFromPatientRaceOld(PatientRaceOld raceOld)
        {
            List <PatRace> retVal = new List <PatRace>();

            switch (raceOld)
            {
            case PatientRaceOld.Unknown:
                //Do nothing.  No entry means "Unknown", the old default.
                break;

            case PatientRaceOld.Multiracial:
                retVal.Add(PatRace.Multiracial);
                break;

            case PatientRaceOld.HispanicLatino:
                retVal.Add(PatRace.White);
                retVal.Add(PatRace.Hispanic);
                break;

            case PatientRaceOld.AfricanAmerican:
                retVal.Add(PatRace.AfricanAmerican);
                break;

            case PatientRaceOld.White:
                retVal.Add(PatRace.White);
                break;

            case PatientRaceOld.HawaiiOrPacIsland:
                retVal.Add(PatRace.HawaiiOrPacIsland);
                break;

            case PatientRaceOld.AmericanIndian:
                retVal.Add(PatRace.AmericanIndian);
                break;

            case PatientRaceOld.Asian:
                retVal.Add(PatRace.Asian);
                break;

            case PatientRaceOld.Other:
                retVal.Add(PatRace.Other);
                break;

            case PatientRaceOld.Aboriginal:
                retVal.Add(PatRace.Aboriginal);
                break;

            case PatientRaceOld.BlackHispanic:
                retVal.Add(PatRace.AfricanAmerican);
                retVal.Add(PatRace.Hispanic);
                break;
            }
            return(retVal);
        }
Esempio n. 5
0
        ///<summary>Gets a list of PatRaces that correspond to a PatientRaceOld enum.</summary>
        public static List <PatientRace> GetPatRacesFromPatientRaceOld(PatientRaceOld raceOld, long patNum)
        {
            List <PatientRace> retVal = new List <PatientRace>();

            switch (raceOld)
            {
            case PatientRaceOld.Unknown:
                //Do nothing.  No entry means "Unknown", the old default.
                break;

            case PatientRaceOld.Multiracial:
            case PatientRaceOld.Other:
                retVal.Add(new PatientRace(patNum, "2131-1"));                       //Other race
                break;

            case PatientRaceOld.HispanicLatino:
                retVal.Add(new PatientRace(patNum, "2106-3"));                       //White
                retVal.Add(new PatientRace(patNum, "2135-2"));                       //Hispanic
                break;

            case PatientRaceOld.AfricanAmerican:
                retVal.Add(new PatientRace(patNum, "2054-5"));                       //Black or African American
                break;

            case PatientRaceOld.White:
                retVal.Add(new PatientRace(patNum, "2106-3"));                       //White
                break;

            case PatientRaceOld.HawaiiOrPacIsland:
                retVal.Add(new PatientRace(patNum, "2076-8"));                       //Hawaiian or Pacific Islander
                break;

            case PatientRaceOld.AmericanIndian:
                retVal.Add(new PatientRace(patNum, "1002-5"));                       //AmericanIndian
                break;

            case PatientRaceOld.Asian:
                retVal.Add(new PatientRace(patNum, "2028-9"));                       //Black or African American
                break;

            case PatientRaceOld.Aboriginal:
                retVal.Add(new PatientRace(patNum, "2500-7"));                       //OTHER PACIFIC ISLANDER
                break;

            case PatientRaceOld.BlackHispanic:
                retVal.Add(new PatientRace(patNum, "2054-5"));                       //Black or African American
                retVal.Add(new PatientRace(patNum, "2135-2"));                       //Hispanic
                break;
            }
            return(retVal);
        }
Esempio n. 6
0
        ///<summary>PatNum will not be altered here.  The pat passed in must either have PatNum=0, or must have a PatNum matching the segment.  The reason that isStandalone is passed in is because if using tight integration mode (isStandalone=false), then we need to store the "alternate patient id" aka Account No. that comes in on PID.4 in the ChartNumber field so we can pass it back in PID.2 of the DFT charge message.  However, if not using tight integration (isStandalone=true), the ChartNumber field is already occupied by the eCW patient ID, and we do not want to overwrite it.</summary>
        public static void ProcessPID(Patient pat, SegmentHL7 seg, bool isStandalone)
        {
            long patNum = PIn.Long(seg.GetFieldFullText(2));

            //if(pat.PatNum==0) {
            //	pat.PatNum=patNum;
            //}
            //else
            if (!isStandalone &&         //in standalone, the patnums won't match, so don't check
                pat.PatNum != 0 && pat.PatNum != patNum)
            {
                throw new ApplicationException("Invalid patNum");
            }
            if (!isStandalone)             //when in tight integration mode
            {
                pat.ChartNumber = seg.GetFieldFullText(4);
            }
            pat.LName     = seg.GetFieldComponent(5, 0);
            pat.FName     = seg.GetFieldComponent(5, 1);
            pat.MiddleI   = seg.GetFieldComponent(5, 2);
            pat.Birthdate = DateParse(seg.GetFieldFullText(7));
            pat.Gender    = GenderParse(seg.GetFieldFullText(8));
            PatientRaceOld patientRaceOld = RaceParse(seg.GetFieldFullText(10));

            //Converts PatientRaceOld to new Patient Races, and adds them o the PatientRace table.
            PatientRaces.Reconcile(pat.PatNum, PatientRaces.GetPatRacesFromPatientRaceOld(patientRaceOld));
            pat.Address  = seg.GetFieldComponent(11, 0);
            pat.Address2 = seg.GetFieldComponent(11, 1);
            pat.City     = seg.GetFieldComponent(11, 2);
            pat.State    = seg.GetFieldComponent(11, 3);
            pat.Zip      = seg.GetFieldComponent(11, 4);
            pat.HmPhone  = PhoneParse(seg.GetFieldFullText(13));
            pat.WkPhone  = PhoneParse(seg.GetFieldFullText(14));
            pat.Position = MaritalStatusParse(seg.GetFieldFullText(16));
            //pat.ChartNumber=seg.GetFieldFullText(18);//this is wrong.  Would also break standalone mode
            pat.SSN = seg.GetFieldFullText(19);
            if (ProgramProperties.GetPropVal(ProgramName.eClinicalWorks, "FeeSchedulesSetManually") == "0")          //if !FeeSchedulesSetManually
            {
                pat.FeeSched = FeeScheduleParse(seg.GetFieldFullText(22));
            }
        }
Esempio n. 7
0
		///<summary>Gets a list of PatRaces that correspond to a PatientRaceOld enum.</summary>
		public static List<PatRace> GetPatRacesFromPatientRaceOld(PatientRaceOld raceOld) {
			List<PatRace> retVal=new List<PatRace>();
			switch(raceOld) {
				case PatientRaceOld.Unknown:
					//Do nothing.  No entry means "Unknown", the old default.
					break;
				case PatientRaceOld.Multiracial:
					retVal.Add(PatRace.Multiracial);
					break;
				case PatientRaceOld.HispanicLatino:
					retVal.Add(PatRace.White);
					retVal.Add(PatRace.Hispanic);
					break;
				case PatientRaceOld.AfricanAmerican:
					retVal.Add(PatRace.AfricanAmerican);
					break;
				case PatientRaceOld.White:
					retVal.Add(PatRace.White);
					break;
				case PatientRaceOld.HawaiiOrPacIsland:
					retVal.Add(PatRace.HawaiiOrPacIsland);
					break;
				case PatientRaceOld.AmericanIndian:
					retVal.Add(PatRace.AmericanIndian);
					break;
				case PatientRaceOld.Asian:
					retVal.Add(PatRace.Asian);
					break;
				case PatientRaceOld.Other:
					retVal.Add(PatRace.Other);
					break;
				case PatientRaceOld.Aboriginal:
					retVal.Add(PatRace.Aboriginal);
					break;
				case PatientRaceOld.BlackHispanic:
					retVal.Add(PatRace.AfricanAmerican);
					retVal.Add(PatRace.Hispanic);
					break;
			}
			return retVal;
		}
Esempio n. 8
0
        ///<summary>Uses a VB dll to launch.</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            if (pat == null)
            {
                MessageBox.Show("Please select a patient first.");
                return;
            }
            //js This was originally added on 9/2/09, probably due to race affecting ceph proportions.  But since we can't find any documentation, and since a customer is complaining, we are removing it for now.  If we add it back, we will document exactly why.
            //if(pat.Race==PatientRace.Unknown) {
            //  MessageBox.Show("Race must be entered first.");
            //  return;
            //}
            //Make sure the program is running
            if (Process.GetProcessesByName("DrCeph").Length == 0)
            {
                try{
                    ODFileUtils.ProcessStart(path);
                }
                catch {
                    MsgBox.Show("DrCeph", "Program path not set properly.");
                    return;
                }
                Thread.Sleep(TimeSpan.FromSeconds(4));
            }
            List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);;
            ProgramProperty        PPCur      = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum");;
            string patID = "";

            if (PPCur.PropertyValue == "0")
            {
                patID = pat.PatNum.ToString();
            }
            else
            {
                patID = pat.ChartNumber;
            }
            try{
                PatientRaceOld   raceOld     = PatientRaces.GetPatientRaceOldFromPatientRaces(pat.PatNum);
                List <RefAttach> referalList = RefAttaches.Refresh(pat.PatNum);
                Provider         prov        = Providers.GetProv(Patients.GetProvNum(pat));
                string           provName    = prov.FName + " " + prov.MI + " " + prov.LName + " " + prov.Suffix;
                Family           fam         = Patients.GetFamily(pat.PatNum);
                Patient          guar        = fam.ListPats[0];
                string           relat       = "";
                if (guar.PatNum == pat.PatNum)
                {
                    relat = "Self";
                }
                else if (guar.Gender == PatientGender.Male && pat.Position == PatientPosition.Child)
                {
                    relat = "Father";
                }
                else if (guar.Gender == PatientGender.Female && pat.Position == PatientPosition.Child)
                {
                    relat = "Mother";
                }
                else
                {
                    relat = "Unknown";
                }
                VBbridges.DrCephNew.Launch(patID, pat.FName, pat.MiddleI, pat.LName, pat.Address, pat.Address2, pat.City,
                                           pat.State, pat.Zip, pat.HmPhone, pat.SSN, pat.Gender.ToString(), raceOld.ToString(), "", pat.Birthdate.ToString(),
                                           DateTime.Today.ToShortDateString(), RefAttachL.GetReferringDr(referalList), provName,
                                           guar.GetNameFL(), guar.Address, guar.Address2, guar.City, guar.State, guar.Zip, guar.HmPhone, relat);
            }
            catch {
                MessageBox.Show("DrCeph not responding.  It might not be installed properly.");
            }
        }
Esempio n. 9
0
        //public static void ProcessPD1() {
        //	return;
        //}

        public static void ProcessPID(Patient pat, HL7DefSegment segDef, SegmentHL7 seg)
        {
            for (int i = 0; i < segDef.hl7DefFields.Count; i++)
            {
                int itemOrder = segDef.hl7DefFields[i].OrdinalPos;
                switch (segDef.hl7DefFields[i].FieldName)
                {
                case "pat.addressCityStateZip":
                    pat.Address  = seg.GetFieldComponent(itemOrder, 0);
                    pat.Address2 = seg.GetFieldComponent(itemOrder, 1);
                    pat.City     = seg.GetFieldComponent(itemOrder, 2);
                    pat.State    = seg.GetFieldComponent(itemOrder, 3);
                    pat.Zip      = seg.GetFieldComponent(itemOrder, 4);
                    continue;

                case "pat.birthdateTime":
                    pat.Birthdate = FieldParser.DateTimeParse(seg.GetFieldComponent(itemOrder));
                    continue;

                case "pat.ChartNumber":
                    pat.ChartNumber = seg.GetFieldComponent(itemOrder);
                    continue;

                case "pat.Gender":
                    pat.Gender = FieldParser.GenderParse(seg.GetFieldComponent(itemOrder));
                    continue;

                case "pat.HmPhone":
                    pat.HmPhone = FieldParser.PhoneParse(seg.GetFieldComponent(itemOrder));
                    continue;

                case "pat.nameLFM":
                    pat.LName   = seg.GetFieldComponent(itemOrder, 0);
                    pat.FName   = seg.GetFieldComponent(itemOrder, 1);
                    pat.MiddleI = seg.GetFieldComponent(itemOrder, 2);
                    continue;

                case "pat.PatNum":
                    if (pat.PatNum != 0 && pat.PatNum != PIn.Long(seg.GetFieldComponent(itemOrder)))
                    {
                        throw new Exception("Invalid PatNum");
                    }
                    continue;

                case "pat.Position":
                    pat.Position = FieldParser.MaritalStatusParse(seg.GetFieldComponent(itemOrder));
                    continue;

                case "pat.Race":
                    PatientRaceOld patientRaceOld = FieldParser.RaceParse(seg.GetFieldComponent(itemOrder));
                    //Converts deprecated PatientRaceOld enum to list of PatRaces, and adds them to the PatientRaces table for the patient.
                    PatientRaces.Reconcile(pat.PatNum, PatientRaces.GetPatRacesFromPatientRaceOld(patientRaceOld));
                    continue;

                case "pat.SSN":
                    pat.SSN = seg.GetFieldComponent(itemOrder);
                    continue;

                case "pat.WkPhone":
                    pat.WkPhone = FieldParser.PhoneParse(seg.GetFieldComponent(itemOrder));
                    continue;

                case "pat.FeeSched":
                    if (Programs.IsEnabled(ProgramName.eClinicalWorks) && ProgramProperties.GetPropVal(ProgramName.eClinicalWorks, "FeeSchedulesSetManually") == "1")
                    {
                        //if using eCW and FeeSchedulesSetManually
                        continue;                                //do not process fee sched field, manually set by user
                    }
                    else
                    {
                        pat.FeeSched = FieldParser.FeeScheduleParse(seg.GetFieldComponent(itemOrder));
                    }
                    continue;

                default:
                    continue;
                }
            }
            return;
        }
Esempio n. 10
0
		//=======================================================================================================================================
		//DO NOT ALTER any of these Convert... methods for use with any other HL7 bridge.  
		//Each bridge tends to have slightly different implementation.  
		//No bridge can share any of these.
		//Instead, copy them into other classes.
		//This set of methods is ONLY for ECW, and will have to be renamed and grouped if any other DFT bridge is built.
		//=======================================================================================================================================

		///<summary>Convert the patient race entries to the deprecated PatientRaceOld enum before calling this method.</summary>
		private string ConvertRace(PatientRaceOld race) {
			switch(race) {
				case PatientRaceOld.AmericanIndian:
					return "American Indian Or Alaska Native";
				case PatientRaceOld.Asian:
					return "Asian";
				case PatientRaceOld.HawaiiOrPacIsland:
					return "Native Hawaiian or Other Pacific";
				case PatientRaceOld.AfricanAmerican:
					return "Black or African American";
				case PatientRaceOld.White:
					return "White";
				case PatientRaceOld.HispanicLatino:
					return "Hispanic";
				case PatientRaceOld.Other:
					return "Other Race";
				default:
					return "Other Race";
			}
		}
Esempio n. 11
0
        ///<summary>After taking a screening using a sheet, this method will import the sheet as a screen and insert it into the db.
        ///Returns null if the sheet passed in is not a Screening sheet type or if the sheet is missing the required ScreenGroupNum param.
        ///Optionally supply a screen if you want to preset some values.  E.g. ScreenGroupOrder is often preset before calling this method.</summary>
        public static Screen CreateScreenFromSheet(Sheet sheet, Screen screen = null)
        {
            //No need to check RemotingRole; no call to db.
            //Make sure that the sheet passed in is a screening and contains the required ScreenGroupNum parameter.
            if (sheet.SheetType != SheetTypeEnum.Screening || SheetParameter.GetParamByName(sheet.Parameters, "ScreenGroupNum") == null)
            {
                return(null);
            }
            if (screen == null)
            {
                screen = new Screen();
                screen.ScreenGroupNum = (long)SheetParameter.GetParamByName(sheet.Parameters, "ScreenGroupNum").ParamValue;
            }
            screen.SheetNum = sheet.SheetNum;
            foreach (SheetField field in sheet.SheetFields)
            {
                switch (field.FieldName)
                {
                case "Gender":
                    if (field.FieldValue.Trim().ToLower().StartsWith("m"))
                    {
                        screen.Gender = PatientGender.Male;
                    }
                    else if (field.FieldValue.Trim().ToLower().StartsWith("f"))
                    {
                        screen.Gender = PatientGender.Female;
                    }
                    else
                    {
                        screen.Gender = PatientGender.Unknown;
                    }
                    break;

                case "Race/Ethnicity":
                    PatientRaceOld patientRace = PatientRaceOld.Unknown;
                    Enum.TryParse <PatientRaceOld>(field.FieldValue.Split(';')[0], out patientRace);
                    screen.RaceOld = patientRace;
                    break;

                case "GradeLevel":
                    PatientGrade patientGrade = PatientGrade.Unknown;
                    Enum.TryParse <PatientGrade>(field.FieldValue.Split(';')[0], out patientGrade);
                    screen.GradeLevel = patientGrade;
                    break;

                case "Age":
                    if (screen.Age != 0)
                    {
                        break;                                //Already calculated via Birthdate.
                    }
                    byte age = 0;
                    byte.TryParse(field.FieldValue, out age);
                    screen.Age = age;
                    break;

                case "Urgency":
                    TreatmentUrgency treatmentUrgency = TreatmentUrgency.Unknown;
                    Enum.TryParse <TreatmentUrgency>(field.FieldValue.Split(';')[0], out treatmentUrgency);
                    screen.Urgency = treatmentUrgency;
                    break;

                case "ChartSealantTreatment":
                    //Only mark "carious" if TP chart has C marked for any tooth surface.
                    if (field.FieldValue.Contains("C"))
                    {
                        screen.HasCaries = YN.Yes;                              //Caries is present in TP'd chart.  Compl chart doesn't matter, it's only for sealant placement.
                    }
                    else
                    {
                        screen.HasCaries = YN.No;
                    }
                    //Only mark "needs sealants" if TP chart has S marked for any tooth surface.
                    if (field.FieldValue.Contains("S"))
                    {
                        screen.NeedsSealants = YN.Yes;
                    }
                    else
                    {
                        screen.NeedsSealants = YN.No;
                    }
                    break;

                case "CariesExperience":
                    screen.CariesExperience = field.FieldValue == "X" ? YN.Yes : YN.No;
                    break;

                case "EarlyChildCaries":
                    screen.EarlyChildCaries = field.FieldValue == "X" ? YN.Yes : YN.No;
                    break;

                case "ExistingSealants":
                    screen.ExistingSealants = field.FieldValue == "X" ? YN.Yes : YN.No;
                    break;

                case "MissingAllTeeth":
                    screen.MissingAllTeeth = field.FieldValue == "X" ? YN.Yes : YN.No;
                    break;

                case "Birthdate":
                    DateTime birthdate = new DateTime(1, 1, 1);
                    DateTime.TryParse(field.FieldValue, out birthdate);
                    screen.Birthdate = birthdate;
                    //Check to see if the sheet has Age manually filled out.
                    //If Age was not manually set, automatically calculate the age based on the birthdate entered.
                    //This matches screening functionality.
                    SheetField sheetFieldAge = sheet.SheetFields.FirstOrDefault(x => x.FieldName == "Age");
                    if (sheetFieldAge != null && string.IsNullOrEmpty(sheetFieldAge.FieldValue))
                    {
                        screen.Age = PIn.Byte(Patients.DateToAge(birthdate).ToString());
                    }
                    break;

                case "Comments":
                    screen.Comments = field.FieldValue;
                    break;
                }
            }
            if (screen.ScreenNum == 0)
            {
                Insert(screen);
            }
            else
            {
                Update(screen);
            }
            return(screen);
        }
Esempio n. 12
0
File: EhrORU.cs Progetto: mnisl/OD
		///<summary>Uses deprecated PatientRaceOld enum which should be converted from PatientRace entries before this function is called.</summary>
		private string ConvertEthnicGroup(PatientRaceOld race) {
			switch(race) {
				case PatientRaceOld.HispanicLatino:
					return "H^Hispanic or Latino^HL70189";
				default:
					return "N^Not Hispanic or Latino^HL70189";
			}
		}
Esempio n. 13
0
File: EhrORU.cs Progetto: mnisl/OD
		///<summary>Uses deprecated PatientRaceOld enum which should be converted from PatientRace entries before this function is called.</summary>
		private string ConvertRace(PatientRaceOld race) {
			switch(race) {
				case PatientRaceOld.AmericanIndian:
					return "1002-5^American Indian Or Alaska Native^HL70005";
				case PatientRaceOld.Asian:
					return "2028-9^Asian^HL70005";
				case PatientRaceOld.AfricanAmerican:
					return "2054-5^Black or African American^HL70005";
				case PatientRaceOld.HawaiiOrPacIsland:
					return "2076-8^Native Hawaiian or Other Pacific Islander^HL70005";
				case PatientRaceOld.White:
					return "2106-3^White^HL70005";
				case PatientRaceOld.Other:
					return "2131-1^Other Race^HL70005";
				default://including hispanic
					return "2131-1^Other Race^HL70005";
			}
		}