Skip to content

Commit

Permalink
add timestamp to vitals
Browse files Browse the repository at this point in the history
  • Loading branch information
EspiraMarvin committed Jul 28, 2023
1 parent 7dee98a commit 26becb2
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 100 deletions.
13 changes: 7 additions & 6 deletions pkg/clinical/application/dto/observation_output.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package dto

// Observation is a minimal representation of a fhir Observation
type Observation struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
Status ObservationStatus `json:"status,omitempty"`
PatientID string `json:"patientID,omitempty"`
EncounterID string `json:"encounterID,omitempty"`
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
Status ObservationStatus `json:"status,omitempty"`
PatientID string `json:"patientID,omitempty"`
EncounterID string `json:"encounterID,omitempty"`
TimeRecorded string `json:"timeRecorded,omitempty"`
}

// ObservationEdge is an observation edge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,7 @@ func NewFHIRMock() *FHIRMock {
},
MockCreateFHIRObservationFn: func(ctx context.Context, input domain.FHIRObservationInput) (*domain.FHIRObservation, error) {
uuid := uuid.New().String()
instant := gofakeit.TimeZone()
finalStatus := domain.ObservationStatusEnumFinal
return &domain.FHIRObservation{
ID: new(string),
Expand Down Expand Up @@ -848,6 +849,7 @@ func NewFHIRMock() *FHIRMock {
EffectiveDateTime: &scalarutils.Date{},
EffectivePeriod: &domain.FHIRPeriod{},
EffectiveTiming: &domain.FHIRTiming{},
EffectiveInstant: (*scalarutils.Instant)(&instant),
Performer: []*domain.FHIRReference{},
ValueQuantity: &domain.FHIRQuantity{},
ValueCodeableConcept: (*scalarutils.Code)(&uuid),
Expand Down Expand Up @@ -1042,6 +1044,7 @@ func NewFHIRMock() *FHIRMock {
},
MockSearchPatientObservationsFn: func(ctx context.Context, patientReference, conceptID string, tenant dto.TenantIdentifiers, pagination dto.Pagination) (*domain.PagedFHIRObservations, error) {
uuid := uuid.New().String()
instant := gofakeit.TimeZone()
finalStatus := domain.ObservationStatusEnumFinal
return &domain.PagedFHIRObservations{
Observations: []domain.FHIRObservation{
Expand All @@ -1067,6 +1070,7 @@ func NewFHIRMock() *FHIRMock {
},
Text: "",
},
EffectiveInstant: (*scalarutils.Instant)(&instant),
},
},
HasNextPage: true,
Expand Down
102 changes: 96 additions & 6 deletions pkg/clinical/presentation/graph/generated/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/clinical/presentation/graph/types.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type Observation {
encounterID: String!
name: String!
value: String!
timeRecorded: String!
}

type Medication {
Expand Down

0 comments on commit 26becb2

Please sign in to comment.