Esempio n. 1
0
 public NotifyItem(HRStatus curr, int HR)
 {
     time        = DateTime.Now;
     heartStatus = curr;
     noteStat    = NoteStatus.None;
     this.HR     = HR;
 }
Esempio n. 2
0
 public Note(string id, string title, string description, NoteStatus status = NoteStatus.ToDo)
 {
     Id          = id;
     Title       = title;
     Description = description;
     Status      = status;
 }
Esempio n. 3
0
 public Note(int id, string title, string description, NoteStatus noteStatus)
 {
     Id          = id;
     Title       = title;
     Description = description;
     NoteStatus  = noteStatus;
 }
Esempio n. 4
0
    public async Task Edit_IsSuccessful(NoteStatus status)
    {
        var noteId = await _fixture.CreateDefaultNoteAsync(new NoteOptions { Status = status });

        var command = new EditNoteCommand(noteId, ".Net 7", ".Net 7 new feature #2", "");

        await _mediator.Send(command);

        var editedNote = await _noteQuery.GetNoteAsync(noteId);

        Assert.Equal(command.Title, editedNote.Title);
        Assert.Equal(command.Content, editedNote.Content);

        if (status == NoteStatus.Draft)
        {
            Assert.Equal(0, editedNote.Version);
        }
        else
        {
            Assert.Equal(2, editedNote.Version);

            var noteHistories = await _noteQuery.GetHistoriesAsync(noteId);

            Assert.Equal(2, noteHistories.Count());
        }
    }
Esempio n. 5
0
 public bool UpdateByNotePatch(NotePatch notePatch)
 {
     Title       = notePatch.Title;
     Description = notePatch.Description;
     NoteStatus  = notePatch.NoteStatus;
     return(true);
 }
Esempio n. 6
0
 public Note(Note note)
 {
     Id          = note.Id;
     Title       = note.Title;
     Description = note.Description;
     Status      = note.Status;
 }
    public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            TField field;
            await iprot.ReadStructBeginAsync(cancellationToken);

            while (true)
            {
                field = await iprot.ReadFieldBeginAsync(cancellationToken);

                if (field.Type == TType.Stop)
                {
                    break;
                }

                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.String)
                    {
                        SquareMid = await iprot.ReadStringAsync(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 2:
                    if (field.Type == TType.Struct)
                    {
                        Status = new NoteStatus();
                        await Status.ReadAsync(iprot, cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                default:
                    await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);

                    break;
                }

                await iprot.ReadFieldEndAsync(cancellationToken);
            }

            await iprot.ReadStructEndAsync(cancellationToken);
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
Esempio n. 8
0
    public Note CreateNote(string title, string content, NoteStatus status)
    {
        if (_isDeleted)
        {
            throw new SpaceHasBeenDeletedException();
        }

        return(Note.Initialize(Id, _creatorId, title, content, status));
    }
Esempio n. 9
0
 public NoteEditedEvent(Guid aggregateId, int aggregateVersion, Guid userId, string title, string content,
                        NoteStatus status, string comment) :
     base(aggregateId, aggregateVersion)
 {
     UserId  = userId;
     Title   = title;
     Content = content;
     Status  = status;
     Comment = comment;
 }
Esempio n. 10
0
 private void When(NoteCreatedEvent @event)
 {
     _spaceId     = @event.SpaceId;
     _creatorId   = @event.CreatorId;
     _title       = @event.Title;
     _content     = @event.Content;
     _status      = @event.Status;
     _visibility  = @event.Visibility;
     _cloneFormId = @event.CloneFormId;
     _tags        = new List <string>();
 }
Esempio n. 11
0
 public NoteCreatedEvent(Guid aggregateId, int aggregateVersion, Guid spaceId, Guid creatorId, string title,
                         string content, NoteStatus status, Visibility visibility, Guid?cloneFormId = null) : base(aggregateId,
                                                                                                                   aggregateVersion)
 {
     SpaceId     = spaceId;
     CreatorId   = creatorId;
     Title       = title;
     Content     = content;
     Status      = status;
     Visibility  = visibility;
     CloneFormId = cloneFormId;
 }
Esempio n. 12
0
    public void Read(TProtocol iprot)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            TField field;
            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.String)
                    {
                        SquareMid = iprot.ReadString();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.Struct)
                    {
                        Status = new NoteStatus();
                        Status.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
Esempio n. 13
0
 public NoteStatus Create(NoteStatus noteStatus)
 {
     try
     {
         _context.NoteStatutes.Add(noteStatus);
         return(noteStatus);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         return(noteStatus);
     }
 }
Esempio n. 14
0
 public virtual void GameInit()
 {
     _scene            = CurrentGame.Scene;
     Status            = NoteStatus.NotShown;
     FrameComputed     = false;
     NoteHit           = false;
     _computationDrawn = false;
     _prevTimeDiff     = 0;
     _t            = 0;
     _noteHandle   = 0;
     _lineHandle   = 0;
     _gpLineHandle = 0;
 }
Esempio n. 15
0
 public static NoteModel CreateModel(
     int authorId,
     string title,
     string description,
     NoteStatus noteStatus
     )
 {
     return(new NoteModel
     {
         AuthorId = authorId,
         Title = title,
         Description = description,
         NoteStatus = noteStatus
     });
 }
Esempio n. 16
0
 public bool IsCommited(int series)
 {
     foreach (XmlNode emrNote in GetEmrNotes())
     {
         int noteSeries = Convert.ToInt32(emrNote.Attributes[AttributeNames.Series].Value);
         if (noteSeries == series)
         {
             NoteStatus status =
                 (NoteStatus)(Convert.ToInt32(emrNote.Attributes[AttributeNames.NoteStatus].Value));
             return((status == NoteStatus.Commited) || (status == NoteStatus.Checked) ||
                    (status == NoteStatus.FinallyChecked));
         }
     }
     return(false);
 }
Esempio n. 17
0
        public virtual void ComputeSelf()
        {
            var timeDiff = Time - CurrentGame.Time;

            if (timeDiff < CurrentGame.ApproachTime)
            {
                Status = NoteStatus.Shown;

                if (CurrentGame.AutoPlay)
                {
                    if (timeDiff <= 0)
                    {
                        if (_prevTimeDiff > 0)
                        {
                            NoteHit               = true;
                            _hitTime              = CurrentGame.Time;
                            CurrentGame.SeToPlay |= HitsoundId;
                            _scene.SetButtonHit(TouchPosition);
                            _scene.AddNoteResult(Id, timeDiff);
                        }

                        if (timeDiff < -CurrentGame.NoteDelay)
                        {
                            Status = NoteStatus.Done;
                        }
                    }
                    else
                    {
                        NoteHit = false;
                    }
                }
                else if (!CurrentGame.ButtonHandled[TouchPosition])
                {
                    HandleButton(timeDiff);
                }

                _t = MathHelper.Clamp(1 - timeDiff / CurrentGame.ApproachTime, 0, 1);
            }
            else
            {
                _t     = 0;
                Status = NoteStatus.NotShown;
            }

            _prevTimeDiff     = timeDiff;
            FrameComputed     = true;
            _computationDrawn = false;
        }
Esempio n. 18
0
 public NoteMemento(Guid aggregateId, int aggregateVersion, Guid spaceId, Guid creatorId, string title,
                    string content, NoteStatus status, Visibility visibility, ICollection <string> tags,
                    Guid?cloneFormId, bool isDeleted)
 {
     AggregateId      = aggregateId;
     AggregateVersion = aggregateVersion;
     SpaceId          = spaceId;
     CreatorId        = creatorId;
     Title            = title;
     Content          = content;
     Status           = status;
     Visibility       = visibility;
     IsDeleted        = isDeleted;
     Tags             = tags;
     CloneFormId      = cloneFormId;
 }
Esempio n. 19
0
        public static bool UncommitEmrNote(string registryID, string noteID, int series,
                                           XmlNode reasion, NoteStatus status)
        {
            gjtEmrService.NoteStatus gjtStatus = (gjtEmrService.NoteStatus)status;
            using (gjtEmrService.emrServiceXml es = new gjtEmrService.emrServiceXml())
            {
                string msg = es.UncommitEmrNoteEx(registryID, Globals.DoctorID,
                                                  Globals.DepartID, noteID, series, reasion, gjtStatus);

                if (msg != null)
                {
                    MessageBox.Show(msg, ErrorMessage.Error);
                    return(Return.Failed);
                }
                return(Return.Successful);
            }
        }
Esempio n. 20
0
 public NoteStatus Update(int noteStatusId, NoteStatus noteStatus)
 {
     try
     {
         if (noteStatusId == noteStatus.Id)
         {
             var item = _context.NoteStatutes
                        .FirstOrDefault(e => e.Id == noteStatusId);
             if (item != null)
             {
                 _context.NoteStatutes.Update(noteStatus);
             }
         }
         return(noteStatus);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         return(noteStatus);
     }
 }
        public async Task <NoteModel> CreateModel(
            int authorId,
            string title,
            string description,
            NoteStatus status
            )
        {
            var model = NoteModel.CreateModel(
                authorId,
                title,
                description,
                status
                );

            var result = await CreateModelAsync(model);

            if (result == null)
            {
                throw new ErrorException(Error.Create("Note is not created", ErrorType.DbError));
            }

            return(await GetOne(model.Id));
        }
Esempio n. 22
0
    public async Task Create_IsSuccessful(NoteStatus status)
    {
        var spaceId = await _fixture.GetOrCreateDefaultSpaceAsync();

        var command = new CreateNoteCommand
        {
            SpaceId = spaceId,
            Title   = ".Net 6",
            Content = ".Net 6 new feature",
            Status  = status
        };

        var noteId = await _mediator.Send(command);

        var note = await _noteQuery.GetNoteAsync(noteId);

        Assert.Equal(command.SpaceId, note.SpaceId);
        Assert.Equal(command.Title, note.Title);
        Assert.Equal(command.Content, note.Content);
        Assert.Equal(command.Status, note.Status);

        if (status == NoteStatus.Draft)
        {
            Assert.Equal(0, note.Version);
            Assert.Equal(Visibility.Private, note.Visibility);
        }
        else
        {
            Assert.Equal(1, note.Version);
            Assert.Equal(Visibility.Public, note.Visibility);

            var noteHistories = await _noteQuery.GetHistoriesAsync(noteId);

            Assert.Single(noteHistories);
        }
    }
Esempio n. 23
0
 public void end()
 {
     if (_status != NoteStatus.Completed)
     {
         _endTime = DateTime.Now;
         _status = NoteStatus.Completed;
     }
 }
Esempio n. 24
0
 public Note(String msg, NoteStatus status)
 {
     _message = msg;
     _startTime = DateTime.Now;
     _status = status;
 }
Esempio n. 25
0
    public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            TField field;
            await iprot.ReadStructBeginAsync(cancellationToken);

            while (true)
            {
                field = await iprot.ReadFieldBeginAsync(cancellationToken);

                if (field.Type == TType.Stop)
                {
                    break;
                }

                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.List)
                    {
                        {
                            TList _list390 = await iprot.ReadListBeginAsync(cancellationToken);

                            Squares = new List <Square>(_list390.Count);
                            for (int _i391 = 0; _i391 < _list390.Count; ++_i391)
                            {
                                Square _elem392;
                                _elem392 = new Square();
                                await _elem392.ReadAsync(iprot, cancellationToken);

                                Squares.Add(_elem392);
                            }
                            await iprot.ReadListEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 2:
                    if (field.Type == TType.Map)
                    {
                        {
                            TMap _map393 = await iprot.ReadMapBeginAsync(cancellationToken);

                            SquareStatuses = new Dictionary <string, SquareStatus>(_map393.Count);
                            for (int _i394 = 0; _i394 < _map393.Count; ++_i394)
                            {
                                string       _key395;
                                SquareStatus _val396;
                                _key395 = await iprot.ReadStringAsync(cancellationToken);

                                _val396 = new SquareStatus();
                                await _val396.ReadAsync(iprot, cancellationToken);

                                SquareStatuses[_key395] = _val396;
                            }
                            await iprot.ReadMapEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 3:
                    if (field.Type == TType.Map)
                    {
                        {
                            TMap _map397 = await iprot.ReadMapBeginAsync(cancellationToken);

                            MyMemberships = new Dictionary <string, SquareMember>(_map397.Count);
                            for (int _i398 = 0; _i398 < _map397.Count; ++_i398)
                            {
                                string       _key399;
                                SquareMember _val400;
                                _key399 = await iprot.ReadStringAsync(cancellationToken);

                                _val400 = new SquareMember();
                                await _val400.ReadAsync(iprot, cancellationToken);

                                MyMemberships[_key399] = _val400;
                            }
                            await iprot.ReadMapEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 4:
                    if (field.Type == TType.String)
                    {
                        ContinuationToken = await iprot.ReadStringAsync(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 5:
                    if (field.Type == TType.Map)
                    {
                        {
                            TMap _map401 = await iprot.ReadMapBeginAsync(cancellationToken);

                            NoteStatuses = new Dictionary <string, NoteStatus>(_map401.Count);
                            for (int _i402 = 0; _i402 < _map401.Count; ++_i402)
                            {
                                string     _key403;
                                NoteStatus _val404;
                                _key403 = await iprot.ReadStringAsync(cancellationToken);

                                _val404 = new NoteStatus();
                                await _val404.ReadAsync(iprot, cancellationToken);

                                NoteStatuses[_key403] = _val404;
                            }
                            await iprot.ReadMapEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                default:
                    await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);

                    break;
                }

                await iprot.ReadFieldEndAsync(cancellationToken);
            }

            await iprot.ReadStructEndAsync(cancellationToken);
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
Esempio n. 26
0
 public NotePatch(string title, string description, NoteStatus noteStatus)
 {
     Title       = title;
     Description = description;
     NoteStatus  = noteStatus;
 }
Esempio n. 27
0
		/// --------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="T:CheckingStatus"/> struct.
		/// </summary>
		/// <param name="status">The status.</param>
		/// --------------------------------------------------------------------------------
		public CheckingStatus(NoteStatus status): this((int)status)
		{
		}
Esempio n. 28
0
        public NoteStatus Update([FromBody] NoteStatus noteStatus, int noteStatusId)
        {
            var data = _noteStatusRepository.Update(noteStatusId, noteStatus);

            return(data);
        }
Esempio n. 29
0
        public bool UpdateEmrNote(int series, NoteStatus noteStatus, ref NoteStatus noteStatusEnd, bool CommitFlag)
        {
            noteStatusEnd = noteStatus;
            /* Confirm the note exists. */
            XmlNode emrNote = GetEmrNoteBySeries(series);

            if (emrNote == null)
            {
                return(Return.Failed);
            }


            /* word window to word document */
            string tmpfile = Path.Combine(Globals.currentDirectory, ResourceName.Mytmp);

            //udt.jj.SaveWordDoc(ThisAddIn.Application.ActiveDocument, tmpfile, false);

            #region Update the emrDocument in dadabase
            /* Package the word document into a xml elelement. */
            XmlNode noteDoc = emrDoc.CreateElement(ElementNames.EmrNote);
            noteDoc.InnerText = udt.jj.WordDocumentToString(tmpfile);
            string registryID = emrDoc.DocumentElement.GetAttribute(AttributeNames.RegistryID);
            /* Update the dadabase. */
            if (!Globals.offline)
            {
                using (gjtEmrService.emrServiceXml es = new gjtEmrService.emrServiceXml())
                {
                    try
                    {
                        string strResult = es.IsEnabledCommit(registryID, series);

                        if (strResult == "0")
                        {
                            noteStatusEnd = NoteStatus.Draft;
                            if (CommitFlag == true)
                            {
                                MessageBox.Show("已经超时提交过的文档不能再次提交,请与质管部门联系!", ErrorMessage.Warning, MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk);
                            }
                        }
                        else
                        {
                            emrNote.Attributes["NoteStatus"].Value = (Convert.ToInt32(noteStatusEnd)).ToString();

                            if ((Convert.ToInt32(noteStatusEnd)).ToString() == "1" && ThisAddIn.CanOption(ElementNames.CommitTime))
                            {
                                if (emrNote.Attributes["fanxiu"] == null || emrNote.Attributes["fanxiu"].Value == "No")
                                {
                                    emrNote.Attributes[AttributeNames.WrittenDate].Value = ThisAddIn.Today().ToString();
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        Globals.logAdapter.Record("EX741852968", ex.Message + ">>" + ex.ToString(), true);
                    }
                }
                if (ThisAddIn.UpdateOneEmrNote(registryID, emrNote, noteDoc) ==
                    Return.Failed)
                {
                    return(Return.Failed);
                }
            }
            else
            {
                OpDone opDone = new OpDone("离线,寄存失败!");
                opDone.Show();
                return(Return.Failed);
            }
            #endregion

            #region Update the local storage

            string noteID    = emrNote.Attributes[AttributeNames.NoteID].Value;
            string wdDocName = udt.MakeWdDocumentFileName(registryID, noteID, series, Globals.workFolder);
            File.Copy(tmpfile, wdDocName, true);
            if (Globals.localDocumentEncode)
            {
                udt.jj.EncodeEmrDocument(wdDocName);
            }

            string LastWriteTime = ThisAddIn.Today().ToFileTime().ToString();
            emrNote.Attributes[AttributeNames.NoteStatus].Value    = noteStatus.ToString("d");
            emrNote.Attributes[AttributeNames.LastWriteTime].Value = LastWriteTime;
            emrDoc.DocumentElement.SetAttribute(AttributeNames.LastWriteTime, LastWriteTime);
            emrDoc.Save(emrDocFile);
            udt.jj.EncodeEmrDocument(emrDocFile);
            #endregion

            return(Return.Successful);
        }
Esempio n. 30
0
        public int AddEmrNote(XmlNode notePattern, XmlElement emrNote, NoteStatus status, bool sexOption, XmlNode wordXml)
        {
            int    series     = -1;
            string registryID = emrDoc.DocumentElement.GetAttribute(AttributeNames.RegistryID);
            string noteID     = notePattern.Attributes[AttributeNames.NoteID].Value;

            #region Set attributes for emr note
            string sequence = null;
            #region Treat attribute StartTime
            switch (notePattern.Attributes[AttributeNames.StartTime].Value)
            {
            case StartTime.Routine:
                if (Globals.offline)
                {
                    emrNote.SetAttribute(AttributeNames.Start, ThisAddIn.Today().ToString());
                }
                else
                {
                    emrNote.SetAttribute(AttributeNames.Start,
                                         ThisAddIn.LastDegreeOrderTime(registryID).ToString());
                }
                break;

            case StartTime.Operation:
                sequence = OperationSequence(registryID, noteID);
                if (sequence == null)
                {
                    return(series);
                }
                emrNote.SetAttribute(AttributeNames.Sequence, sequence);
                break;

            case StartTime.Rescued:
                sequence = RescueSequence(registryID, noteID);
                if (sequence == null)
                {
                    return(series);
                }
                emrNote.SetAttribute(AttributeNames.RescueSequence, sequence);
                break;

            case StartTime.TransferIn:
                sequence = TransferInSequence(registryID, noteID);
                if (sequence == null)
                {
                    return(series);
                }
                emrNote.SetAttribute(AttributeNames.TransferInSequence, sequence);
                break;

            case StartTime.TransferOut:
                sequence = TransferOutSequence(registryID, noteID);
                if (sequence == null)
                {
                    return(series);
                }
                emrNote.SetAttribute(AttributeNames.TransferOutSequence, sequence);
                break;

            case StartTime.TakeOver:
                sequence = TakeoverSequence(registryID, noteID);
                if (sequence == null)
                {
                    return(series);
                }
                emrNote.SetAttribute(AttributeNames.TakeOverSequence, sequence);
                break;

            case StartTime.Consult:
                sequence = ConsultSequence(registryID, noteID);
                if (sequence == null)
                {
                    //  MessageBox.Show("此次会诊记录已经书写完成!");
                    return(series);
                }
                emrNote.SetAttribute(AttributeNames.Sequence, sequence);
                break;
            }
            #endregion

            int sign = 0;
            //try
            //{
            //    foreach (Microsoft.Office.Interop.Word.XMLNode xn in ActiveDocumentManager.getDefaultAD().XMLNodes)
            //    {

            //        if (xn.BaseName == "电子病历")
            //        {
            //            for (int i = 1; i <= xn.ChildNodes.Count; i++)
            //            {

            //                if (xn.ChildNodes[i].Text == null) continue;
            //                if (xn.ChildNodes[i].BaseName == "医护签名")
            //                {
            //                    sign = xn.ChildNodes[i].ChildNodes.Count;
            //                    break;
            //                }
            //            }
            //        }
            //        else break;
            //    }
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message, "EmrDocument 的317行");
            //}

            emrNote.SetAttribute(AttributeNames.NoteID, noteID);
            emrNote.SetAttribute(AttributeNames.NoteName, notePattern.Attributes[AttributeNames.NoteName].Value);
            emrNote.SetAttribute(AttributeNames.Header, notePattern.Attributes[AttributeNames.Header].Value);
            emrNote.SetAttribute(AttributeNames.Unique, notePattern.Attributes[AttributeNames.Unique].Value);
            emrNote.SetAttribute(AttributeNames.NoteStatus, status.ToString("d"));
            emrNote.SetAttribute(AttributeNames.WriterID, Globals.DoctorID);
            emrNote.SetAttribute(AttributeNames.Writer, Globals.DoctorName);


            DateTime now = ThisAddIn.Today();
            /* because allow the operator to choose commit time */
            emrNote.SetAttribute(AttributeNames.CheckerID, "");
            emrNote.SetAttribute(AttributeNames.Checker, "");
            emrNote.SetAttribute(AttributeNames.CheckedDate, "");
            emrNote.SetAttribute(AttributeNames.FinalCheckerID, "");
            emrNote.SetAttribute(AttributeNames.FinalChecker, "");
            emrNote.SetAttribute(AttributeNames.FinalCheckedDate, "");
            emrNote.SetAttribute("sign", sign.ToString());
            /* 2007-07-11 add sign lables */
            if (notePattern.Attributes[AttributeNames.Sign1] != null)
            {
                emrNote.SetAttribute(AttributeNames.Sign1, notePattern.Attributes[AttributeNames.Sign1].Value);
            }
            if (notePattern.Attributes[AttributeNames.Sign2] != null)
            {
                emrNote.SetAttribute(AttributeNames.Sign2, notePattern.Attributes[AttributeNames.Sign2].Value);
            }
            if (notePattern.Attributes[AttributeNames.Sign3] != null)
            {
                emrNote.SetAttribute(AttributeNames.Sign3, notePattern.Attributes[AttributeNames.Sign3].Value);
            }

            emrNote.SetAttribute(AttributeNames.LastWriteTime, now.ToFileTime().ToString());
            /*  add merge property */
            emrNote.SetAttribute(AttributeNames.Merge, notePattern.Attributes[AttributeNames.Merge].Value);
            emrNote.SetAttribute(AttributeNames.StartTime, notePattern.Attributes[AttributeNames.StartTime].Value);
            /* add sex feature for it to be as a template */
            if (sexOption)
            {
                emrNote.SetAttribute(AttributeNames.Sex, StringGeneral.Yes);
            }
            else
            {
                emrNote.SetAttribute(AttributeNames.Sex, StringGeneral.No);
            }

            if (emrNote.Attributes[AttributeNames.SingleContinue] == null)
            {
                XmlAttribute newAttribute = emrNote.OwnerDocument.CreateAttribute(AttributeNames.SingleContinue);
                emrNote.Attributes.Append(newAttribute);
            }
            if (notePattern.Attributes[AttributeNames.SingleContinue] != null)
            {
                emrNote.SetAttribute(AttributeNames.SingleContinue, notePattern.Attributes[AttributeNames.SingleContinue].Value);
            }
            else
            {
                emrNote.SetAttribute(AttributeNames.SingleContinue, "no");
            }
            /*----------------------------------------------------------------------------*/

            /* Make a new series as unique id for the EmrNote. */
            #endregion

            /* word window to word document */
            //string tmpfile = Path.GetFullPath("病程记录.dotx");
            string tmpfile = Path.Combine(Globals.currentDirectory, ResourceName.Mytmp);
            //udt.jj.SaveWordDoc(ThisAddIn.Application.ActiveDocument, tmpfile, false);

            #region Save document into database
            if (!Globals.offline)
            {
                XmlElement noteDoc = emrDoc.CreateElement(ElementNames.EmrNote);
                noteDoc.InnerText = udt.jj.WordDocumentToString(tmpfile);
                emrNote.SetAttribute(AttributeNames.Series, "0");
                series = ThisAddIn.NewOneEmrNote(registryID, archiveNum, emrNote, noteDoc, wordXml);
                if (series < 0)
                {
                    return(series);
                }
            }
            else
            {
                series = Convert.ToInt32(emrDoc.DocumentElement.GetAttribute(AttributeNames.Series)) + 1;
                return(-100);
            }

            #endregion

            #region Save document into local storage
            string wdDocName = udt.MakeWdDocumentFileName(registryID, noteID, series, Globals.workFolder);
            File.Copy(tmpfile, wdDocName, true);
            if (Globals.localDocumentEncode)
            {
                udt.jj.EncodeEmrDocument(wdDocName);
            }

            emrNote.SetAttribute(AttributeNames.Series, series.ToString("d"));
            emrDoc.DocumentElement.AppendChild(emrNote);
            emrDoc.DocumentElement.SetAttribute(AttributeNames.LastWriteTime, now.ToFileTime().ToString());
            emrDoc.DocumentElement.SetAttribute(AttributeNames.Series, series.ToString("d"));
            emrDoc.Save(emrDocFile);
            udt.jj.EncodeEmrDocument(emrDocFile);
            #endregion

            return(series);
        }
Esempio n. 31
0
    public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            TField field;
            await iprot.ReadStructBeginAsync(cancellationToken);

            while (true)
            {
                field = await iprot.ReadFieldBeginAsync(cancellationToken);

                if (field.Type == TType.Stop)
                {
                    break;
                }

                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.Struct)
                    {
                        Square = new Square();
                        await Square.ReadAsync(iprot, cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 2:
                    if (field.Type == TType.Struct)
                    {
                        SquareAuthority = new SquareAuthority();
                        await SquareAuthority.ReadAsync(iprot, cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 3:
                    if (field.Type == TType.Struct)
                    {
                        SquareStatus = new SquareStatus();
                        await SquareStatus.ReadAsync(iprot, cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 4:
                    if (field.Type == TType.Struct)
                    {
                        SquareMember = new SquareMember();
                        await SquareMember.ReadAsync(iprot, cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 5:
                    if (field.Type == TType.Struct)
                    {
                        SquareFeatureSet = new SquareFeatureSet();
                        await SquareFeatureSet.ReadAsync(iprot, cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 6:
                    if (field.Type == TType.Struct)
                    {
                        NoteStatus = new NoteStatus();
                        await NoteStatus.ReadAsync(iprot, cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                default:
                    await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);

                    break;
                }

                await iprot.ReadFieldEndAsync(cancellationToken);
            }

            await iprot.ReadStructEndAsync(cancellationToken);
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
Esempio n. 32
0
 public CreateNote(string title, string description, NoteStatus noteStatus) : base(title, description, noteStatus)
 {
 }
Esempio n. 33
0
 public Note()
 {
     CreatedAt = DateTime.Now;
     Status    = NoteStatus.Todo;
 }