public async Task <Boolean> PrintPatient(string id)
        {
            var patient = await GetPatient(id);

            var observations = await _observation.GetPatientObservations(id);

            patient.Add(new JProperty("observations", observations));

            Process process = new Process()
            {
                StartInfo = new ProcessStartInfo()
                {
                    FileName               = "npm",
                    Arguments              = "start",
                    WorkingDirectory       = "/app/FHIRNode",
                    RedirectStandardInput  = true,
                    RedirectStandardOutput = true
                }
            };

            process.Start();
            process.StandardInput.WriteLine(patient.ToString());
            process.StandardInput.Close();

            System.Threading.Thread.Sleep(2000);
            string output = await process.StandardOutput.ReadToEndAsync();

            return(output.Contains("Finish generating"));
        }
Exemplo n.º 2
0
        //Gets observations and sorts by appointment date
        public async Task <JObject> searchObservations(string id)
        {
            List <JObject> observations = await _observationService.GetPatientObservations(id);

            JObject results = recursiveObservationSearch(observations, new JObject(), new Dictionary <string, int>());

            return(results);
        }
Exemplo n.º 3
0
 public async Task <List <JObject> > GetObservations(string id)
 {
     return(await _service.GetPatientObservations(id));
 }