예제 #1
0
파일: ImportCID.cs 프로젝트: Workker/EHR
        public void ImportFromExcelFile(string path)
        {
            var excelRepository = new ExcelRepository();

            var data = excelRepository.GetAllDataFrom(path, "CID.xls", "CID10");

            var list = new List<CID>();

            foreach (DataRow row in data.Rows)
            {
                var cid = new CID();

                foreach (DataColumn column in data.Columns)
                {
                    switch (column.Caption)
                    {
                        case "CODIGO":
                            cid.Code = (string)row[column];
                            break;
                        case "DESCRICAO":
                            cid.Description = (string)row[column];
                            break;
                        case "DESCRABREV":
                            cid.AbbreviatedDescription = (string)row[column];
                            break;
                    }
                }

                list.Add(cid);
            }

            var cids = new CIDRepository();

            cids.SaveList(list);
        }
예제 #2
0
파일: Diagnostic.cs 프로젝트: Workker/EHR
        private void SetCid(CID cid)
        {
            Assertion.NotNull(cid, "Cid não informado.").Validate();

            Cid = cid;

            Assertion.Equals(Cid, cid, "Cid não foi atribuido corretamente.").Validate();
        }
예제 #3
0
파일: SummaryMap.cs 프로젝트: Workker/EHR
        private void AddDiagnostics(Legacy.Summary legacySummary, Summary newSummary)
        {
            var diagnosticTypesRepository = new Types<DiagnosticType>();

            foreach (var legacyDiagnostic in legacySummary.Diagnostics)
            {
                if (legacyDiagnostic != null && !String.IsNullOrWhiteSpace(legacyDiagnostic.Type))
                {
                    short diagnosticTypeId = Convert.ToInt16(legacyDiagnostic.Type);
                    DiagnosticType diagnosticType = diagnosticTypesRepository.Get(diagnosticTypeId);
                    CID cid = new CID { Code = legacyDiagnostic.Cid };

                    newSummary.CreateDiagnostic(diagnosticType, cid);
                }
            }
        }
예제 #4
0
 private void AddFields(CID cid, Document doc)
 {
     doc.Add(new Field("Id", cid.Id.ToString(CultureInfo.InvariantCulture), Field.Store.YES, Field.Index.ANALYZED));
     doc.Add(new Field("Description", cid.Description.ToLower(), Field.Store.YES, Field.Index.ANALYZED));
     doc.Add(new Field("Code", cid.Code.ToLower(), Field.Store.YES, Field.Index.ANALYZED));
 }
예제 #5
0
 public void UpdateIndex(CID cids)
 {
     UpdateIndex(new List<CID> { cids });
     Optimize();
 }
예제 #6
0
        private CID _mapLuceneDocumentToData(Document doc)
        {
            var cid = new CID
                          {
                              Id = short.Parse(doc.Get("Id")),
                              Description = doc.Get("Description"),
                              Code = doc.Get("Code"),
                          };

            return cid;
        }
예제 #7
0
 private void _addToLuceneIndex(CID cid, IndexWriter writer)
 {
     //Não precisa remover o tratamento, pois existem varios tratamentos com o id igual.
     // RemoveIndex(treatment, writer);
     var doc = new Document();
     AddFields(cid, doc);
     writer.AddDocument(doc);
 }
예제 #8
0
 private void RemoveIndex(CID cid, IndexWriter writer)
 {
     var searchQuery = new TermQuery(new Term("Id", cid.Id.ToString(CultureInfo.InvariantCulture)));
     writer.DeleteDocuments(searchQuery);
 }
예제 #9
0
파일: CidMapper.cs 프로젝트: Workker/EHR
 public static CidModel MapCidModelFrom(CID cid)
 {
     Mapper.CreateMap<CID, CidModel>();
     return Mapper.Map<CID, CidModel>(cid);
 }