Beispiel #1
0
        ///<summary>Saves the signature to the dictionary. The signature is hashed using the patient name, the date of service, and all ortho chart fields
        ///(even the ones not showing).</summary>
        private void SaveSignatureToDict(int gridRow)
        {
            if (!_showSigBox || gridRow < 0)
            {
                return;
            }
            DateTime orthoDate = GetOrthoDate(gridRow);

            if (!CanEditRow(orthoDate))
            {
                return;
            }
            if (!signatureBoxWrapper.GetSigChanged() || !signatureBoxWrapper.IsValid)
            {
                return;
            }
            string keyData;
            //Get the "translated" name for the signature column.
            string            sigColumnName = _listOrthDisplayFields.FirstOrDefault(x => x.InternalName == "Signature").Description;
            List <OrthoChart> listCharts    = _dictOrthoCharts[orthoDate].FindAll(x => x.DateService == orthoDate && x.FieldValue != "" && x.FieldName != sigColumnName);

            keyData = OrthoCharts.GetKeyDataForSignatureSaving(listCharts, orthoDate);
            OrthoSignature sig = new OrthoSignature();

            sig.IsTopaz   = signatureBoxWrapper.GetSigIsTopaz();
            sig.SigString = signatureBoxWrapper.GetSignature(keyData);
            if (sig.IsTopaz && !_topazNeedsSaved)
            {
                return;
            }
            if (OrthoSignature.GetSigString(GetValueFromDict(orthoDate, sigColumnName)) != sig.SigString)
            {
                _hasChanged = true;
                SetValueInDict(sig.ToString(), orthoDate, sigColumnName);
            }
        }