예제 #1
0
		public LoadPatientProfileEditorFormDataResponse LoadPatientProfileEditorFormData(LoadPatientProfileEditorFormDataRequest request)
		{
			var workflowConfig = new WorkflowConfigurationReader();

			// ignore request
			// Sort the category from High to Low, then sort by name
			var categoryAssembler = new PatientNoteCategoryAssembler();
			IList<PatientNoteCategory> sortedCategoryList = CollectionUtils.Sort(
				PersistenceContext.GetBroker<IPatientNoteCategoryBroker>().FindAll(false),
				(x, y) => string.Compare(x.Name, y.Name));

			var response = new LoadPatientProfileEditorFormDataResponse
				{
					MrnAutoGenerated = workflowConfig.AutoGenerateMrn,
					AddressTypeChoices = EnumUtils.GetEnumValueList<AddressTypeEnum>(PersistenceContext),
					ContactPersonRelationshipChoices = EnumUtils.GetEnumValueList<ContactPersonRelationshipEnum>(PersistenceContext),
					ContactPersonTypeChoices = EnumUtils.GetEnumValueList<ContactPersonTypeEnum>(PersistenceContext),
					HealthcardAssigningAuthorityChoices = EnumUtils.GetEnumValueList<InsuranceAuthorityEnum>(PersistenceContext),
					MrnAssigningAuthorityChoices = EnumUtils.GetEnumValueList<InformationAuthorityEnum>(PersistenceContext),
					PrimaryLanguageChoices = EnumUtils.GetEnumValueList<SpokenLanguageEnum>(PersistenceContext),
					ReligionChoices = EnumUtils.GetEnumValueList<ReligionEnum>(PersistenceContext),
					SexChoices = EnumUtils.GetEnumValueList<SexEnum>(PersistenceContext),
					PhoneTypeChoices = (new SimplifiedPhoneTypeAssembler()).GetPatientPhoneTypeChoices(),
					NoteCategoryChoices = CollectionUtils.Map<PatientNoteCategory, PatientNoteCategorySummary, List<PatientNoteCategorySummary>>(sortedCategoryList,
						category => categoryAssembler.CreateNoteCategorySummary(category, this.PersistenceContext)),

					// Allergies related choices
					AllergenTypeChoices = EnumUtils.GetEnumValueList<AllergyAllergenTypeEnum>(PersistenceContext),
					AllergySeverityChoices = EnumUtils.GetEnumValueList<AllergySeverityEnum>(PersistenceContext),
					AllergySensitivityTypeChoices = EnumUtils.GetEnumValueList<AllergySensitivityTypeEnum>(PersistenceContext),
					PersonRelationshipTypeChoices = EnumUtils.GetEnumValueList<PersonRelationshipTypeEnum>(PersistenceContext)
				};

			return response;
		}
예제 #2
0
        public LoadPatientProfileEditorFormDataResponse LoadPatientProfileEditorFormData(LoadPatientProfileEditorFormDataRequest request)
        {
            var workflowConfig = new WorkflowConfigurationReader();

            // ignore request
            // Sort the category from High to Low, then sort by name
            var categoryAssembler = new PatientNoteCategoryAssembler();
            IList <PatientNoteCategory> sortedCategoryList = CollectionUtils.Sort(
                PersistenceContext.GetBroker <IPatientNoteCategoryBroker>().FindAll(false),
                (x, y) => string.Compare(x.Name, y.Name));

            var response = new LoadPatientProfileEditorFormDataResponse
            {
                MrnAutoGenerated   = workflowConfig.AutoGenerateMrn,
                AddressTypeChoices = EnumUtils.GetEnumValueList <AddressTypeEnum>(PersistenceContext),
                ContactPersonRelationshipChoices    = EnumUtils.GetEnumValueList <ContactPersonRelationshipEnum>(PersistenceContext),
                ContactPersonTypeChoices            = EnumUtils.GetEnumValueList <ContactPersonTypeEnum>(PersistenceContext),
                HealthcardAssigningAuthorityChoices = EnumUtils.GetEnumValueList <InsuranceAuthorityEnum>(PersistenceContext),
                MrnAssigningAuthorityChoices        = EnumUtils.GetEnumValueList <InformationAuthorityEnum>(PersistenceContext),
                PrimaryLanguageChoices = EnumUtils.GetEnumValueList <SpokenLanguageEnum>(PersistenceContext),
                ReligionChoices        = EnumUtils.GetEnumValueList <ReligionEnum>(PersistenceContext),
                SexChoices             = EnumUtils.GetEnumValueList <SexEnum>(PersistenceContext),
                PhoneTypeChoices       = (new SimplifiedPhoneTypeAssembler()).GetPatientPhoneTypeChoices(),
                NoteCategoryChoices    = CollectionUtils.Map <PatientNoteCategory, PatientNoteCategorySummary, List <PatientNoteCategorySummary> >(sortedCategoryList,
                                                                                                                                                   category => categoryAssembler.CreateNoteCategorySummary(category, this.PersistenceContext)),

                // Allergies related choices
                AllergenTypeChoices           = EnumUtils.GetEnumValueList <AllergyAllergenTypeEnum>(PersistenceContext),
                AllergySeverityChoices        = EnumUtils.GetEnumValueList <AllergySeverityEnum>(PersistenceContext),
                AllergySensitivityTypeChoices = EnumUtils.GetEnumValueList <AllergySensitivityTypeEnum>(PersistenceContext),
                PersonRelationshipTypeChoices = EnumUtils.GetEnumValueList <PersonRelationshipTypeEnum>(PersistenceContext)
            };

            return(response);
        }
예제 #3
0
        public LoadNoteCategoryForEditResponse LoadNoteCategoryForEdit(LoadNoteCategoryForEditRequest request)
        {
            // note that the version of the NoteCategoryRef is intentionally ignored here (default behaviour of ReadOperation)
            PatientNoteCategory          category  = PersistenceContext.Load <PatientNoteCategory>(request.NoteCategoryRef);
            PatientNoteCategoryAssembler assembler = new PatientNoteCategoryAssembler();

            return(new LoadNoteCategoryForEditResponse(category.GetRef(), assembler.CreateNoteCategoryDetail(category, this.PersistenceContext)));
        }
예제 #4
0
        public LoadNoteCategoryForEditResponse LoadNoteCategoryForEdit(LoadNoteCategoryForEditRequest request)
        {
            // note that the version of the NoteCategoryRef is intentionally ignored here (default behaviour of ReadOperation)
            PatientNoteCategory category = PersistenceContext.Load<PatientNoteCategory>(request.NoteCategoryRef);
            PatientNoteCategoryAssembler assembler = new PatientNoteCategoryAssembler();

            return new LoadNoteCategoryForEditResponse(category.GetRef(), assembler.CreateNoteCategoryDetail(category, this.PersistenceContext));
        }
예제 #5
0
        public UpdateNoteCategoryResponse UpdateNoteCategory(UpdateNoteCategoryRequest request)
        {
            PatientNoteCategory noteCategory = PersistenceContext.Load <PatientNoteCategory>(request.NoteCategoryDetail.NoteCategoryRef, EntityLoadFlags.CheckVersion);

            PatientNoteCategoryAssembler assembler = new PatientNoteCategoryAssembler();

            assembler.UpdateNoteCategory(request.NoteCategoryDetail, noteCategory);

            return(new UpdateNoteCategoryResponse(assembler.CreateNoteCategorySummary(noteCategory, this.PersistenceContext)));
        }
예제 #6
0
        public AddNoteCategoryResponse AddNoteCategory(AddNoteCategoryRequest request)
        {
            PatientNoteCategory noteCategory = new PatientNoteCategory();

            PatientNoteCategoryAssembler assembler = new PatientNoteCategoryAssembler();
            assembler.UpdateNoteCategory(request.NoteCategoryDetail, noteCategory);

            PersistenceContext.Lock(noteCategory, DirtyState.New);

            // ensure the new NoteCategory is assigned an OID before using it in the return value
            PersistenceContext.SynchState();

            return new AddNoteCategoryResponse(assembler.CreateNoteCategorySummary(noteCategory, this.PersistenceContext));
        }
예제 #7
0
        public AddNoteCategoryResponse AddNoteCategory(AddNoteCategoryRequest request)
        {
            PatientNoteCategory noteCategory = new PatientNoteCategory();

            PatientNoteCategoryAssembler assembler = new PatientNoteCategoryAssembler();

            assembler.UpdateNoteCategory(request.NoteCategoryDetail, noteCategory);

            PersistenceContext.Lock(noteCategory, DirtyState.New);

            // ensure the new NoteCategory is assigned an OID before using it in the return value
            PersistenceContext.SynchState();

            return(new AddNoteCategoryResponse(assembler.CreateNoteCategorySummary(noteCategory, this.PersistenceContext)));
        }
예제 #8
0
        public ListAllNoteCategoriesResponse ListAllNoteCategories(ListAllNoteCategoriesRequest request)
        {
            PatientNoteCategorySearchCriteria criteria = new PatientNoteCategorySearchCriteria();
			criteria.Name.SortAsc(0);
			if (!request.IncludeDeactivated)
				criteria.Deactivated.EqualTo(false);

            PatientNoteCategoryAssembler assembler = new PatientNoteCategoryAssembler();
            return new ListAllNoteCategoriesResponse(
                CollectionUtils.Map<PatientNoteCategory, PatientNoteCategorySummary, List<PatientNoteCategorySummary>>(
                    PersistenceContext.GetBroker<IPatientNoteCategoryBroker>().Find(criteria, request.Page),
                    delegate(PatientNoteCategory category)
                    {
                        return assembler.CreateNoteCategorySummary(category, this.PersistenceContext);
                    }));
        }
예제 #9
0
        public ListAllNoteCategoriesResponse ListAllNoteCategories(ListAllNoteCategoriesRequest request)
        {
            PatientNoteCategorySearchCriteria criteria = new PatientNoteCategorySearchCriteria();

            criteria.Name.SortAsc(0);
            if (!request.IncludeDeactivated)
            {
                criteria.Deactivated.EqualTo(false);
            }

            PatientNoteCategoryAssembler assembler = new PatientNoteCategoryAssembler();

            return(new ListAllNoteCategoriesResponse(
                       CollectionUtils.Map <PatientNoteCategory, PatientNoteCategorySummary, List <PatientNoteCategorySummary> >(
                           PersistenceContext.GetBroker <IPatientNoteCategoryBroker>().Find(criteria, request.Page),
                           delegate(PatientNoteCategory category)
            {
                return assembler.CreateNoteCategorySummary(category, this.PersistenceContext);
            })));
        }
예제 #10
0
		public UpdateNoteCategoryResponse UpdateNoteCategory(UpdateNoteCategoryRequest request)
        {
            PatientNoteCategory noteCategory = PersistenceContext.Load<PatientNoteCategory>(request.NoteCategoryDetail.NoteCategoryRef, EntityLoadFlags.CheckVersion);

            PatientNoteCategoryAssembler assembler = new PatientNoteCategoryAssembler();
            assembler.UpdateNoteCategory(request.NoteCategoryDetail, noteCategory);

            return new UpdateNoteCategoryResponse(assembler.CreateNoteCategorySummary(noteCategory, this.PersistenceContext));
        }