コード例 #1
0
ファイル: Factory.cs プロジェクト: uon-coehm/IQMobile
        public List <Encounter> GenerateTestEncountersNoPatient()
        {
            GenerateTestModules();

            _encounters = new List <Encounter>();

            //EncounterType
            var encounterType = _modules.First().EncounterTypes.First();

            //Concepts
            var conceptNumeric = encounterType.Concepts.FirstOrDefault(x => x.DataTypeMapId == 3);
            var conceptLookup  = encounterType.Concepts.FirstOrDefault(x => x.DataTypeMapId == 5);

            //Observations
            var observationNumeric = EncounterData.GetTestObservationsNumeric();

            observationNumeric.MConceptId = conceptNumeric.Id;
            var observationLookup = EncounterData.GetTestObservationsLookup();

            observationLookup.MConceptId = conceptLookup.Id;

            //Encounter
            var encounter = EncounterData.GetTestEncounter();

            encounter.EncounterTypeId = encounterType.Id;
            encounter.AddObservation(observationNumeric);
            encounter.AddObservation(observationLookup);

            _encounters.Add(encounter);

            return(_encounters);
        }
コード例 #2
0
ファイル: Factory.cs プロジェクト: uon-coehm/IQMobile
        public List <Encounter> GenerateTestEncountersByType(int encounterTypeId)
        {
            _patients3 = new List <Patient>();
            var patient = GenerateTestHtcPatient();

            _patients3.Add(patient);


            _encounters2 = new List <Encounter>();

            //EncounterType
            var encounterType = _uow.EncounterTypeRepository.FindById(encounterTypeId);

            //Concepts

            /*
             *
             * 6. Seen As?(5)
             *  Individual (4030)
             *  Couple (4031)
             *  Group  (4032)
             * 30.If not tested,Why not (5)
             *  Changed mind (4124)
             *  Want to test later	(4125)
             * 24.Homosexual Partners last 12m (3)
             * 11.Marps (2)
             *  Prisoner (4051)
             *  Fisherperson(4048)
             * 15.Disability (2)
             *  N/A (No Disability) (4063)
             *  Blind (4065)
             *  Other	(4068)
             * 16.Specify other Disability (6)
             * 48.Remarks (7)
             *
             */

            var conceptLookup  = encounterType.Concepts.FirstOrDefault(x => x.Id == 30);
            var conceptLookup2 = encounterType.Concepts.FirstOrDefault(x => x.Id == 6);

            var conceptNumeric = encounterType.Concepts.FirstOrDefault(x => x.Id == 24);

            var conceptMulti  = encounterType.Concepts.FirstOrDefault(x => x.Id == 15);
            var conceptMulti2 = encounterType.Concepts.FirstOrDefault(x => x.Id == 11);

            var conceptText  = encounterType.Concepts.FirstOrDefault(x => x.Id == 16);
            var conceptText2 = encounterType.Concepts.FirstOrDefault(x => x.Id == 48);

            //Observations
            var observations = new List <Observation>();

            observations.Add(EncounterData.GetTestObservation(4124, conceptLookup));
            observations.Add(EncounterData.GetTestObservation(4030, conceptLookup2));

            observations.Add(EncounterData.GetTestObservation(4, conceptNumeric));

            observations.Add(EncounterData.GetTestObservation(new[] { 4063, 4065, 4068 }, conceptMulti));
            observations.Add(EncounterData.GetTestObservation(new[] { 4051, 4048 }, conceptMulti2));

            observations.Add(EncounterData.GetTestObservation("color blind", conceptText));
            observations.Add(EncounterData.GetTestObservation("No remark", conceptText2));

            //Encounter
            var encounter = EncounterData.GetTestEncounter();

            encounter.EncounterType   = encounterType;
            encounter.EncounterTypeId = encounterType.Id;
            encounter.Patient         = patient;
            encounter.AddObservations(observations);

            _uow.EncounterRepository.Save(encounter);
            _uow.Commit();

            _encounters2.Add(encounter);

            return(_encounters2);
        }