Ejemplo n.º 1
0
        public EhrCqmPatient Copy()
        {
            EhrCqmPatient ehrCqmPatient = (EhrCqmPatient)this.MemberwiseClone();

            ehrCqmPatient.ListPatientRaces = new List <PatientRace>();
            for (int i = 0; i < ListPatientRaces.Count; i++)
            {
                ehrCqmPatient.ListPatientRaces.Add(ListPatientRaces[i].Clone());
            }
            return(ehrCqmPatient);
        }
Ejemplo n.º 2
0
		///<summary>Get relevant demographic and supplemental patient data required for CQM reporting for each unique patient in the list of eligible encounters in the dictionary of PatNums linked to a list of encounters for each PatNum.</summary>
		private static List<EhrCqmPatient> GetEhrPatsFromEncsOrProcs(Dictionary<long,List<EhrCqmEncounter>> dictPatNumListEncounters,Dictionary<long,List<EhrCqmProc>> dictPatNumListProcs) {
			//get list of distinct PatNums from the keys in the incoming dictionary
			List<long> listPatNums=new List<long>(dictPatNumListEncounters.Keys);
			if(dictPatNumListProcs!=null) {
				List<long> procKeys=new List<long>(dictPatNumListProcs.Keys);
				for(int i=0;i<procKeys.Count;i++) {
					if(listPatNums.Contains(procKeys[i])) {
						continue;
					}
					listPatNums.Add(procKeys[i]);
				}
			}			
			List<EhrCqmPatient> retval=new List<EhrCqmPatient>();
			if(listPatNums.Count==0) {
				return retval;
			}
			Patient[] uniquePats=Patients.GetMultPats(listPatNums); 
			//All PayerType codes in ehrcode list are SOP codes
			List<EhrCode> listEhrCodesForPayerTypeOID=EhrCodes.GetForValueSetOIDs(new List<string>() { "2.16.840.1.114222.4.11.3591" },false);
			for(int i=0;i<uniquePats.Length;i++) {
				EhrCqmPatient ehrPatCur=new EhrCqmPatient();
				ehrPatCur.EhrCqmPat=uniquePats[i];
				ehrPatCur.ListPatientRaces=new List<PatientRace>();
				//we will set all patients to denominator.  The only measure where the list of patients (which is the initial patient population) is not the same as the denominator is the influenza vaccine measure, CMS147v2, and we will set those not in the denominator to false after we determine they are in the IPP but not the denominator
				ehrPatCur.IsDenominator=true;
				List<PatientRace> listPatRaces=PatientRaces.GetForPatient(ehrPatCur.EhrCqmPat.PatNum);
				for(int j=0;j<listPatRaces.Count;j++) {
					if(listPatRaces[j].Race==PatRace.Hispanic || listPatRaces[j].Race==PatRace.NotHispanic || listPatRaces[j].Race==PatRace.DeclinedToSpecifyEthnicity) {
						ehrPatCur.Ethnicity=listPatRaces[j];
						continue;
					}
					ehrPatCur.ListPatientRaces.Add(listPatRaces[j]);
				}
				PayorType payerTypeCur=PayorTypes.GetCurrentType(ehrPatCur.EhrCqmPat.PatNum);
				ehrPatCur.PayorSopCode="";
				ehrPatCur.PayorDescription="";
				ehrPatCur.PayorValueSetOID="";
				if(payerTypeCur!=null) {
					for(int j=0;j<listEhrCodesForPayerTypeOID.Count;j++) {
						if(listEhrCodesForPayerTypeOID[j].CodeValue==payerTypeCur.SopCode) {//add payer information if it is in the value set
							ehrPatCur.PayorSopCode=payerTypeCur.SopCode;
							ehrPatCur.PayorDescription=Sops.GetDescriptionFromCode(payerTypeCur.SopCode);
							ehrPatCur.PayorValueSetOID=listEhrCodesForPayerTypeOID[j].ValueSetOID;
							break;
						}
					}
				}
				retval.Add(ehrPatCur);
			}
			return retval;
		}