public static void UpdateMessageCollectedStatus(int gp2gpTransferID)
 {
     using (PatientsFirstDataContext dc = new PatientsFirstDataContext())
     {
         dc.Gp2GpTransfers_UpdateCollected(gp2gpTransferID);
     }
 }
Exemple #2
0
        public static List <HimDirectory> GetFacilities()
        {
            List <HimDirectory> facilityList = new List <HimDirectory>();

            List <GetHpiListingResult> facilities = new List <GetHpiListingResult>();

            using (PatientsFirstDataContext dc = new PatientsFirstDataContext())
            {
                facilities = dc.GetHpiListing().ToList();
            }

            foreach (GetHpiListingResult fac in facilities)
            {
                HimDirectory listing = new HimDirectory
                {
                    HpiFacilityId = fac.HPI.Trim(),
                    EDI           = fac.EDI.Trim(),
                    HimOnLine     = fac.HPI_OnLine
                };

                facilityList.Add(listing);
            }

            return(facilityList);
        }
        public static string GetMessageFileName(int gp2gpTransferID)
        {
            string fileName = string.Empty;

            using (PatientsFirstDataContext dc = new PatientsFirstDataContext())
            {
                fileName = dc.GetGp2GpMessageFileName(gp2gpTransferID);
            }

            return(fileName);
        }
        public static void AddGp2GpTransfer(HiMessageFile mf)
        {
            mf.applicationType = "GP2GP"; // some PMS omit this in Ack messages

            using (PatientsFirstDataContext dc = new PatientsFirstDataContext())
            {
                dc.Gp2GpTransfers_Insert(
                    mf.senderEDI,
                    mf.receiverEDI,
                    mf.messageId,
                    mf.messageYear,
                    mf.messageMonth,
                    mf.messageDay,
                    mf.applicationType,
                    mf.fileSize,
                    mf.sendingApplication,
                    mf.responseMessageIndicator,
                    mf.replyToMessageId,
                    mf.messageFileName);
            }
        }
        public static List <HiMessageFile> GetUncollectedMessages(string hpiFacilityID)
        {
            List <HiMessageFile> hpiMessageList = new List <HiMessageFile>();

            List <GetUncollectedGp2GpTransfersResult> transfers = new List <GetUncollectedGp2GpTransfersResult>();

            using (PatientsFirstDataContext dc = new PatientsFirstDataContext())
            {
                transfers = dc.GetUncollectedGp2GpTransfers(hpiFacilityID).ToList();
            }

            foreach (GetUncollectedGp2GpTransfersResult tx in transfers)
            {
                HiMessageFile mf = new HiMessageFile();
                mf.dbKey           = tx.Gp2GpTransferId;
                mf.messageFileName = tx.MessageFileName;
                mf.messageId       = tx.MessageId;

                hpiMessageList.Add(mf);
            }

            return(hpiMessageList);
        }
        public static List <GeneralPractice> GetPractices(string vendorCode, string practiceName, string practiceAddress, string phoName, string dhbName, string ediAddress)
        {
            List <GeneralPractice> practiceList = new List <GeneralPractice>();

            // format SQL UDF parameters correctly...
            string pracName    = string.IsNullOrEmpty(practiceName) ? "ALL" : practiceName;
            string pracAddress = string.IsNullOrEmpty(practiceAddress) ? "ALL" : practiceAddress;
            string pho         = string.IsNullOrEmpty(phoName) ? "ALL" : phoName;
            string dhb         = string.IsNullOrEmpty(dhbName) ? "ALL" : dhbName;
            string edi         = string.IsNullOrEmpty(ediAddress) ? "ALL" : ediAddress;
            string vendor      = "ALL";
            bool   active      = true;

            List <GetPractices_ByNamePhoResult> practices = new List <GetPractices_ByNamePhoResult>();

            using (PatientsFirstDataContext dc = new PatientsFirstDataContext())
            {
                practices = dc.GetPractices_ByNamePho(pracName, pracAddress, pho, dhb, vendor, edi, active).ToList();
            }

            foreach (GetPractices_ByNamePhoResult gp in practices)
            {
                GeneralPractice gpItem = new GeneralPractice {
                    PracticeName    = gp.PracticeName,
                    PracticeAddress = gp.PracticeAddress,
                    HpiFacilityId   = gp.PracticeId,
                    EDI             = gp.EDI.Trim(),
                    PHO             = gp.PhoName,
                    DHB             = gp.DHB,
                    Region          = gp.Region,
                    Rural           = (gp.Rural ? "Yes" : "No")
                };
                practiceList.Add(gpItem);
            }

            return(practiceList);
        }