示例#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);
        }