示例#1
0
        /// <summary>
        /// Opens the observation orders selection browse in clarion
        /// </summary>
        /// <returns></returns>
        protected override IQOpResult <int> OpenEditor(int defaultValue, IQVarElementTarget target)
        {
            OnBeforeClarionEditorInvoke(this);

            int prsId;

            if (ShowSupplies)
            {
                prsId = CallClarion.CallCodeBro(string.Empty, true, true, 0);
            }
            else
            {
                prsId = CallClarion.CallActivityBro(string.Empty, string.Empty, true, false, false, true, string.Empty, string.Empty, false, true, true);
            }

            OnAfterClarionEditorInvoke(this);

            //If the user hit "close", don't update the primaryKeyValue
            return((prsId != 0)
                       ? new IQOpResult <int> {
                Result = OpResultEnum.Completed, Value = Cpt.GetEntityByID(prsId).PRS_ID
            }
                       : new IQOpResult <int> {
                Result = OpResultEnum.Cancelled
            });
        }
示例#2
0
        /// <summary>
        /// Finds the next day with clinic hours for the current department.  Searches 30 days into the future
        /// and then throws an InvalidOperationException.
        /// </summary>
        /// <param name="context"></param>
        protected override void DoWork(CodeActivityContext context)
        {
            ClarionDateTime cDate = null;
            bool            nextClinicDayFound = false;
            DateTime?       searchStartDate    = SearchStartDate.Get(context);

            //Determine whether to begin with a date provided or today's date.
            DateTime startDate = searchStartDate.HasValue
                ? searchStartDate.Value
                : DateTime.Today;

            for (int i = 0; i <= 60; i++)
            {
                cDate = startDate.AddDays(i);

                //Must be a clinic date and not a holiday.
                if (CallClarion.CallIsClinicDay(cDate.Date, Global.Inst_ID) &&
                    !CallClarion.CallIsHoliday(cDate.Date, Global.Inst_ID))
                {
                    nextClinicDayFound = true;
                    break;
                }
            }

            if (!nextClinicDayFound)
            {
                throw new InvalidOperationException(Strings.GetNextClinicDayActivity_NextClinicDayNotFound);
            }

            NextClinicDay.Set(context, cDate);
        }
        /// <summary>
        /// Opens the QCL Form.
        /// </summary>
        /// <param name="context"></param>
        protected override void DoWork(CodeActivityContext context)
        {
            //Get Values off the arguments
            ImpacPersistenceManager pm = ImpacPersistenceManagerFactory.CreatePersistenceManager();
            int    proId = ProId.Get(context);
            int    staffIdResponsible = StaffIdResponsible.Get(context);
            string comment            = Comment.Get(context);

            if (String.IsNullOrWhiteSpace(comment))
            {
                comment = String.Empty;
            }

            //Check if values exist in the database.
            var prompt = pm.GetEntity <Prompt>(new PrimaryKey(typeof(Prompt), proId));

            if (prompt.IsNullEntity)
            {
                throw new InvalidOperationException("Cannot find QCL Procedure (Prompt) record with Pro_Id: " + proId);
            }

            var staffResponsible = pm.GetEntity <Staff>(new PrimaryKey(typeof(Staff), staffIdResponsible));

            if (staffResponsible.IsNullEntity)
            {
                throw new InvalidOperationException("Cannot find Responsible (Staff) record with Staff_Id: " + staffIdResponsible);
            }

            int chkId = CallClarion.AddQclRecord(prompt.Text, comment, staffIdResponsible);

            ChkId.Set(context, chkId);
        }
        private void buttonEdit1_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            IQDataItemThresholdVarConfig.MinimizeIqEditor(this);
            int obdId = CallClarion.GetObsDefDataItem(0);

            IQDataItemThresholdVarConfig.RestoreIqEditor(this);
            if (obdId == 0)
            {
                return;
            }

            ObsDef obd = ObsDef.GetEntityById(obdId);

            PopulateChildControls(obd);
        }
        /// <summary>
        /// Opens the Topog browse
        /// </summary>
        /// <returns></returns>
        protected override IQOpResult <int> OpenEditor(int currentValue, IQVarElementTarget target)
        {
            OnBeforeClarionEditorInvoke(this);
            int diagCode = CallClarion.CallDiagnosisBro(String.Empty, true, true, currentValue);

            OnAfterClarionEditorInvoke(this);

            return((diagCode != 0)
                                           ? new IQOpResult <int> {
                Result = OpResultEnum.Completed, Value = diagCode
            }
                                           : new IQOpResult <int> {
                Result = OpResultEnum.Cancelled
            });
        }
示例#6
0
        /// <summary>
        /// Opens the data item browse
        /// </summary>
        /// <returns></returns>
        protected override IQOpResult <Guid> OpenEditor(Guid defaultValue, IQVarElementTarget target)
        {
            OnBeforeClarionEditorInvoke(this);
            int obdId = CallClarion.GetObsDefDataItem(0);

            OnAfterClarionEditorInvoke(this);

            //If the user hit "close", don't update the primaryKeyValue
            return((obdId != 0)
                       ? new IQOpResult <Guid> {
                Result = OpResultEnum.Completed, Value = ObsDef.GetEntityById(obdId).OBD_GUID
            }
                       : new IQOpResult <Guid> {
                Result = OpResultEnum.Cancelled
            });
        }
示例#7
0
        /// <summary> Opens the patient browse </summary>
        /// <returns></returns>
        protected override IQOpResult <int> OpenEditor(int defaultValue, IQVarElementTarget target)
        {
            OnBeforeClarionEditorInvoke(this);
            int patId1 = CallClarion.CallPatientBro(true, true, true);

            OnAfterClarionEditorInvoke(this);

            //If the user hit "close", don't update the primaryKeyValue
            return((patId1 != -1)
                       ? new IQOpResult <int> {
                Result = OpResultEnum.Completed, Value = patId1
            }
                       : new IQOpResult <int> {
                Result = OpResultEnum.Cancelled
            });
        }
示例#8
0
        /// <summary>
        /// Opens the location browse.
        /// </summary>
        /// <returns></returns>
        protected override IQOpResult <int> OpenEditor(int defaultValue, IQVarElementTarget target)
        {
            OnBeforeClarionEditorInvoke(this);
            int intVal = CallClarion.CallStaffLocBro();

            OnAfterClarionEditorInvoke(this);

            //If the user hit "close", don't update the primaryKeyValue
            return((intVal != 0)
                       ? new IQOpResult <int> {
                Result = OpResultEnum.Completed, Value = intVal
            }
                       : new IQOpResult <int> {
                Result = OpResultEnum.Cancelled
            });
        }
示例#9
0
        /// <summary> Opens the prompt browse for QCL Procedures. </summary>
        /// <returns></returns>
        protected override IQOpResult <int> OpenEditor(int defaultValue, IQVarElementTarget target)
        {
            OnBeforeClarionEditorInvoke(this);
            int proId = CallClarion.CallPromptBro("CHG1", true, 2, false, Strings.Group);

            OnAfterClarionEditorInvoke(this);

            //If the user hit "close", don't update the primaryKeyValue
            return((proId != 0)
                       ? new IQOpResult <int> {
                Result = OpResultEnum.Completed, Value = proId
            }
                       : new IQOpResult <int> {
                Result = OpResultEnum.Cancelled
            });
        }
示例#10
0
        /// <summary> Opens the prompt browse for document types. </summary>
        /// <returns></returns>
        protected override IQOpResult <int> OpenEditor(int defaultValue, IQVarElementTarget target)
        {
            OnBeforeClarionEditorInvoke(this);
            int docTypeId = CallClarion.CallPromptBro("ESC7", true, 2, false, Strings.DocumentType);

            OnAfterClarionEditorInvoke(this);
            var entity = Prompt.GetEntityByID(docTypeId);

            //If the user hit "close", don't update the primaryKeyValue)
            return((docTypeId != 0)
                                           ? new IQOpResult <int> {
                Result = OpResultEnum.Completed, Value = entity.Enum
            }
                                           : new IQOpResult <int> {
                Result = OpResultEnum.Cancelled
            });
        }
示例#11
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);
        }