public LoadVisitEditorFormDataResponse LoadVisitEditorFormData(LoadVisitEditorFormDataRequest request) { // ignore request LoadVisitEditorFormDataResponse response = new LoadVisitEditorFormDataResponse(); response.AdmissionTypeChoices = EnumUtils.GetEnumValueList<AdmissionTypeEnum>(PersistenceContext); response.AmbulatoryStatusChoices = EnumUtils.GetEnumValueList<AmbulatoryStatusEnum>(PersistenceContext); response.PatientClassChoices = EnumUtils.GetEnumValueList<PatientClassEnum>(PersistenceContext); response.PatientTypeChoices = EnumUtils.GetEnumValueList<PatientTypeEnum>(PersistenceContext); response.VisitLocationRoleChoices = EnumUtils.GetEnumValueList<VisitLocationRoleEnum>(PersistenceContext); response.VisitNumberAssigningAuthorityChoices = EnumUtils.GetEnumValueList<InformationAuthorityEnum>(PersistenceContext); response.VisitPractitionerRoleChoices = EnumUtils.GetEnumValueList<VisitPractitionerRoleEnum>(PersistenceContext); response.VisitStatusChoices = EnumUtils.GetEnumValueList<VisitStatusEnum>(PersistenceContext); FacilityAssembler facilityAssembler = new FacilityAssembler(); response.FacilityChoices = CollectionUtils.Map<Facility, FacilitySummary, List<FacilitySummary>>( PersistenceContext.GetBroker<IFacilityBroker>().FindAll(false), delegate(Facility f) { return facilityAssembler.CreateFacilitySummary(f); }); LocationAssembler locationAssembler = new LocationAssembler(); response.CurrentLocationChoices = CollectionUtils.Map<Location, LocationSummary>( PersistenceContext.GetBroker<ILocationBroker>().FindAll(false), delegate(Location f) { return locationAssembler.CreateLocationSummary(f); }); return response; }
public ListAllLocationsResponse ListAllLocations(ListAllLocationsRequest request) { LocationSearchCriteria criteria = new LocationSearchCriteria(); criteria.Id.SortAsc(0); if (request.Facility != null) { criteria.Facility.EqualTo(PersistenceContext.Load <Facility>(request.Facility.FacilityRef)); } if (!string.IsNullOrEmpty(request.Name)) { criteria.Name.StartsWith(request.Name); } if (!request.IncludeDeactivated) { criteria.Deactivated.EqualTo(false); } LocationAssembler assembler = new LocationAssembler(); return(new ListAllLocationsResponse( CollectionUtils.Map <Location, LocationSummary, List <LocationSummary> >( PersistenceContext.GetBroker <ILocationBroker>().Find(criteria, request.Page), delegate(Location l) { return assembler.CreateLocationSummary(l); }))); }
public UpdateLocationResponse UpdateLocation(UpdateLocationRequest request) { Location location = PersistenceContext.Load <Location>(request.LocationDetail.LocationRef, EntityLoadFlags.CheckVersion); LocationAssembler assembler = new LocationAssembler(); assembler.UpdateLocation(request.LocationDetail, location, PersistenceContext); return(new UpdateLocationResponse(assembler.CreateLocationSummary(location))); }
public AddLocationResponse AddLocation(AddLocationRequest request) { Location location = new Location(); LocationAssembler assembler = new LocationAssembler(); assembler.UpdateLocation(request.LocationDetail, location, PersistenceContext); PersistenceContext.Lock(location, DirtyState.New); // ensure the new location is assigned an OID before using it in the return value PersistenceContext.SynchState(); return(new AddLocationResponse(assembler.CreateLocationSummary(location))); }
public ListAllLocationsResponse ListAllLocations(ListAllLocationsRequest request) { LocationSearchCriteria criteria = new LocationSearchCriteria(); criteria.Id.SortAsc(0); if (request.Facility != null) criteria.Facility.EqualTo(PersistenceContext.Load<Facility>(request.Facility.FacilityRef)); if (!string.IsNullOrEmpty(request.Name)) criteria.Name.StartsWith(request.Name); if (!request.IncludeDeactivated) criteria.Deactivated.EqualTo(false); LocationAssembler assembler = new LocationAssembler(); return new ListAllLocationsResponse( CollectionUtils.Map<Location, LocationSummary, List<LocationSummary>>( PersistenceContext.GetBroker<ILocationBroker>().Find(criteria, request.Page), delegate(Location l) { return assembler.CreateLocationSummary(l); })); }
public LoadVisitEditorFormDataResponse LoadVisitEditorFormData(LoadVisitEditorFormDataRequest request) { // ignore request LoadVisitEditorFormDataResponse response = new LoadVisitEditorFormDataResponse(); response.AdmissionTypeChoices = EnumUtils.GetEnumValueList <AdmissionTypeEnum>(PersistenceContext); response.AmbulatoryStatusChoices = EnumUtils.GetEnumValueList <AmbulatoryStatusEnum>(PersistenceContext); response.PatientClassChoices = EnumUtils.GetEnumValueList <PatientClassEnum>(PersistenceContext); response.PatientTypeChoices = EnumUtils.GetEnumValueList <PatientTypeEnum>(PersistenceContext); response.VisitLocationRoleChoices = EnumUtils.GetEnumValueList <VisitLocationRoleEnum>(PersistenceContext); response.VisitNumberAssigningAuthorityChoices = EnumUtils.GetEnumValueList <InformationAuthorityEnum>(PersistenceContext); response.VisitPractitionerRoleChoices = EnumUtils.GetEnumValueList <VisitPractitionerRoleEnum>(PersistenceContext); response.VisitStatusChoices = EnumUtils.GetEnumValueList <VisitStatusEnum>(PersistenceContext); FacilityAssembler facilityAssembler = new FacilityAssembler(); response.FacilityChoices = CollectionUtils.Map <Facility, FacilitySummary, List <FacilitySummary> >( PersistenceContext.GetBroker <IFacilityBroker>().FindAll(false), delegate(Facility f) { return(facilityAssembler.CreateFacilitySummary(f)); }); LocationAssembler locationAssembler = new LocationAssembler(); response.CurrentLocationChoices = CollectionUtils.Map <Location, LocationSummary>( PersistenceContext.GetBroker <ILocationBroker>().FindAll(false), delegate(Location f) { return(locationAssembler.CreateLocationSummary(f)); }); return(response); }
/// <summary> /// Create worklist detail. /// </summary> /// <param name="worklist"></param> /// <param name="context"></param> /// <returns></returns> public WorklistAdminDetail CreateWorklistDetail(Worklist worklist, IPersistenceContext context) { var detail = new WorklistAdminDetail(worklist.GetRef(), worklist.Name, worklist.Description, CreateClassSummary(worklist.GetClass())); var staffAssembler = new StaffAssembler(); var staffGroupAssembler = new StaffGroupAssembler(); detail.OwnerStaff = worklist.Owner.IsStaffOwner ? staffAssembler.CreateStaffSummary(worklist.Owner.Staff, context) : null; detail.OwnerGroup = worklist.Owner.IsGroupOwner ? staffGroupAssembler.CreateSummary(worklist.Owner.Group) : null; // proc types var ptAssembler = new ProcedureTypeAssembler(); detail.ProcedureTypes = GetFilterSummary(worklist.ProcedureTypeFilter, item => ptAssembler.CreateSummary(item)); // proc type groups var ptgAssembler = new ProcedureTypeGroupAssembler(); detail.ProcedureTypeGroups = GetFilterSummary(worklist.ProcedureTypeGroupFilter, item => ptgAssembler.GetProcedureTypeGroupSummary(item, context)); // facilities var facilityAssembler = new FacilityAssembler(); detail.Facilities = GetFilterSummary(worklist.FacilityFilter, item => facilityAssembler.CreateFacilitySummary(item)); detail.FilterByWorkingFacility = worklist.FacilityFilter.IsEnabled && worklist.FacilityFilter.IncludeWorkingFacility; // departments var departmentAssembler = new DepartmentAssembler(); detail.Departments = GetFilterSummary(worklist.DepartmentFilter, item => departmentAssembler.CreateSummary(item, context)); // patient class detail.PatientClasses = GetFilterSummary(worklist.PatientClassFilter, item => EnumUtils.GetEnumValueInfo(item)); // location var locationAssembler = new LocationAssembler(); detail.PatientLocations = GetFilterSummary(worklist.PatientLocationFilter, item => locationAssembler.CreateLocationSummary(item)); // order priority detail.OrderPriorities = GetFilterSummary(worklist.OrderPriorityFilter, item => EnumUtils.GetEnumValueInfo(item)); // ordering prac var practitionerAssembler = new ExternalPractitionerAssembler(); detail.OrderingPractitioners = GetFilterSummary(worklist.OrderingPractitionerFilter, item => practitionerAssembler.CreateExternalPractitionerSummary(item, context)); // portable if (worklist.PortableFilter.IsEnabled) { detail.Portabilities = new List <bool> { worklist.PortableFilter.Value }; } // time window if (worklist.TimeFilter.IsEnabled && worklist.TimeFilter.Value != null) { if (worklist.TimeFilter.Value.Start != null) { detail.StartTime = CreateTimePointContract(worklist.TimeFilter.Value.Start); } if (worklist.TimeFilter.Value.End != null) { detail.EndTime = CreateTimePointContract(worklist.TimeFilter.Value.End); } } detail.StaffSubscribers = CollectionUtils.Map(worklist.StaffSubscribers, (Staff staff) => staffAssembler.CreateStaffSummary(staff, context)); detail.GroupSubscribers = CollectionUtils.Map(worklist.GroupSubscribers, (StaffGroup group) => staffGroupAssembler.CreateSummary(group)); // Some ReportingWorklists can support staff role filters, if that is true for this worklist, // add those filters to the WorklistAdminDetail if (Worklist.GetSupportsReportingStaffRoleFilter(worklist.GetClass())) { var reportingWorklist = worklist.As <ReportingWorklist>(); detail.InterpretedByStaff = GetFilterSummary(reportingWorklist.InterpretedByStaffFilter, context); detail.TranscribedByStaff = GetFilterSummary(reportingWorklist.TranscribedByStaffFilter, context); detail.VerifiedByStaff = GetFilterSummary(reportingWorklist.VerifiedByStaffFilter, context); detail.SupervisedByStaff = GetFilterSummary(reportingWorklist.SupervisedByStaffFilter, context); } return(detail); }
public UpdateLocationResponse UpdateLocation(UpdateLocationRequest request) { Location location = PersistenceContext.Load<Location>(request.LocationDetail.LocationRef, EntityLoadFlags.CheckVersion); LocationAssembler assembler = new LocationAssembler(); assembler.UpdateLocation(request.LocationDetail, location, PersistenceContext); return new UpdateLocationResponse(assembler.CreateLocationSummary(location)); }
public AddLocationResponse AddLocation(AddLocationRequest request) { Location location = new Location(); LocationAssembler assembler = new LocationAssembler(); assembler.UpdateLocation(request.LocationDetail, location, PersistenceContext); PersistenceContext.Lock(location, DirtyState.New); // ensure the new location is assigned an OID before using it in the return value PersistenceContext.SynchState(); return new AddLocationResponse(assembler.CreateLocationSummary(location)); }