public static string GetByPatRace(PatRace patRace) { string retval=""; switch(patRace) { case PatRace.AfricanAmerican: retval="2054-5";//R3 BLACK OR AFRICAN AMERICAN break; case PatRace.AmericanIndian: retval="1002-5";//R1 AMERICAN INDIAN OR ALASKA NATIVE break; case PatRace.Asian: retval="2028-9";//R2 ASIAN break; case PatRace.HawaiiOrPacIsland: retval="2076-8";//R4 NATIVE HAWAIIAN OR OTHER PACIFIC ISLANDER break; case PatRace.Hispanic: retval="2135-2";//E1 HISPANIC OR LATINO break; case PatRace.NotHispanic: retval="2186-5";//E2 NOT HISPANIC OR LATINO break; case PatRace.Other: retval="2131-1";//R9 OTHER RACE break; case PatRace.White: retval="2106-3";//R5 WHITE break; } return retval; }
public static string GetByPatRace(PatRace patRace) { string retval = ""; switch (patRace) { case PatRace.AfricanAmerican: retval = "2054-5"; //R3 BLACK OR AFRICAN AMERICAN break; case PatRace.AmericanIndian: retval = "1002-5"; //R1 AMERICAN INDIAN OR ALASKA NATIVE break; case PatRace.Asian: retval = "2028-9"; //R2 ASIAN break; case PatRace.HawaiiOrPacIsland: retval = "2076-8"; //R4 NATIVE HAWAIIAN OR OTHER PACIFIC ISLANDER break; case PatRace.Hispanic: retval = "2135-2"; //E1 HISPANIC OR LATINO break; case PatRace.NotHispanic: retval = "2186-5"; //E2 NOT HISPANIC OR LATINO break; case PatRace.Other: retval = "2131-1"; //R9 OTHER RACE break; case PatRace.White: retval = "2106-3"; //R5 WHITE break; } return(retval); }
///<summary>Patient Identifier segment. Required. Guide page 40.</summary> private void PID() { _seg = new SegmentHL7(SegmentNameHL7.PID); _seg.SetField(0, "PID"); _seg.SetField(1, "1"); //PID-1 Set ID - PID. Optional. Cardinality [0..1]. Must be "1" for the first occurrence. Not sure why there would ever be more than one. //PID-2 Patient ID. No longer used. //PID-3 Patient Identifier List. Required (length up to 478). Cardinality [1..*]. Type CX. _seg.SetField(3, _pat.PatNum.ToString(), //PID-3.1 ID Number. Required (length 1..15). "", //PID-3.2 Check Digit. Optional (length 1..1). "", //PID-3.3 Check Digit Scheme. No longer used. "Open Dental", //PID-3.4 Assigning Authority. Required (1..227). Value set HL70363. "MR" //PID-3.5 Identifier Type Code. Required (length 2..5). Value set HL70203. MR=medical record number. //PID-3.6 Assigning Facility. Optional (length 1..227). //PID-3.7 Effective Date. No longer used. //PID-3.8 Expiration Date. No longer used. //PID-3.9 Assigning Jurisdiction. No longer used. //PID-3.10 Assigning Facility. No longer used. ); if (_pat.SSN.Trim() != "") { _seg.RepeatField(3, _pat.SSN.Trim(), //PID-3.1 ID Number. Required (length 1..15). "", //PID-3.2 Check Digit. Optional (length 1..1). "", //PID-3.3 Check Digit Scheme. No longer used. "Open Dental", //PID-3.4 Assigning Authority. Required (length 1..227). Value set HL70363. "SS" //PID-3.5 Identifier Type Code. Required (length 2..5). Value set HL70203. SS=Social Security Number. //PID-3.6 Assigning Facility. Optional (length 1..227). //PID-3.7 Effective Date. No longer used. //PID-3.8 Expiration Date. No longer used. //PID-3.9 Assigning Jurisdiction. No longer used. //PID-3.10 Assigning Facility. No longer used. ); } //PID-4 Alternate Patient ID. No longer used. //PID-5 Patient Name. Required (length up to 294). Cardinality [1..*]. Type XPN. The first repetition must contain the legal name. WriteXPN(5, _pat.FName, _pat.LName, _pat.MiddleI, "L"); //PID-6 Mother's Maiden Name. No longer used. //PID-7 Date/Time of Birth. Optional. Cardinality [0..1]. if (_pat.Birthdate.Year > 1880) { _seg.SetField(7, _pat.Birthdate.ToString("yyyyMMdd")); } WriteGender(8, _pat.Gender); //PID-8 Administrative Sex. Required if known. Cardinality [0..1]. Value set HL70001. //PID-9 Patient Alias. No longer used. //PID-10 Race. Required if known. Cardinality [0..*]. Value set HL70005. Each race definition must be type CE. List <PatientRace> listPatientRaces = PatientRaces.GetForPatient(_pat.PatNum); List <PatRace> listPatRacesFiltered = new List <PatRace>(); bool isHispanicOrLatino = false; for (int i = 0; i < listPatientRaces.Count; i++) { PatRace patRace = listPatientRaces[i].Race; if (patRace == PatRace.Hispanic) { isHispanicOrLatino = true; } else if (patRace == PatRace.NotHispanic) { //Nothing to do. Flag is set to false by default. } else if (patRace == PatRace.DeclinedToSpecifyRace) { listPatRacesFiltered.Clear(); break; } else { listPatRacesFiltered.Add(patRace); } } for (int i = 0; i < listPatRacesFiltered.Count; i++) { PatRace patRace = listPatRacesFiltered[i]; string strRaceCode = ""; string strRaceName = ""; if (patRace == PatRace.AfricanAmerican) { strRaceCode = "2054-5"; strRaceName = "Black or African American"; } else if (patRace == PatRace.AmericanIndian) { strRaceCode = "1002-5"; strRaceName = "American Indian or Alaska Native"; } else if (patRace == PatRace.Asian) { strRaceCode = "2028-9"; strRaceName = "Asian"; } else if (patRace == PatRace.HawaiiOrPacIsland) { strRaceCode = "2076-8"; strRaceName = "Native Hawaiian or Other Pacific Islander"; } else if (patRace == PatRace.White) { strRaceCode = "2106-3"; strRaceName = "White"; } else //Aboriginal, Other, Multiracial { strRaceCode = "2131-1"; strRaceName = "Other Race"; } _seg.SetOrRepeatField(10, strRaceCode, //PID-10.1 Identifier. Required (length 1..50). strRaceName, //PID-10.2 Text. Required if known (length 1..999). Human readable text that is not further used. "CDCREC" //PID-10.3 Name of Coding System. Required (length 1..20). //PID-10.4 Alternate Identifier. Required if known (length 1..50). //PID-10.5 Alternate Text. Required if known (length 1..999). //PID-10.6 Name of Alternate Coding system. Required if PID-10.4 is not blank. ); } //PID-11 Patient Address. Required if known (length up to 513). Cardinality [0..*]. Type XAD. WriteXAD(11, _pat.Address, _pat.Address2, _pat.City, _pat.State, _pat.Zip); //PID-12 County Code. No longer used. //PID-13 Phone Number - Home. No longer used. //PID-14 Phone Number - Business. No longer used. //PID-15 Primary Language. No longer used. //PID-16 Marital Status. No longer used. //PID-17 Religion. No longer used. //PID-18 Patient Account Number. Optional. However, we already sent this above. Why do they have another field for this data? //PID-19 SSN Number - Patient. No longer used. We send SSN in PID-3. //PID-20 Driver's License Number - Patient. No longer used. //PID-21 Mother's Identifier. No longer used. //PID-22 Ethnic Group. Required if known (length up to 478). Cardinality [0..1]. Value set HL70189 (guide page 201). Type CE. if (listPatRacesFiltered.Count > 0) //The user specified a race and ethnicity and did not select the decline to specify option. { if (isHispanicOrLatino) { WriteCE(22, "2135-2", "Hispanic or Latino", "CDCREC"); } else //Not hispanic or latino. { WriteCE(22, "2186-5", "not Hispanic or Latino", "CDCREC"); } } //PID-23 Birth Place. No longer used. //PID-24 Multiple Birth Indicator. No longer used. //PID-25 Birth Order. No longer used. //PID-26 Citizenship. No longer used. //PID-27 Veterans Military Status. No longer used. //PID-28 Nationality. No longer used. //PID-29 Patient Death Date and Time. Required if PID-30 is set to "Y" (length 12..26). Cardinaility [0..1]. if (_pat.DateTimeDeceased.Year > 1880) { _seg.SetField(29, _pat.DateTimeDeceased.ToString("yyyyMMddhhmmss")); } //PID-30 Patient Death Indicator. Required if known. Cardinaility [0..1]. Value set HL70136. if (_pat.DateTimeDeceased.Year > 1880) { _seg.SetField(30, "Y"); } //PID-31 Identity Unknown. No longer used. //PID-32 Identity Reliability Code. No longer used. //PID-33 Last Update Date/Time. Optional. Cardinaility [0..1]. //PID-34 Last Update Facility. Optional. Cardinaility [0..1]. //PID-35 Species Code. No longer used. //PID-36 Breed Code. No longer used. //PID-37 Strain. No longer used. //PID-38 Production Class Code. No longer used. //PID-39 Tribal Citizenship. No longer used. _msg.Segments.Add(_seg); }