Esempio n. 1
0
        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);
        }
Esempio n. 2
0
		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;
		}