Example #1
0
        static void Main()
        {
            DateTime              dt              = DateTime.Now;
            List <Patient>        patients        = ReadPatients("Files\\Patient.tsv");
            List <Member>         members         = ReadMembers("Files\\Member.tsv");
            List <PlaceOfService> placeOfServices = ReadPlaceOfService("Files\\PlaceOfService.tsv");
            List <Provider>       providers       = ReadProviders("Files\\Provider.tsv");
            //http://ec2-52-14-191-192.us-east-2.compute.amazonaws.com:1234/
            //https://arxiv.org/abs/1804.01486
            //This tab displays an interactive t-sne visualization of all 108,477 concepts.
            List <CuiVector> Cuis     = ReadCuiVector("Files\\cui2vec_pretrained.csv");
            DateTime         dt2      = DateTime.Now;
            TimeSpan         duration = dt2.Subtract(dt);

            Console.WriteLine("Seconds to load: " + duration.TotalSeconds);

            string cuiInput =
                @"{ ""entities"": [{ ""surface_form"": ""Vitrectomy"",""cui"": ""C0042903""}, { ""surface_form"": ""Scleral Buckling"", ""cui"": ""C0036411""}]}";
            //string cuiInput = @"{ ""entities"": [ { ""Vitrectomy"": ""C0042903""},{ ""Scleral Buckling"": ""C0036411""}]}";
            CuiEntities cuiEntities = CuiEntities.ReadToObject(cuiInput);

            foreach (var cuiEntitiesEntity in cuiEntities.entities)
            {
                string cui         = cuiEntitiesEntity.cui;
                string surfaceForm = cuiEntitiesEntity.surface_form;
            }
        }
Example #2
0
        /// <summary>
        /// { 'entities': [ {'Vitrectomy': 'C0042903'},{'Scleral Buckling': 'C0036411'}]
        /// </summary>
        // Deserialize a JSON stream to a User object.
        public static CuiEntities ReadToObject(string json)
        {
            CuiEntities  cuiEntities       = new CuiEntities();
            MemoryStream ms                = new MemoryStream(Encoding.UTF8.GetBytes(json));
            DataContractJsonSerializer ser = new DataContractJsonSerializer(cuiEntities.GetType());

            cuiEntities = ser.ReadObject(ms) as CuiEntities;
            ms.Close();
            return(cuiEntities);
        }