Beispiel #1
0
        public GetPatientNoteDataResponse Get(GetPatientNoteDataRequest request)
        {
            GetPatientNoteDataResponse response = new GetPatientNoteDataResponse();

            try
            {
                RequireUserId(request);
                response.PatientNote = Manager.GetPatientNote(request);
                response.Version     = request.Version;
            }
            catch (Exception ex)
            {
                RaiseException(response, ex);
            }
            return(response);
        }
Beispiel #2
0
        public PatientNote GetPatientNote(GetPatientNoteRequest request)
        {
            try
            {
                PatientNote result = null;
                //[Route("/{Context}/{Version}/{ContractNumber}/Patient/{PatientId}/Note/{Id}", "GET")]
                IRestClient client = new JsonServiceClient();
                string      url    = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/Patient/{4}/Note/{5}",
                                                                          DDPatientNoteUrl,
                                                                          "NG",
                                                                          request.Version,
                                                                          request.ContractNumber,
                                                                          request.PatientId,
                                                                          request.Id), request.UserId);

                GetPatientNoteDataResponse ddResponse = client.Get <GetPatientNoteDataResponse>(url);

                if (ddResponse != null && ddResponse.PatientNote != null)
                {
                    PatientNoteData n = ddResponse.PatientNote;
                    result = new PatientNote
                    {
                        Id                = n.Id,
                        PatientId         = n.PatientId,
                        Text              = n.Text,
                        ProgramIds        = n.ProgramIds,
                        CreatedOn         = n.CreatedOn,
                        CreatedById       = n.CreatedById,
                        TypeId            = n.TypeId,
                        MethodId          = n.MethodId,
                        OutcomeId         = n.OutcomeId,
                        WhoId             = n.WhoId,
                        SourceId          = n.SourceId,
                        Duration          = n.Duration,
                        ValidatedIdentity = n.ValidatedIdentity,
                        ContactedOn       = n.ContactedOn,
                        UpdatedById       = n.UpdatedById,
                        UpdatedOn         = n.UpdatedOn,
                        DataSource        = n.DataSource
                    };
                }
                return(result);
            }
            catch (WebServiceException ex) { throw ex; }
        }