internal static OracleDynamicParameters GetTextTemplateSaveUpdateQueryParams(TextTemplateDTO textTemplate)
        {
            OracleDynamicParameters dynamicParameters = new OracleDynamicParameters();

            var isactive          = textTemplate.IsActive ? 1 : 0;
            var isAttachPSSLink   = textTemplate.AttachPSSLink ? 1 : 0;
            var isVideoAppoinment = textTemplate.IsVideoAppoinment ? 1 : 0;

            var levelOfCareParam = AssocativeArraysConverter
                                   .ConvertCollectionToPLSQLAssociativeArray(textTemplate.OfficialLevelOfCare, "p_offLevelOfCare");

            var contactTypeParam = AssocativeArraysConverter
                                   .ConvertCollectionToPLSQLAssociativeArray(textTemplate.ContactType, "p_contactType");

            dynamicParameters.AddDynamicParams(levelOfCareParam);
            dynamicParameters.AddDynamicParams(contactTypeParam);
            dynamicParameters.Add("p_oldSMSTextID", GuidConvert.ToRaw(textTemplate.TemplateGUID), OracleMappingType.Raw, ParameterDirection.Input);
            dynamicParameters.Add("p_ruleSetGuid", GuidConvert.ToRaw(textTemplate.RuleSetGUID), OracleMappingType.Raw, ParameterDirection.Input);
            dynamicParameters.Add("p_hospitalID", textTemplate.HospitalID, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("p_departmentID", textTemplate.DepartmentID, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("p_OPDID", textTemplate.OPDID, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("p_locationID", textTemplate.LocationID, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("p_sectionID", textTemplate.SectionID, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("p_wardID", textTemplate.WardID, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("p_SMSTextName", textTemplate.Name, OracleMappingType.Varchar2, ParameterDirection.Input);
            dynamicParameters.Add("p_SMSText", textTemplate.SMSText, OracleMappingType.Varchar2, ParameterDirection.Input);
            dynamicParameters.Add("p_SMSTextTempID", GuidConvert.ToRaw(textTemplate.GroupedTextGUID), OracleMappingType.Raw, ParameterDirection.Input);
            dynamicParameters.Add("p_validFrom", textTemplate.ValidFrom, OracleMappingType.Date, ParameterDirection.Input);
            dynamicParameters.Add("p_validTo", textTemplate.ValidTo, OracleMappingType.Date, ParameterDirection.Input);
            dynamicParameters.Add("p_isActive", isactive, OracleMappingType.Int16, ParameterDirection.Input);
            dynamicParameters.Add("p_sendPSSLink", isAttachPSSLink, OracleMappingType.Int16, ParameterDirection.Input);
            dynamicParameters.Add("p_isVideoCall", isVideoAppoinment, OracleMappingType.Int16, ParameterDirection.Input);
            dynamicParameters.Add("l_SMSTEXTID", null, OracleMappingType.Raw, ParameterDirection.ReturnValue, 16);
            return(dynamicParameters);
        }
Пример #2
0
        internal static OracleDynamicParameters getQPForCreateUpdateTag(TagDTO tag)
        {
            var isactive = (tag.IsActive ? 1 : 0);
            OracleDynamicParameters dynamicParameters = new OracleDynamicParameters();

            if (tag.TagGUID != null)
            {
                dynamicParameters.Add("p_smsTemplateTagGUID", GuidConvert.ToRaw(tag.TagGUID), OracleMappingType.Raw, ParameterDirection.Input);
            }
            dynamicParameters.Add("p_hospitalID", tag.HospitalID, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("p_departmentID", tag.DepartmentID, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("p_tagName", tag.Name, OracleMappingType.Varchar2, ParameterDirection.Input, 0, true, 9, 0, String.Empty, DataRowVersion.Current);
            dynamicParameters.Add("p_tagDescription", tag.Description, OracleMappingType.Varchar2, ParameterDirection.Input, 0, true, 9, 0, String.Empty, DataRowVersion.Current);
            dynamicParameters.Add("p_tagType", tag.TagType, OracleMappingType.Int16, ParameterDirection.Input);
            dynamicParameters.Add("p_tagValue", tag.Value, OracleMappingType.Varchar2, ParameterDirection.Input, 0, true, 9, 0, String.Empty, DataRowVersion.Current);
            dynamicParameters.Add("p_dataType", tag.DataType, OracleMappingType.Int16, ParameterDirection.Input);
            dynamicParameters.Add("p_isActive", isactive, OracleMappingType.Int16, ParameterDirection.Input);

            if (tag.TagGUID != null)
            {
                dynamicParameters.Add("l_newsmstemplatetagguid", null, OracleMappingType.Raw, ParameterDirection.ReturnValue, 16);
            }
            else
            {
                dynamicParameters.Add("l_tagID", null, OracleMappingType.Raw, ParameterDirection.ReturnValue, 16);
            }

            return(dynamicParameters);
        }
Пример #3
0
        internal static OracleDynamicParameters getQPForCreateORUpdateRuleSet(RuleSetDTO ruleSetDTO)
        {
            var isactive          = (ruleSetDTO.IsActive ? 1 : 0);
            var isValidateAptTime = (ruleSetDTO.isValidateAptTime ? 1 : 0);
            var sendSMSIfAdmitted = (ruleSetDTO.IgnoreSMStoAdmittedPatient ? 1 : 0);

            OracleDynamicParameters dynamicParameters = AssocativeArraysConverter
                                                        .ConvertCollectionToPLSQLAssociativeArray(ruleSetDTO.ExcludingOrgUnitIDs, "p_excludedReshIDs");

            dynamicParameters.Add("p_oldRulesetGuid", GuidConvert.ToRaw(ruleSetDTO.RuleSetGUID), OracleMappingType.Raw, ParameterDirection.Input);
            dynamicParameters.Add("p_hospitalID", ruleSetDTO.HospitalID, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("p_departmentID", ruleSetDTO.DepartmentID, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("p_ruleSetName", ruleSetDTO.Name, OracleMappingType.Varchar2, ParameterDirection.Input, 0, true, 9, 0, String.Empty, DataRowVersion.Current);
            dynamicParameters.Add("p_sendBeforeDays", ruleSetDTO.SendSMSBeforeDays, OracleMappingType.Int16, ParameterDirection.Input);
            dynamicParameters.Add("p_retryExpireDays", ruleSetDTO.DaysForRetryExpiry, OracleMappingType.Int16, ParameterDirection.Input);
            dynamicParameters.Add("p_validateAptTime", isValidateAptTime, OracleMappingType.Int16, ParameterDirection.Input);
            dynamicParameters.Add("p_validAptFromTime", ruleSetDTO.AptValidate_From, OracleMappingType.Varchar2, ParameterDirection.Input, 0, true, 9, 0, String.Empty, DataRowVersion.Current);
            dynamicParameters.Add("p_validAptToTime", ruleSetDTO.AptValidate_To, OracleMappingType.Varchar2, ParameterDirection.Input, 0, true, 9, 0, String.Empty, DataRowVersion.Current);
            dynamicParameters.Add("p_validFrom", ruleSetDTO.ValidFrom, OracleMappingType.TimeStamp, ParameterDirection.InputOutput, 25);
            dynamicParameters.Add("p_validTo", ruleSetDTO.ValidTo, OracleMappingType.TimeStamp, ParameterDirection.InputOutput, 25);
            dynamicParameters.Add("p_timeWindowFrom", ruleSetDTO.SendingTimeWindowFrom, OracleMappingType.Varchar2, ParameterDirection.Input, 0, true, 9, 0, String.Empty, DataRowVersion.Current);
            dynamicParameters.Add("p_timeWindowTo", ruleSetDTO.SendingTimeWindowTo, OracleMappingType.Varchar2, ParameterDirection.Input, 0, true, 9, 0, String.Empty, DataRowVersion.Current);
            dynamicParameters.Add("p_sendBefore", ruleSetDTO.SendSMSBeforeInMins, OracleMappingType.Int16, ParameterDirection.Input, 0, true, 9, 0, String.Empty, DataRowVersion.Current);
            dynamicParameters.Add("p_isActive", isactive, OracleMappingType.Int16, ParameterDirection.Input);
            dynamicParameters.Add("p_ignoreForAdmitted", sendSMSIfAdmitted, OracleMappingType.Int16, ParameterDirection.Input);

            dynamicParameters.Add("l_ruleSetGuid", null, OracleMappingType.Raw, ParameterDirection.ReturnValue, 16);

            return(dynamicParameters);
        }
        internal static OracleDynamicParameters GetTextTemplateBYIdQueryParams(Guid textTemplateId)
        {
            OracleDynamicParameters dynamicParameters = new OracleDynamicParameters();

            dynamicParameters.Add("p_SMSTextGUID", GuidConvert.ToRaw(textTemplateId), OracleMappingType.Raw, ParameterDirection.Input);
            dynamicParameters.Add("l_SMSTextDetails", null, OracleMappingType.RefCursor, ParameterDirection.ReturnValue);
            return(dynamicParameters);
        }
Пример #5
0
        internal static OracleDynamicParameters GetRuleSetByIdQueryParams(Guid ruleSetGuid)
        {
            OracleDynamicParameters dynamicParameters = new OracleDynamicParameters();

            dynamicParameters.Add("p_ruleSetGuid ", GuidConvert.ToRaw(ruleSetGuid), OracleMappingType.Raw, ParameterDirection.Input);
            dynamicParameters.Add("l_ruleSetDetails ", null, OracleMappingType.RefCursor, ParameterDirection.ReturnValue);

            return(dynamicParameters);
        }
Пример #6
0
        internal static OracleDynamicParameters GetQPForGetTagByID(Guid tagId)
        {
            var byteArray = GuidConvert.ToRaw(tagId);

            OracleDynamicParameters dynamicParameters = new OracleDynamicParameters();

            dynamicParameters.Add("p_SMSTemplateTagGUID", byteArray, OracleMappingType.Raw, ParameterDirection.Input, 16);
            dynamicParameters.Add("l_tagDetails", null, OracleMappingType.RefCursor, ParameterDirection.ReturnValue, 300);
            return(dynamicParameters);
        }
        internal static OracleDynamicParameters GetFiletrByHospitalLevelQueryParams(Guid scheduleId, long hospitalId, long?locationId, List <int> contactTypes, List <int> officialLevelofcare)
        {
            OracleDynamicParameters dynamicParameters = new OracleDynamicParameters();

            var careLevelString   = (officialLevelofcare == null) ? null : string.Join(",", officialLevelofcare);
            var contactTypeString = (contactTypes == null) ? null : string.Join(",", contactTypes);

            dynamicParameters.Add("p_rulesetguid", GuidConvert.ToRaw(scheduleId), OracleMappingType.Raw, ParameterDirection.Input);
            dynamicParameters.Add("p_hospitalID", hospitalId, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("p_locationID", locationId, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("p_levelOfCare", careLevelString, OracleMappingType.Varchar2, ParameterDirection.Input);
            dynamicParameters.Add("p_contactType", contactTypeString, OracleMappingType.Varchar2, ParameterDirection.Input);
            dynamicParameters.Add("l_smsTemplateList", null, OracleMappingType.RefCursor, ParameterDirection.ReturnValue);
            return(dynamicParameters);
        }
Пример #8
0
        internal static OracleDynamicParameters GetDateTimeFormatCreateUpdateQueryParams(SmsConfigurationDTO smsConfigurationDto)
        {
            var isActiveIntVal    = smsConfigurationDto.IsActive ? 1 : 0;
            var parameterType     = (short)GlobalOptions.ConfigurationParameterType.DateTimeFormat;
            var dynamicParameters = new OracleDynamicParameters();

            dynamicParameters.Add("p_configurationguid", GuidConvert.ToRaw(smsConfigurationDto.Id), OracleMappingType.Raw, ParameterDirection.Input);
            dynamicParameters.Add("p_hospitalID", smsConfigurationDto.HospitalId, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("p_parametertype", parameterType, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("p_parameter", smsConfigurationDto.Name, OracleMappingType.Varchar2, ParameterDirection.Input);
            dynamicParameters.Add("p_parametervalue", smsConfigurationDto.Value, OracleMappingType.Varchar2, ParameterDirection.Input);
            dynamicParameters.Add("p_isActive", isActiveIntVal, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("l_configurationguid", null, OracleMappingType.Raw, ParameterDirection.ReturnValue, 16);

            return(dynamicParameters);
        }
Пример #9
0
        internal static OracleDynamicParameters GetPSSLinkCreateUpdateQueryParams(SmsConfigurationDTO smsConfigurationDto)
        {
            var isActiveIntVal    = 1; // we don't support to inactive the link status
            var parameterType     = (short)GlobalOptions.ConfigurationParameterType.PSSLink;
            var dynamicParameters = new OracleDynamicParameters();

            dynamicParameters.Add("p_configurationguid", GuidConvert.ToRaw(smsConfigurationDto.Id), OracleMappingType.Raw, ParameterDirection.Input);
            dynamicParameters.Add("p_hospitalID", smsConfigurationDto.HospitalId, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("p_parametertype", parameterType, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("p_parameter", smsConfigurationDto.Name, OracleMappingType.Varchar2, ParameterDirection.Input);
            dynamicParameters.Add("p_parametervalue", smsConfigurationDto.Value, OracleMappingType.Varchar2, ParameterDirection.Input);
            dynamicParameters.Add("p_isActive", isActiveIntVal, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("l_configurationguid", null, OracleMappingType.Raw, ParameterDirection.ReturnValue, 16);

            return(dynamicParameters);
        }
        /// <summary>
        /// update text Template Query params
        /// </summary>
        /// <param name="groupedTextDTO"></param>
        /// <returns></returns>
        internal static OracleDynamicParameters GetGroupTemplateUpdateQueryParams(GroupedTextDTO groupedTextDTO)
        {
            OracleDynamicParameters dynamicParameters = new OracleDynamicParameters();

            if (groupedTextDTO.GroupedTempateGUID != null)
            {
                dynamicParameters.Add("p_textTemplateGUID", GuidConvert.ToRaw(groupedTextDTO.GroupedTempateGUID), OracleMappingType.Raw, ParameterDirection.Input);
            }

            dynamicParameters.Add("p_hospitalID", groupedTextDTO.HospitalID, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("p_departmentID", groupedTextDTO.DepartmentID, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("p_SMSTextTempName", groupedTextDTO.Name, OracleMappingType.Varchar2, ParameterDirection.Input);
            dynamicParameters.Add("p_SMSText", groupedTextDTO.Text, OracleMappingType.Varchar2, ParameterDirection.Input);
            dynamicParameters.Add("l_newtextTemplateGUID", null, OracleMappingType.Raw, ParameterDirection.ReturnValue, 16);
            return(dynamicParameters);
        }
Пример #11
0
        internal static OracleDynamicParameters GetSelectRuleSetsOnQueryParams(Guid?ruleSetGuid, long?departmetnID, string searchTerm, bool?getActive, bool getHospitalLevel, long hospitalId)
        {
            int?getActiveValue = null;

            if (getActive != null)
            {
                getActiveValue = ((bool)getActive ? 1 : 0);
            }

            int getHospitalLevelValue = (getHospitalLevel ? 1 : 0);

            OracleDynamicParameters dynamicParameters = new OracleDynamicParameters();

            dynamicParameters.Add("p_departmentId", departmetnID, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("p_hospitalID", hospitalId, OracleMappingType.Long, ParameterDirection.Input);
            dynamicParameters.Add("p_rulesetGUID ", GuidConvert.ToRaw(ruleSetGuid), OracleMappingType.Raw, ParameterDirection.Input);
            dynamicParameters.Add("p_rulesetName", searchTerm, OracleMappingType.Varchar2, ParameterDirection.Input, 0, true, 9, 0, String.Empty, DataRowVersion.Current);
            dynamicParameters.Add("p_isActive", getActiveValue, OracleMappingType.Int16, ParameterDirection.Input);
            dynamicParameters.Add("p_hospitalOnly", getHospitalLevelValue, OracleMappingType.Int16, ParameterDirection.Input);
            dynamicParameters.Add("l_ruleSet ", null, OracleMappingType.RefCursor, ParameterDirection.ReturnValue);

            return(dynamicParameters);
        }