private List <Folder> GetFolders(List <StoredQueryParameter> lstStoredQueryParameter)
        {
            List <Folder> lstFolder = null;
            RegistryStoredQueryDataAccess objRegistryStoredQueryDAL = null;
            string availabilityStatusList = null;
            string patientUID             = null;

            for (int count = 0; count < lstStoredQueryParameter.Count; count++)
            {
                if (lstStoredQueryParameter[count].ParameterName == "$XDSFolderStatus")
                {
                    availabilityStatusList = PrepareForSqlInStatement(lstStoredQueryParameter[count].ParameterValue);
                }
                else if (lstStoredQueryParameter[count].ParameterName == "$XDSFolderPatientId")
                {
                    patientUID = lstStoredQueryParameter[count].ParameterValue;
                }
            }

            objRegistryStoredQueryDAL = new RegistryStoredQueryDataAccess();
            lstFolder = objRegistryStoredQueryDAL.GetFolders(availabilityStatusList, patientUID);
            objRegistryStoredQueryDAL = null;

            return(lstFolder);
        }
        public override System.Xml.XmlDocument ProcessQuery(StoredQuery objStoredQueryRequest)
        {
            XmlDocument          xmlDocResponse = null;
            XmlDocument          xmlDocAdHocQueryResponse;
            List <SubmissionSet> lstSubmissionSet = null;
            List <DocumentEntry> lstDocumentEntry = null;
            List <Folder>        lstFolder        = null;
            List <Association>   lstAssociation   = null;
            string patientUID          = null;
            string submissionSetStatus = null;
            string documentEntryStatus = null;
            string folderStatus        = null;
            string documentEntryUUIDs  = null;
            RegistryStoredQueryDataAccess objStoredQueryDAL = new RegistryStoredQueryDataAccess();

            patientUID          = base.RemoveSingleQuotes(GetParameterValue(objStoredQueryRequest.ParameterList, "$patientId"));
            submissionSetStatus = base.PrepareForSqlInStatement(GetParameterValue(objStoredQueryRequest.ParameterList, "$XDSSubmissionSetStatus"));
            documentEntryStatus = base.PrepareForSqlInStatement(GetParameterValue(objStoredQueryRequest.ParameterList, "$XDSDocumentEntryStatus"));
            folderStatus        = base.PrepareForSqlInStatement(GetParameterValue(objStoredQueryRequest.ParameterList, "$XDSFolderStatus"));

            //SubmissionSet
            lstSubmissionSet = objStoredQueryDAL.GetSubmissionSets(submissionSetStatus, patientUID);

            //DocumentEntry
            lstDocumentEntry   = objStoredQueryDAL.GetDocumentEntries(documentEntryStatus, patientUID);
            lstDocumentEntry   = GetDocumentEntries(lstDocumentEntry, objStoredQueryRequest);
            documentEntryUUIDs = GetDocumentEntryUUIDs(lstDocumentEntry);

            //Folders
            lstFolder = objStoredQueryDAL.GetFolders(folderStatus, patientUID);

            //Associations
            lstAssociation = objStoredQueryDAL.GetAssociations(documentEntryUUIDs, null);


            //Construct AdHocQueryResponse Element
            xmlDocAdHocQueryResponse = StoredQueryBase.ConstructAdHocQueryResponseElement(GlobalValues.CONST_RESPONSE_STATUS_TYPE_SUCCESS);

            xmlDocResponse = ConstructRegistryObjectList(xmlDocAdHocQueryResponse, lstSubmissionSet, lstDocumentEntry, lstFolder, lstAssociation);

            return(xmlDocResponse);
        }