예제 #1
0
 public static DiagnosticReport GetDiagnosticReport(ResourceReference orderSubject, Practitioner practitioner1,
                                                    Observation observation1, Observation observation2, ResourceReference detail)
 {
     return(new DiagnosticReport
     {
         Id = Guid.NewGuid().ToString(),
         Name = new CodeableConcept(Systems.DIAGNOSTIC_REPORT_CODE, GetCodeBySystem(Systems.DIAGNOSTIC_ORDER_CODE)),
         Status = DiagnosticReport.DiagnosticReportStatus.Final,
         Issued = DateTime.Today.AddDays(-1).ToString(CultureInfo.CurrentCulture),
         Subject = orderSubject,
         Performer = FhirHelper.CreateBundleReference(practitioner1),
         RequestDetail = new List <ResourceReference> {
             detail
         },
         //RequestDetail = new List<ResourceReference> { new ResourceReference { Reference = "/DiagnosticOrder/41b2a8eb-2447-47d6-92a1-286995276841" } },
         Conclusion = "Заключение",
         PresentedForm = new List <Attachment>
         {
             new Attachment {
                 Hash = Encoding.UTF8.GetBytes("hash"), Data = LoadSignedData()
             }
         },
         Result = new List <ResourceReference>
         {
             FhirHelper.CreateBundleReference(observation1),
             FhirHelper.CreateBundleReference(observation2),
         }
     });
 }
예제 #2
0
        public static Order GetOrder(Patient patient, Practitioner orderPractitioner,
                                     Organization orderOrganization,
                                     Resource diagnosticOrder)
        {
            var order = new Order
            {
                Identifier = new List <Identifier>
                {
                    new Identifier(Systems.ORGANIZATIONS, GetCodeBySystem(Systems.ORGANIZATIONS))
                    {
                        Assigner = FhirHelper.CreateReference(orderOrganization)
                    },
                },
                Date = DateTime.Today.ToString(CultureInfo.CurrentCulture),
                When = new Order.OrderWhenComponent
                {
                    Code = new CodeableConcept
                    {
                        Coding = new List <Coding>
                        {
                            new Coding(Systems.PRIORIRY, GetCodeBySystem(Systems.PRIORIRY))
                        }
                    }
                },
                Subject = FhirHelper.CreateReference(patient),
                Source  = FhirHelper.CreateReference(orderPractitioner),
                Target  = FhirHelper.CreateReference(orderOrganization),
                Detail  = new List <ResourceReference> {
                    FhirHelper.CreateBundleReference(diagnosticOrder)
                },
            };

            return(order);
        }
예제 #3
0
 public static Observation GetObservation(Practitioner practitioner)
 {
     return(new Observation
     {
         Id = Guid.NewGuid().ToString(),
         Code = new CodeableConcept(Systems.OBSERVATION_LOINC, Guid.NewGuid().ToString()),
         Comments = "Комментарии",
         Issued = DateTime.Now,
         Status = Observation.ObservationStatus.Final,
         Method = new CodeableConcept(Systems.ORGANIZATIONS, GetCodeBySystem(Systems.ORGANIZATIONS)),
         Performer = new List <ResourceReference> {
             FhirHelper.CreateBundleReference(practitioner)
         },
         ReferenceRange = new List <Observation.ObservationReferenceRangeComponent>
         {
             new Observation.ObservationReferenceRangeComponent
             {
                 Low = new Quantity(),
                 High = new Quantity()
             }
         }
     });
 }
예제 #4
0
        public static DiagnosticOrder GetDiagnosticOrder(Patient patient, Practitioner diagnosticOrderPractitioner,
                                                         Encounter encounter,
                                                         Observation observation, Observation observation1,
                                                         Specimen specimen, Specimen specimen1)
        {
            var diagnosticOrder = new DiagnosticOrder
            {
                Id                    = Guid.NewGuid().ToString(),
                Subject               = FhirHelper.CreateReference(patient),
                Orderer               = FhirHelper.CreateReference(diagnosticOrderPractitioner),
                Encounter             = FhirHelper.CreateReference(encounter),
                SupportingInformation = new List <ResourceReference>
                {
                    FhirHelper.CreateBundleReference(observation),
                    FhirHelper.CreateBundleReference(observation1),
                },
                Specimen = new List <ResourceReference>
                {
                    FhirHelper.CreateBundleReference(specimen),
                    FhirHelper.CreateBundleReference(specimen1)
                },
                Status = DiagnosticOrder.DiagnosticOrderStatus.Requested,
                Item   = new List <DiagnosticOrder.DiagnosticOrderItemComponent>
                {
                    new DiagnosticOrder.DiagnosticOrderItemComponent
                    {
                        Code = new CodeableConcept
                        {
                            Text   = "Услуга 1",
                            Coding = new List <Coding>
                            {
                                new Coding(Systems.DIAGNOSTIC_ORDER_CODE, Systems.DIAGNOSTIC_ORDER_CODE),
                            },
                            Extension = new List <Extension>
                            {
                                new Extension(Systems.DIAGNOSTIC_ORDER_FINANCIAL_EXTENSION, new CodeableConcept(Systems.FINANCIAL, GetCodeBySystem(Systems.FINANCIAL))),
                                new Extension(Systems.DIAGNOSTIC_ORDER_INSURANCE_EXTENSION, new ResourceReference {
                                    Reference = Guid.NewGuid().ToString()
                                })
                            }
                        },
                    },
                    new DiagnosticOrder.DiagnosticOrderItemComponent
                    {
                        Code = new CodeableConcept
                        {
                            Text   = "Услуга 2",
                            Coding = new List <Coding>
                            {
                                new Coding(Systems.DIAGNOSTIC_ORDER_CODE, Guid.NewGuid().ToString()),
                            },
                            Extension = new List <Extension>
                            {
                                new Extension(Systems.DIAGNOSTIC_ORDER_FINANCIAL_EXTENSION, new CodeableConcept(Systems.FINANCIAL, GetCodeBySystem(Systems.FINANCIAL))),
                                new Extension(Systems.DIAGNOSTIC_ORDER_INSURANCE_EXTENSION, new ResourceReference {
                                    Reference = Guid.NewGuid().ToString()
                                })
                            }
                        },
                    }
                }
            };

            return(diagnosticOrder);
        }