Example #1
0
        /// <summary>
        /// Insert the supplied referal into Garp tables
        /// </summary>
        /// <param name="r"></param>
        public string insertReferrals(Referral r, string knr, string compid)
        {
            sKNR = knr;

            Ortoped.GarpFunctions.orderFunc of = new Ortoped.GarpFunctions.orderFunc();
            Ortoped.Definitions.OrderHeadDefinition newOH = of.addOH(sKNR, compid);

            if (newOH == null)
            {
                MessageBox.Show(null, "Ett fel uppstod vid skapande av order: " + newOH.OrderNo, "Fel", MessageBoxButtons.OK, MessageBoxIcon.Information);
                throw new Exception("Kunde inte skapa order");
            }

            try
            {
                newOH.Pricelist = "A";
                newOH.DiagnoseCode = r.diagnoskod;
                newOH.ValidFrom = r.giltligfran;
                newOH.SelOrdinator = r.ordinator;
                newOH.ValidYearsCount = int.Parse(r.antalar);
                newOH.InvoiceCustomer = "140";
                newOH.OrderType = compid;
                newOH.KombikaCode = r.kombikakod;
                newOH.ReferralNo = r.remissid;
                newOH.YourReference = r.remissid;
                newOH.Ordination = r.aidtypes + " " + r.ordination;
                newOH.Diagnose = r.diagnos;
                newOH.Priority = r.prioritering;
                if (ECS.noNULL(r.handlaggare).Equals(""))
                    newOH.Notation = r.notering;
                else
                    newOH.Notation = r.notering + " Önskad handläggare: " + r.handlaggare;

                if (!of.saveOH(newOH))
                    throw new Exception("Kunde inte skapa order");
            }
            catch
            {
                MessageBox.Show(null, "Ett fel uppstod vid skapande av order: " + newOH.OrderNo, "Fel", MessageBoxButtons.OK, MessageBoxIcon.Information);
                throw new Exception("Kunde inte skapa order");
            }
            return newOH.OrderNo;
        }
Example #2
0
        /// <summary>
        /// Fetches garp data and creates instances of referralefinition
        /// </summary>
        /// <param name="ordernr">order number</param>
        /// <returns>Array of New Aid Definitions</returns>
        public Referral getReferralForRemovalOfPart(string ordernr, string aidid, string rowremoval)
        {
            Ortoped.GarpFunctions.orderFunc ohf = new Ortoped.GarpFunctions.orderFunc();
            OrderHeadDefinition oh;
            Referral rf = new Referral();
            oh = ohf.getOrder(ordernr);

            if (!oh.ReferralNo.Equals(""))
            {
                rf.personnr = oh.PatientsSSN;
                rf.remissid = oh.ReferralNo;
                rf.kombikakod = oh.KombikaCode;
                rf.ordinator = oh.SelOrdinator;
                //      rf.datum = oh.Orderdatum;
                rf.diagnos = oh.DiagnoseCode;
                rf.notering = oh.Notation;
                rf.orderno = oh.OrderNo;

                rf.aids = getAids(ordernr, aidid);

                for (int i = 0; i < rf.aids[0].parts.Length; i++)
                {
                    if (rf.aids[0].parts[i].orderno.Equals(ordernr) && rf.aids[0].parts[i].row.Equals(rowremoval))
                        rf.aids[0].parts[i].RemoveMe = true;

                    if (rf.aids[0].parts.Length <= 1)
                        rf.aids[0].RemoveMe = true;
                }
            }
            return rf;
        }
Example #3
0
        /// <summary>
        /// Fetches Referals with the supplies Ordernumber
        /// </summary>
        /// <param name="ordnr">The ordernumber</param>
        /// <returns></returns>
        public Referral[] getReferrals(String ordnr)
        {
            ArrayList aList = new ArrayList();
            Referral rfl = new Referral();
            Ortoped.GarpFunctions.orderFunc of = new Ortoped.GarpFunctions.orderFunc();
            Ortoped.Definitions.OrderHeadDefinition oOH = of.getOrder(ordnr);

            if (oOH.OrderNo != null)
            {
                rfl.datum = DateTime.ParseExact(oOH.OrderDate, "yyMMdd", new CultureInfo("sv-SE"));
                rfl.ordinator = oOH.SelOrdinator;
                rfl.personnr = oOH.PatientNo;
                rfl.diagnos = oOH.Diagnose;
                rfl.notering = oOH.Notation;
                rfl.kombikakod = oOH.KombikaCode;
                rfl.remissid = oOH.ReferralNo;
            }

            aList.Add(rfl);

            return (Referral[])aList.ToArray(typeof(Referral));
        }
Example #4
0
        /// <summary>
        /// Fetches garp data and creates instances of referralefinition
        /// </summary>
        /// <param name="ordernr">order number</param>
        /// <returns>Array of New Aid Definitions</returns>
        public Referral getReferral(string ordernr, string aidid)
        {
            Ortoped.GarpFunctions.orderFunc ohf = new Ortoped.GarpFunctions.orderFunc();
            OrderHeadDefinition oh;
            Referral rf = new Referral();
            oh = ohf.getOrder(ordernr);

            if (!oh.ReferralNo.Equals(""))
            {
                rf.personnr = oh.PatientsSSN;
                rf.remissid = oh.ReferralNo;
                rf.kombikakod = oh.KombikaCode;
                rf.ordinator = oh.SelOrdinator;
                //      rf.datum = oh.Orderdatum;
                rf.diagnos = oh.DiagnoseCode;
                rf.notering = oh.Notation;
                rf.orderno = oh.OrderNo;

                rf.aids = getAids(ordernr, aidid);
            }

            return rf;
        }