public VisitSummary CreateVisitSummary(Visit visit, IPersistenceContext context) { var patientProfileAssembler = new PatientProfileAssembler(); var summary = new VisitSummary { VisitRef = visit.GetRef(), Patient = patientProfileAssembler.CreatePatientProfileSummary(visit.PatientProfile, context), VisitNumber = CreateVisitNumberDetail(visit.VisitNumber), AdmissionType = EnumUtils.GetEnumValueInfo(visit.AdmissionType), PatientClass = EnumUtils.GetEnumValueInfo(visit.PatientClass), PatientType = EnumUtils.GetEnumValueInfo(visit.PatientType), Status = EnumUtils.GetEnumValueInfo(visit.Status, context), AdmitTime = visit.AdmitTime, DischargeTime = visit.DischargeTime }; var facilityAssembler = new FacilityAssembler(); summary.Facility = visit.Facility == null ? null : facilityAssembler.CreateFacilitySummary(visit.Facility); var locationAssembler = new LocationAssembler(); summary.CurrentLocation = visit.CurrentLocation == null ? null : locationAssembler.CreateLocationSummary(visit.CurrentLocation); summary.CurrentRoom = visit.CurrentRoom; summary.CurrentBed = visit.CurrentBed; return summary; }
public VisitSummary CreateVisitSummary(Visit visit, IPersistenceContext context) { var patientProfileAssembler = new PatientProfileAssembler(); var summary = new VisitSummary { VisitRef = visit.GetRef(), Patient = patientProfileAssembler.CreatePatientProfileSummary(visit.PatientProfile, context), VisitNumber = CreateVisitNumberDetail(visit.VisitNumber), AdmissionType = EnumUtils.GetEnumValueInfo(visit.AdmissionType), PatientClass = EnumUtils.GetEnumValueInfo(visit.PatientClass), PatientType = EnumUtils.GetEnumValueInfo(visit.PatientType), Status = EnumUtils.GetEnumValueInfo(visit.Status, context), AdmitTime = visit.AdmitTime, DischargeTime = visit.DischargeTime }; var facilityAssembler = new FacilityAssembler(); summary.Facility = visit.Facility == null ? null : facilityAssembler.CreateFacilitySummary(visit.Facility); var locationAssembler = new LocationAssembler(); summary.CurrentLocation = visit.CurrentLocation == null ? null : locationAssembler.CreateLocationSummary(visit.CurrentLocation); summary.CurrentRoom = visit.CurrentRoom; summary.CurrentBed = visit.CurrentBed; return(summary); }
public ListProfilesForPatientsResponse ListProfilesForPatients(ListProfilesForPatientsRequest request) { var assembler = new PatientProfileAssembler(); var summaries = new List<PatientProfileSummary>(); foreach (var patientRef in request.PatientRefs) { var patient = this.PersistenceContext.Load<Patient>(patientRef); foreach (var profile in patient.Profiles) { summaries.Add(assembler.CreatePatientProfileSummary(profile, this.PersistenceContext)); } } return new ListProfilesForPatientsResponse(summaries); }
public VisitDetail CreateVisitDetail(Visit visit, IPersistenceContext context) { var patientProfileAssembler = new PatientProfileAssembler(); var detail = new VisitDetail { VisitRef = visit.GetRef(), Patient = patientProfileAssembler.CreatePatientProfileSummary(visit.PatientProfile, context), VisitNumber = CreateVisitNumberDetail(visit.VisitNumber), AdmissionType = EnumUtils.GetEnumValueInfo(visit.AdmissionType), PatientClass = EnumUtils.GetEnumValueInfo(visit.PatientClass), PatientType = EnumUtils.GetEnumValueInfo(visit.PatientType), Status = EnumUtils.GetEnumValueInfo(visit.Status, context), AdmitTime = visit.AdmitTime, DischargeTime = visit.DischargeTime, DischargeDisposition = visit.DischargeDisposition, Facility = new FacilityAssembler().CreateFacilitySummary(visit.Facility), CurrentLocation = visit.CurrentLocation == null ? null : new LocationAssembler().CreateLocationSummary(visit.CurrentLocation), CurrentRoom = visit.CurrentRoom, CurrentBed = visit.CurrentBed, Locations = new List <VisitLocationDetail>(), PreadmitNumber = visit.PreadmitNumber, VipIndicator = visit.VipIndicator, ExtendedProperties = ExtendedPropertyUtils.Copy(visit.ExtendedProperties) }; foreach (var vl in visit.Locations) { detail.Locations.Add(CreateVisitLocationDetail(vl, context)); } detail.Practitioners = new List <VisitPractitionerDetail>(); foreach (var vp in visit.Practitioners) { detail.Practitioners.Add(CreateVisitPractitionerDetail(vp, context)); } detail.AmbulatoryStatuses = new List <EnumValueInfo>(); foreach (var ambulatoryStatus in visit.AmbulatoryStatuses) { detail.AmbulatoryStatuses.Add(EnumUtils.GetEnumValueInfo(ambulatoryStatus)); } return(detail); }
public VisitDetail CreateVisitDetail(Visit visit, IPersistenceContext context) { var patientProfileAssembler = new PatientProfileAssembler(); var detail = new VisitDetail { VisitRef = visit.GetRef(), Patient = patientProfileAssembler.CreatePatientProfileSummary(visit.PatientProfile, context), VisitNumber = CreateVisitNumberDetail(visit.VisitNumber), AdmissionType = EnumUtils.GetEnumValueInfo(visit.AdmissionType), PatientClass = EnumUtils.GetEnumValueInfo(visit.PatientClass), PatientType = EnumUtils.GetEnumValueInfo(visit.PatientType), Status = EnumUtils.GetEnumValueInfo(visit.Status, context), AdmitTime = visit.AdmitTime, DischargeTime = visit.DischargeTime, DischargeDisposition = visit.DischargeDisposition, Facility = new FacilityAssembler().CreateFacilitySummary(visit.Facility), CurrentLocation = visit.CurrentLocation == null ? null : new LocationAssembler().CreateLocationSummary(visit.CurrentLocation), CurrentRoom = visit.CurrentRoom, CurrentBed = visit.CurrentBed, Locations = new List<VisitLocationDetail>(), PreadmitNumber = visit.PreadmitNumber, VipIndicator = visit.VipIndicator, ExtendedProperties = ExtendedPropertyUtils.Copy(visit.ExtendedProperties) }; foreach (var vl in visit.Locations) { detail.Locations.Add(CreateVisitLocationDetail(vl, context)); } detail.Practitioners = new List<VisitPractitionerDetail>(); foreach (var vp in visit.Practitioners) { detail.Practitioners.Add(CreateVisitPractitionerDetail(vp, context)); } detail.AmbulatoryStatuses = new List<EnumValueInfo>(); foreach (var ambulatoryStatus in visit.AmbulatoryStatuses) { detail.AmbulatoryStatuses.Add(EnumUtils.GetEnumValueInfo(ambulatoryStatus)); } return detail; }
public ReconciliationCandidate CreateReconciliationCandidate(PatientProfileMatch profileMatch, IPersistenceContext context) { var rc = new ReconciliationCandidate(); var profileAssembler = new PatientProfileAssembler(); rc.PatientProfile = profileAssembler.CreatePatientProfileSummary(profileMatch.PatientProfile, context); switch (profileMatch.Score) { case PatientProfileMatch.ScoreValue.High: rc.Score = ReconciliationCandidate.ProbabilityScore.High; break; case PatientProfileMatch.ScoreValue.Moderate: rc.Score = ReconciliationCandidate.ProbabilityScore.Moderate; break; case PatientProfileMatch.ScoreValue.Low: rc.Score = ReconciliationCandidate.ProbabilityScore.Low; break; } return rc; }
public ListPatientReconciliationMatchesResponse ListPatientReconciliationMatches(ListPatientReconciliationMatchesRequest request) { var targetProfile = this.PersistenceContext.GetBroker<IPatientProfileBroker>().Load(request.PatientProfileRef); var strategy = (IPatientReconciliationStrategy)(new PatientReconciliationStrategyExtensionPoint()).CreateExtension(); var matches = strategy.FindReconciliationMatches(targetProfile, this.PersistenceContext); var profileAssembler = new PatientProfileAssembler(); var rcAssembler = new ReconciliationCandidateAssembler(); var response = new ListPatientReconciliationMatchesResponse { ReconciledProfiles = CollectionUtils.Map<PatientProfile, PatientProfileSummary, List<PatientProfileSummary>>( targetProfile.Patient.Profiles, profile => profileAssembler.CreatePatientProfileSummary(profile, this.PersistenceContext)), MatchCandidates = CollectionUtils.Map<PatientProfileMatch, ReconciliationCandidate, List<ReconciliationCandidate>>( matches, match => rcAssembler.CreateReconciliationCandidate(match, this.PersistenceContext)) }; return response; }
public PatientProfileTextQueryHelper(IPersistenceContext context) { _context = context; _broker = _context.GetBroker <IPatientProfileBroker>(); _assembler = new PatientProfileAssembler(); }