Ejemplo n.º 1
0
        /// <summary> Launches the dose adjustment window. </summary>
        /// <param name="context"></param>
        protected override void DoWork(CodeActivityContext context)
        {
            int  orcSetId     = OrcSetId.Get(context);
            bool useRecentBSA = UseRecentBSA.Get(context);

            Orders order = Orders.GetEntityBySetIDAndVersion0(orcSetId, PM);

            var patId = order.Pat_ID1.GetValueOrDefault(0);

            if (patId != Mosaiq.Core.Globals.Global.PatientId1)
            {
                CallClarion.CallSetPatient(patId);
            }

            bool result = CallClarion.CallReviewRXO(orcSetId, useRecentBSA ? 1 : 2, false);

            Result.Set(context, result);
        }
Ejemplo n.º 2
0
 /// <summary> Launches the dose adjustment window. </summary>
 /// <param name="context"></param>
 protected override void DoWork(CodeActivityContext context)
 {
     int orcSetId = OrcSetId.Get(context);
     //CallClarion.CallReviewRXO(orcSetId);
 }
        /// <summary> Lookup the order and generate some XML that represents it. </summary>
        /// <param name="context"></param>
        protected override void DoWork(CodeActivityContext context)
        {
            string contextValue = ContextValue.Get(context) ?? String.Empty;
            int    orcSetId     = OrcSetId.Get(context);

            var order = BOM.Entities.Orders.GetEntityBySetIDAndVersion0(orcSetId, PM);

            var main = new XElement("Detail");

            main.Add(new XElement("PatId1", order.Pat_ID1.GetValueOrDefault(0)));

            if (!String.IsNullOrEmpty(contextValue))
            {
                main.Add(new XElement("ContextValue", contextValue));
            }

            var components = new XElement("Components");

            main.Add(components);

            //Observation Orders);
            if (order.OrderType == BOM.Entities.Orders.OrderTypes.Observation)
            {
                var procs = order.ObsReqEntitiesOnOrcSet.OrderBy(e => e.PRS_ID);
                foreach (ObsReq proc in procs)
                {
                    var procElement = new XElement("Procedure");
                    procElement.Add(new XAttribute("Prs_Id", proc.PRS_ID.GetValueOrDefault(-1)));
                    components.Add(procElement);
                }
            }
            //Pharmacy Order (post ATLAS orders)
            else if (order.OrderType == BOM.Entities.Orders.OrderTypes.InHouseTreat ||
                     order.OrderType == BOM.Entities.Orders.OrderTypes.InHousePickup ||
                     order.OrderType == BOM.Entities.Orders.OrderTypes.ExternalPickup)
            {
                var pharmOrds = order.PharmOrdEntitiesOnOrcSet
                                .OrderBy(e => e.Req_Give_Code)
                                .ThenBy(e => e.Ordering_Dose_Max)
                                .ThenBy(e => e.Ordering_Dose_Min)
                                .ThenBy(e => e.Req_Give_Units);

                foreach (PharmOrd pharmOrd in pharmOrds)
                {
                    var drugElement = new XElement("Drug");
                    drugElement.Add(new XAttribute("DrugId", pharmOrd.Req_Give_Code.GetValueOrDefault(-1)));
                    drugElement.Add(new XAttribute("Order_Dose_Max", pharmOrd.Ordering_Dose_Max.GetValueOrDefault(-1)));
                    drugElement.Add(new XAttribute("Order_Dose_Min", pharmOrd.Ordering_Dose_Min.GetValueOrDefault(-1)));
                    drugElement.Add(new XAttribute("Order_Dose_Units", pharmOrd.Ordering_Dose_Units_OBD_ID.GetValueOrDefault(-1)));
                    components.Add(drugElement);
                }
            }
            //Legacy Pharmacy orders
            else if (order.OrderType == BOM.Entities.Orders.OrderTypes.Pharmacy)
            {
                var pharmOrds = order.PharmOrdEntitiesOnOrcSet
                                .OrderBy(e => e.Req_Give_Code)
                                .ThenBy(e => e.Req_Give_Max)
                                .ThenBy(e => e.Req_Give_Min)
                                .ThenBy(e => e.Req_Give_Units);

                foreach (PharmOrd pharmOrd in pharmOrds)
                {
                    var drugElement = new XElement("Drug");
                    drugElement.Add(new XAttribute("DrugId", pharmOrd.Req_Give_Code.GetValueOrDefault(-1)));
                    drugElement.Add(new XAttribute("Req_Give_Max", pharmOrd.Req_Give_Max));
                    drugElement.Add(new XAttribute("Req_Give_Min", pharmOrd.Req_Give_Min.GetValueOrDefault(-1)));
                    drugElement.Add(new XAttribute("Req_Give_Units", pharmOrd.Req_Give_Units.GetValueOrDefault(-1)));
                    components.Add(drugElement);
                }
            }
            else
            {
                main.Add(new XElement("Orc_Set_Id", orcSetId));
            }

            Result.Set(context, main.ToString());
        }