Example #1
0
 private ENCOUNTERS(PLACER_DETAIL placerDetail, PRE_TEST preTest, HIV_TESTS hivTests, NewReferral referral, List <NewTracing> tracing, NewLinkage linkage)
 {
     PLACER_DETAIL = placerDetail;
     PRE_TEST      = preTest;
     HIV_TESTS     = hivTests;
     REFERRAL      = referral;
     TRACING       = tracing;
     LINKAGE       = linkage;
 }
        private async Task <IndexClientMessage> CreatePretestEncounters(MESSAGE_HEADER header,
                                                                        PATIENT_IDENTIFICATION pid, ClientStage stagedClient, ClientPretestStage pretest,
                                                                        params LoadAction[] actions)
        {
            ENCOUNTERS encounter = null;

            //  PLACER_DETAIL
            var placerDetail = PLACER_DETAIL.Create(pretest.UserId, pretest.Id);

            //  PRE_TEST
            PRE_TEST preTest = null;

            if (actions.Contains(LoadAction.All) || actions.Contains(LoadAction.Pretest))
            {
                preTest = PRE_TEST.Create(pretest);
            }

            //  HIV_TESTS
            HIV_TESTS hivTests = null;

            if (actions.Contains(LoadAction.All) || actions.Contains(LoadAction.Testing))
            {
                var allfinalTests = await _clientFinalTestStageExtractor.Extract(stagedClient.ClientId);

                var alltests = await _clientTestingStageExtractor.Extract();

                var finalTest = allfinalTests.Where(x => x.PretestEncounterId == pretest.Id).ToList()
                                .LastOrDefault();

                var tests = alltests.Where(x => x.PretestEncounterId == pretest.Id).ToList();

                if (null != finalTest && tests.Any())
                {
                    hivTests = HIV_TESTS.Create(tests, finalTest);
                }
            }

            // GET THE LAST ONE


            encounter = ENCOUNTERS.Create(placerDetail, preTest, hivTests, null, new List <NewTracing>(), null);

            return(new IndexClientMessage(header,
                                          new List <NEWCLIENT> {
                NEWCLIENT.Create(pid, encounter)
            }, stagedClient.ClientId));
        }
Example #3
0
 private TestsMessage(MESSAGE_HEADER messageHeader, Guid clientId, List <INTERNAL_PATIENT_ID> patientIds, PLACER_DETAIL placerDetail, HIV_TESTS tests) : base(messageHeader, clientId)
 {
     INTERNAL_PATIENT_ID = patientIds;
     PLACER_DETAIL       = placerDetail;
     HIV_TESTS           = tests;
 }
Example #4
0
 public static ENCOUNTERS Create(PLACER_DETAIL placerDetail, PRE_TEST preTest, HIV_TESTS hivTests, NewReferral referral, List <NewTracing> tracing, NewLinkage linkage)
 {
     return(new ENCOUNTERS(placerDetail, preTest, hivTests, referral, tracing, linkage));
 }