From f903c38b558c3c673357da86db22ccec9fe657f6 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Tue, 10 Jan 2023 19:23:47 -0800 Subject: [PATCH] adding support for Composition resource type (Custom grouping) (#20) --- .gitignore | 2 + backend/pkg/constants.go | 11 + backend/pkg/database/interface.go | 1 + backend/pkg/database/mock/mock_database.go | 257 +- backend/pkg/database/sqlite_repository.go | 215 +- .../pkg/database/sqlite_repository_test.go | 243 + backend/pkg/models/resource_composition.go | 19 + backend/pkg/models/resource_fhir.go | 4 +- backend/pkg/utils/sort.go | 60 + backend/pkg/utils/sort_test.go | 70 + backend/pkg/web/handler/auth.go | 9 +- backend/pkg/web/handler/resource_fhir.go | 72 +- backend/pkg/web/handler/source.go | 27 +- backend/pkg/web/handler/source_test.go | 130 + backend/pkg/web/handler/summary.go | 5 +- ..._545c2380-b77f-4919-ab5d-0f615f877250.json | 16198 ++++++++++++++++ backend/pkg/web/handler/unsafe.go | 23 +- backend/pkg/web/middleware/config.go | 3 +- backend/pkg/web/middleware/database.go | 3 +- backend/pkg/web/middleware/logger.go | 3 +- backend/pkg/web/middleware/require_auth.go | 7 +- backend/pkg/web/server.go | 3 +- frontend/src/app/app-routing.module.ts | 1 + .../report-labs-observation.component.ts | 4 + ...t-medical-history-condition.component.html | 67 +- ...ort-medical-history-condition.component.ts | 129 +- ...port-medical-history-editor.component.html | 46 +- ...report-medical-history-editor.component.ts | 124 +- frontend/src/app/components/shared.module.ts | 2 + .../src/app/models/fasten/resource_fhir.ts | 3 + .../medical-history.component.html | 2 +- .../medical-history.component.ts | 7 +- .../resource-detail.component.ts | 3 +- .../src/app/services/fasten-api.service.ts | 8 +- frontend/src/lib/models/constants.ts | 33 + frontend/src/lib/models/factory.ts | 262 +- .../fasten/fasten-display-model.spec.ts | 7 + .../lib/models/fasten/fasten-display-model.ts | 14 + .../lib/models/fasten/fasten-options.spec.ts | 7 + .../src/lib/models/fasten/fasten-options.ts | 2 + .../resources/adverse-event-model.spec.ts | 4 +- .../models/resources/adverse-event-model.ts | 26 +- .../allergy-intolerance-model.spec.ts | 28 +- .../resources/allergy-intolerance-model.ts | 26 +- .../lib/models/resources/appointment-model.ts | 39 +- .../models/resources/care-plan-model.spec.ts | 28 +- .../lib/models/resources/care-plan-model.ts | 52 +- .../models/resources/care-team-model.spec.ts | 4 +- .../lib/models/resources/care-team-model.ts | 25 +- .../resources/composition-model.spec.ts | 7 + .../lib/models/resources/composition-model.ts | 22 + .../models/resources/condition-model.spec.ts | 36 +- .../lib/models/resources/condition-model.ts | 51 +- .../src/lib/models/resources/device-model.ts | 59 +- .../resources/diagnostic-report-model.spec.ts | 6 +- .../resources/diagnostic-report-model.ts | 35 +- .../document-reference-model.spec.ts | 6 +- .../resources/document-reference-model.ts | 37 +- .../models/resources/encounter-model.spec.ts | 26 +- .../lib/models/resources/encounter-model.ts | 51 +- .../lib/models/resources/goal-model.spec.ts | 20 +- .../src/lib/models/resources/goal-model.ts | 44 +- .../resources/immunization-model.spec.ts | 16 +- .../models/resources/immunization-model.ts | 48 +- .../models/resources/location-model.spec.ts | 12 +- .../lib/models/resources/location-model.ts | 19 +- .../resources/medication-dispense-model.ts | 61 +- .../lib/models/resources/medication-model.ts | 83 +- .../medication-request-model.spec.ts | 7 + .../resources/medication-request-model.ts | 40 + .../lib/models/resources/observation-model.ts | 46 +- .../models/resources/organization-model.ts | 17 +- .../src/lib/models/resources/patient-model.ts | 60 +- .../models/resources/practitioner-model.ts | 21 +- .../resources/practitioner-role-model.ts | 12 +- .../lib/models/resources/procedure-model.ts | 56 +- .../models/resources/related-person-model.ts | 20 +- .../models/resources/research-study-model.ts | 52 +- go.mod | 4 +- go.sum | 4 +- 80 files changed, 18420 insertions(+), 876 deletions(-) create mode 100644 backend/pkg/models/resource_composition.go create mode 100644 backend/pkg/utils/sort.go create mode 100644 backend/pkg/utils/sort_test.go create mode 100644 backend/pkg/web/handler/source_test.go create mode 100644 backend/pkg/web/handler/testdata/Tania553_Harris789_545c2380-b77f-4919-ab5d-0f615f877250.json create mode 100644 frontend/src/lib/models/fasten/fasten-display-model.spec.ts create mode 100644 frontend/src/lib/models/fasten/fasten-display-model.ts create mode 100644 frontend/src/lib/models/fasten/fasten-options.spec.ts create mode 100644 frontend/src/lib/models/fasten/fasten-options.ts create mode 100644 frontend/src/lib/models/resources/composition-model.spec.ts create mode 100644 frontend/src/lib/models/resources/composition-model.ts create mode 100644 frontend/src/lib/models/resources/medication-request-model.spec.ts create mode 100644 frontend/src/lib/models/resources/medication-request-model.ts diff --git a/.gitignore b/.gitignore index 8ec096a1..c33db73a 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,5 @@ vendor fasten.db test.go /.couchdb + +config.dev.yaml diff --git a/backend/pkg/constants.go b/backend/pkg/constants.go index c1caffeb..ce565f2a 100644 --- a/backend/pkg/constants.go +++ b/backend/pkg/constants.go @@ -1 +1,12 @@ package pkg + +const ( + ContextKeyTypeConfig string = "CONFIG" + ContextKeyTypeDatabase string = "REPOSITORY" + ContextKeyTypeLogger string = "LOGGER" + + ContextKeyTypeAuthUsername string = "AUTH_USERNAME" + ContextKeyTypeAuthToken string = "AUTH_TOKEN" + + FhirResourceTypeComposition string = "Composition" +) diff --git a/backend/pkg/database/interface.go b/backend/pkg/database/interface.go index 281f298b..0eca35f0 100644 --- a/backend/pkg/database/interface.go +++ b/backend/pkg/database/interface.go @@ -25,6 +25,7 @@ type DatabaseRepository interface { AddResourceAssociation(ctx context.Context, source *models.SourceCredential, resourceType string, resourceId string, relatedSource *models.SourceCredential, relatedResourceType string, relatedResourceId string) error RemoveResourceAssociation(ctx context.Context, source *models.SourceCredential, resourceType string, resourceId string, relatedSource *models.SourceCredential, relatedResourceType string, relatedResourceId string) error GetFlattenedResourceGraph(ctx context.Context) ([]*models.ResourceFhir, []*models.ResourceFhir, error) + AddResourceComposition(ctx context.Context, compositionTitle string, resources []*models.ResourceFhir) error //UpsertProfile(context.Context, *models.Profile) error //UpsertOrganziation(context.Context, *models.Organization) error diff --git a/backend/pkg/database/mock/mock_database.go b/backend/pkg/database/mock/mock_database.go index b3b921fb..4bb43f08 100644 --- a/backend/pkg/database/mock/mock_database.go +++ b/backend/pkg/database/mock/mock_database.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// SourceCredential: interface.go +// Source: interface.go // Package mock_database is a generated GoMock package. package mock_database @@ -8,7 +8,8 @@ import ( context "context" reflect "reflect" - models "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/models" + models "github.com/fastenhealth/fasten-sources/clients/models" + models0 "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/models" gomock "github.com/golang/mock/gomock" ) @@ -35,6 +36,34 @@ func (m *MockDatabaseRepository) EXPECT() *MockDatabaseRepositoryMockRecorder { return m.recorder } +// AddResourceAssociation mocks base method. +func (m *MockDatabaseRepository) AddResourceAssociation(ctx context.Context, source *models0.SourceCredential, resourceType, resourceId string, relatedSource *models0.SourceCredential, relatedResourceType, relatedResourceId string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AddResourceAssociation", ctx, source, resourceType, resourceId, relatedSource, relatedResourceType, relatedResourceId) + ret0, _ := ret[0].(error) + return ret0 +} + +// AddResourceAssociation indicates an expected call of AddResourceAssociation. +func (mr *MockDatabaseRepositoryMockRecorder) AddResourceAssociation(ctx, source, resourceType, resourceId, relatedSource, relatedResourceType, relatedResourceId interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddResourceAssociation", reflect.TypeOf((*MockDatabaseRepository)(nil).AddResourceAssociation), ctx, source, resourceType, resourceId, relatedSource, relatedResourceType, relatedResourceId) +} + +// AddResourceComposition mocks base method. +func (m *MockDatabaseRepository) AddResourceComposition(ctx context.Context, compositionTitle string, resources []*models0.ResourceFhir) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AddResourceComposition", ctx, compositionTitle, resources) + ret0, _ := ret[0].(error) + return ret0 +} + +// AddResourceComposition indicates an expected call of AddResourceComposition. +func (mr *MockDatabaseRepositoryMockRecorder) AddResourceComposition(ctx, compositionTitle, resources interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddResourceComposition", reflect.TypeOf((*MockDatabaseRepository)(nil).AddResourceComposition), ctx, compositionTitle, resources) +} + // Close mocks base method. func (m *MockDatabaseRepository) Close() error { m.ctrl.T.Helper() @@ -49,8 +78,22 @@ func (mr *MockDatabaseRepositoryMockRecorder) Close() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockDatabaseRepository)(nil).Close)) } +// CreateSource mocks base method. +func (m *MockDatabaseRepository) CreateSource(arg0 context.Context, arg1 *models0.SourceCredential) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateSource", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateSource indicates an expected call of CreateSource. +func (mr *MockDatabaseRepositoryMockRecorder) CreateSource(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSource", reflect.TypeOf((*MockDatabaseRepository)(nil).CreateSource), arg0, arg1) +} + // CreateUser mocks base method. -func (m *MockDatabaseRepository) CreateUser(arg0 context.Context, arg1 *models.User) error { +func (m *MockDatabaseRepository) CreateUser(arg0 context.Context, arg1 *models0.User) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateUser", arg0, arg1) ret0, _ := ret[0].(error) @@ -62,3 +105,211 @@ func (mr *MockDatabaseRepositoryMockRecorder) CreateUser(arg0, arg1 interface{}) mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateUser", reflect.TypeOf((*MockDatabaseRepository)(nil).CreateUser), arg0, arg1) } + +// GetCurrentUser mocks base method. +func (m *MockDatabaseRepository) GetCurrentUser(arg0 context.Context) *models0.User { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCurrentUser", arg0) + ret0, _ := ret[0].(*models0.User) + return ret0 +} + +// GetCurrentUser indicates an expected call of GetCurrentUser. +func (mr *MockDatabaseRepositoryMockRecorder) GetCurrentUser(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentUser", reflect.TypeOf((*MockDatabaseRepository)(nil).GetCurrentUser), arg0) +} + +// GetFlattenedResourceGraph mocks base method. +func (m *MockDatabaseRepository) GetFlattenedResourceGraph(ctx context.Context) ([]*models0.ResourceFhir, []*models0.ResourceFhir, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetFlattenedResourceGraph", ctx) + ret0, _ := ret[0].([]*models0.ResourceFhir) + ret1, _ := ret[1].([]*models0.ResourceFhir) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// GetFlattenedResourceGraph indicates an expected call of GetFlattenedResourceGraph. +func (mr *MockDatabaseRepositoryMockRecorder) GetFlattenedResourceGraph(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFlattenedResourceGraph", reflect.TypeOf((*MockDatabaseRepository)(nil).GetFlattenedResourceGraph), ctx) +} + +// GetPatientForSources mocks base method. +func (m *MockDatabaseRepository) GetPatientForSources(ctx context.Context) ([]models0.ResourceFhir, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetPatientForSources", ctx) + ret0, _ := ret[0].([]models0.ResourceFhir) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetPatientForSources indicates an expected call of GetPatientForSources. +func (mr *MockDatabaseRepositoryMockRecorder) GetPatientForSources(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPatientForSources", reflect.TypeOf((*MockDatabaseRepository)(nil).GetPatientForSources), ctx) +} + +// GetResourceBySourceId mocks base method. +func (m *MockDatabaseRepository) GetResourceBySourceId(arg0 context.Context, arg1, arg2 string) (*models0.ResourceFhir, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetResourceBySourceId", arg0, arg1, arg2) + ret0, _ := ret[0].(*models0.ResourceFhir) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetResourceBySourceId indicates an expected call of GetResourceBySourceId. +func (mr *MockDatabaseRepositoryMockRecorder) GetResourceBySourceId(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetResourceBySourceId", reflect.TypeOf((*MockDatabaseRepository)(nil).GetResourceBySourceId), arg0, arg1, arg2) +} + +// GetResourceBySourceType mocks base method. +func (m *MockDatabaseRepository) GetResourceBySourceType(arg0 context.Context, arg1, arg2 string) (*models0.ResourceFhir, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetResourceBySourceType", arg0, arg1, arg2) + ret0, _ := ret[0].(*models0.ResourceFhir) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetResourceBySourceType indicates an expected call of GetResourceBySourceType. +func (mr *MockDatabaseRepositoryMockRecorder) GetResourceBySourceType(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetResourceBySourceType", reflect.TypeOf((*MockDatabaseRepository)(nil).GetResourceBySourceType), arg0, arg1, arg2) +} + +// GetSource mocks base method. +func (m *MockDatabaseRepository) GetSource(arg0 context.Context, arg1 string) (*models0.SourceCredential, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetSource", arg0, arg1) + ret0, _ := ret[0].(*models0.SourceCredential) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetSource indicates an expected call of GetSource. +func (mr *MockDatabaseRepositoryMockRecorder) GetSource(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSource", reflect.TypeOf((*MockDatabaseRepository)(nil).GetSource), arg0, arg1) +} + +// GetSourceSummary mocks base method. +func (m *MockDatabaseRepository) GetSourceSummary(arg0 context.Context, arg1 string) (*models0.SourceSummary, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetSourceSummary", arg0, arg1) + ret0, _ := ret[0].(*models0.SourceSummary) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetSourceSummary indicates an expected call of GetSourceSummary. +func (mr *MockDatabaseRepositoryMockRecorder) GetSourceSummary(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSourceSummary", reflect.TypeOf((*MockDatabaseRepository)(nil).GetSourceSummary), arg0, arg1) +} + +// GetSources mocks base method. +func (m *MockDatabaseRepository) GetSources(arg0 context.Context) ([]models0.SourceCredential, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetSources", arg0) + ret0, _ := ret[0].([]models0.SourceCredential) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetSources indicates an expected call of GetSources. +func (mr *MockDatabaseRepositoryMockRecorder) GetSources(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSources", reflect.TypeOf((*MockDatabaseRepository)(nil).GetSources), arg0) +} + +// GetSummary mocks base method. +func (m *MockDatabaseRepository) GetSummary(ctx context.Context) (*models0.Summary, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetSummary", ctx) + ret0, _ := ret[0].(*models0.Summary) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetSummary indicates an expected call of GetSummary. +func (mr *MockDatabaseRepositoryMockRecorder) GetSummary(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSummary", reflect.TypeOf((*MockDatabaseRepository)(nil).GetSummary), ctx) +} + +// GetUserByUsername mocks base method. +func (m *MockDatabaseRepository) GetUserByUsername(arg0 context.Context, arg1 string) (*models0.User, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetUserByUsername", arg0, arg1) + ret0, _ := ret[0].(*models0.User) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetUserByUsername indicates an expected call of GetUserByUsername. +func (mr *MockDatabaseRepositoryMockRecorder) GetUserByUsername(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUserByUsername", reflect.TypeOf((*MockDatabaseRepository)(nil).GetUserByUsername), arg0, arg1) +} + +// ListResources mocks base method. +func (m *MockDatabaseRepository) ListResources(arg0 context.Context, arg1 models0.ListResourceQueryOptions) ([]models0.ResourceFhir, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListResources", arg0, arg1) + ret0, _ := ret[0].([]models0.ResourceFhir) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListResources indicates an expected call of ListResources. +func (mr *MockDatabaseRepositoryMockRecorder) ListResources(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListResources", reflect.TypeOf((*MockDatabaseRepository)(nil).ListResources), arg0, arg1) +} + +// Migrate mocks base method. +func (m *MockDatabaseRepository) Migrate() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Migrate") + ret0, _ := ret[0].(error) + return ret0 +} + +// Migrate indicates an expected call of Migrate. +func (mr *MockDatabaseRepositoryMockRecorder) Migrate() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Migrate", reflect.TypeOf((*MockDatabaseRepository)(nil).Migrate)) +} + +// RemoveResourceAssociation mocks base method. +func (m *MockDatabaseRepository) RemoveResourceAssociation(ctx context.Context, source *models0.SourceCredential, resourceType, resourceId string, relatedSource *models0.SourceCredential, relatedResourceType, relatedResourceId string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RemoveResourceAssociation", ctx, source, resourceType, resourceId, relatedSource, relatedResourceType, relatedResourceId) + ret0, _ := ret[0].(error) + return ret0 +} + +// RemoveResourceAssociation indicates an expected call of RemoveResourceAssociation. +func (mr *MockDatabaseRepositoryMockRecorder) RemoveResourceAssociation(ctx, source, resourceType, resourceId, relatedSource, relatedResourceType, relatedResourceId interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveResourceAssociation", reflect.TypeOf((*MockDatabaseRepository)(nil).RemoveResourceAssociation), ctx, source, resourceType, resourceId, relatedSource, relatedResourceType, relatedResourceId) +} + +// UpsertRawResource mocks base method. +func (m *MockDatabaseRepository) UpsertRawResource(ctx context.Context, sourceCredentials models.SourceCredential, rawResource models.RawResourceFhir) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpsertRawResource", ctx, sourceCredentials, rawResource) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpsertRawResource indicates an expected call of UpsertRawResource. +func (mr *MockDatabaseRepositoryMockRecorder) UpsertRawResource(ctx, sourceCredentials, rawResource interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertRawResource", reflect.TypeOf((*MockDatabaseRepository)(nil).UpsertRawResource), ctx, sourceCredentials, rawResource) +} diff --git a/backend/pkg/database/sqlite_repository.go b/backend/pkg/database/sqlite_repository.go index 535c8332..9a781e24 100644 --- a/backend/pkg/database/sqlite_repository.go +++ b/backend/pkg/database/sqlite_repository.go @@ -6,8 +6,10 @@ import ( "fmt" "github.com/dominikbraun/graph" sourceModel "github.com/fastenhealth/fasten-sources/clients/models" + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/config" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/models" + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/utils" "github.com/gin-gonic/gin" "github.com/glebarez/sqlite" "github.com/google/uuid" @@ -121,10 +123,10 @@ func (sr *SqliteRepository) GetUserByUsername(ctx context.Context, username stri } func (sr *SqliteRepository) GetCurrentUser(ctx context.Context) *models.User { - username := ctx.Value("AUTH_USERNAME") + username := ctx.Value(pkg.ContextKeyTypeAuthUsername) if username == nil { ginCtx := ctx.(*gin.Context) - username = ginCtx.MustGet("AUTH_USERNAME") + username = ginCtx.MustGet(pkg.ContextKeyTypeAuthUsername) } var currentUser models.User @@ -134,7 +136,7 @@ func (sr *SqliteRepository) GetCurrentUser(ctx context.Context) *models.User { } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// User +// Summary //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// func (sr *SqliteRepository) GetSummary(ctx context.Context) (*models.Summary, error) { @@ -205,7 +207,7 @@ func (sr *SqliteRepository) UpsertRawResource(ctx context.Context, sourceCredent //create associations //note: we create the association in the related_resources table **before** the model actually exists. - if rawResource.ReferencedResources != nil { + if rawResource.ReferencedResources != nil && len(rawResource.ReferencedResources) > 0 { for _, referencedResource := range rawResource.ReferencedResources { parts := strings.Split(referencedResource, "/") if len(parts) != 2 { @@ -227,7 +229,17 @@ func (sr *SqliteRepository) UpsertRawResource(ctx context.Context, sourceCredent } } - sr.Logger.Infof("insert/update (%v) %v", rawResource.SourceResourceType, rawResource.SourceResourceID) + return sr.UpsertResource(ctx, wrappedResourceModel) + +} + +//this method will upsert a resource, however it will not create associations. +func (sr *SqliteRepository) UpsertResource(ctx context.Context, wrappedResourceModel *models.ResourceFhir) (bool, error) { + wrappedResourceModel.UserID = sr.GetCurrentUser(ctx).ID + wrappedResourceModel.RelatedResourceFhir = nil + cachedResourceRaw := wrappedResourceModel.ResourceRaw + + sr.Logger.Infof("insert/update (%v) %v", wrappedResourceModel.SourceResourceType, wrappedResourceModel.SourceResourceID) createResult := sr.GormClient.WithContext(ctx).Where(models.OriginBase{ SourceID: wrappedResourceModel.GetSourceID(), @@ -240,7 +252,7 @@ func (sr *SqliteRepository) UpsertRawResource(ctx context.Context, sourceCredent } else if createResult.RowsAffected == 0 { //at this point, wrappedResourceModel contains the data found in the database. // check if the database resource matches the new resource. - if wrappedResourceModel.ResourceRaw.String() != string(rawResource.ResourceRaw) { + if wrappedResourceModel.ResourceRaw.String() != string(cachedResourceRaw) { updateResult := createResult.Omit("RelatedResourceFhir.*").Updates(wrappedResourceModel) return updateResult.RowsAffected > 0, updateResult.Error } else { @@ -251,34 +263,6 @@ func (sr *SqliteRepository) UpsertRawResource(ctx context.Context, sourceCredent //resource was created return createResult.RowsAffected > 0, createResult.Error } - - //return results.RowsAffected > 0, results.Error - - //if sr.GormClient.Debug().WithContext(ctx). - // Where(models.OriginBase{ - // SourceID: wrappedResourceModel.GetSourceID(), - // SourceResourceID: wrappedResourceModel.GetSourceResourceID(), - // SourceResourceType: wrappedResourceModel.GetSourceResourceType(), //TODO: and UpdatedAt > old UpdatedAt - // }).Updates(wrappedResourceModel).RowsAffected == 0 { - // sr.Logger.Infof("resource does not exist, creating: %s %s %s", wrappedResourceModel.GetSourceID(), wrappedResourceModel.GetSourceResourceID(), wrappedResourceModel.GetSourceResourceType()) - // return sr.GormClient.Debug().Create(wrappedResourceModel).Error - //} - //return nil -} - -func (sr *SqliteRepository) UpsertResource(ctx context.Context, resourceModel *models.ResourceFhir) error { - sr.Logger.Infof("insert/update (%T) %v", resourceModel, resourceModel) - - if sr.GormClient.WithContext(ctx). - Where(models.OriginBase{ - SourceID: resourceModel.GetSourceID(), - SourceResourceID: resourceModel.GetSourceResourceID(), - SourceResourceType: resourceModel.GetSourceResourceType(), //TODO: and UpdatedAt > old UpdatedAt - }).Updates(resourceModel).RowsAffected == 0 { - sr.Logger.Infof("resource does not exist, creating: %s %s %s", resourceModel.GetSourceID(), resourceModel.GetSourceResourceID(), resourceModel.GetSourceResourceType()) - return sr.GormClient.Create(resourceModel).Error - } - return nil } func (sr *SqliteRepository) ListResources(ctx context.Context, queryOptions models.ListResourceQueryOptions) ([]models.ResourceFhir, error) { @@ -407,6 +391,7 @@ func (sr *SqliteRepository) GetFlattenedResourceGraph(ctx context.Context) ([]*m } //Generate Graph + // TODO optimization: eventually cache the graph in a database/storage, and update when new resources are added. g := graph.New(resourceVertexId, graph.Directed(), graph.Acyclic(), graph.Rooted()) //add vertices to the graph (must be done first) @@ -477,7 +462,7 @@ func (sr *SqliteRepository) GetFlattenedResourceGraph(ctx context.Context) ([]*m continue } - if strings.ToLower(resource.SourceResourceType) == "condition" { + if strings.ToLower(resource.SourceResourceType) == "condition" || strings.ToLower(resource.SourceResourceType) == strings.ToLower(pkg.FhirResourceTypeComposition) { conditionList = append(conditionList, resource) } else if strings.ToLower(resource.SourceResourceType) == "encounter" { encounterList = append(encounterList, resource) @@ -507,6 +492,10 @@ func (sr *SqliteRepository) GetFlattenedResourceGraph(ctx context.Context) ([]*m for ndx, _ := range encounterList { // this is a "root" encounter, which is not related to any condition, we should add it to the Unknown encounters list flattenRelatedResourcesFn(encounterList[ndx]) + + //sort all related resources (by date, desc) + encounterList[ndx].RelatedResourceFhir = utils.SortResourcePtrListByDate(encounterList[ndx].RelatedResourceFhir) + } // Step 4: find all encounters referenced by the root conditions, populate them, then add them to the condition as RelatedResourceFhir @@ -520,10 +509,13 @@ func (sr *SqliteRepository) GetFlattenedResourceGraph(ctx context.Context) ([]*m flattenRelatedResourcesFn(relatedResourceFhir) conditionList[ndx].RelatedResourceFhir = append(conditionList[ndx].RelatedResourceFhir, relatedResourceFhir) } + + //sort all related resources (by date, desc) + conditionList[ndx].RelatedResourceFhir = utils.SortResourcePtrListByDate(conditionList[ndx].RelatedResourceFhir) } - //TODO: sort conditionList by date - + conditionList = utils.SortResourcePtrListByDate(conditionList) + encounterList = utils.SortResourcePtrListByDate(encounterList) return conditionList, encounterList, nil } @@ -674,6 +666,155 @@ func (sr *SqliteRepository) RemoveResourceAssociation(ctx context.Context, sourc }).Error } +// AddResourceComposition +// this will group resources together into a "Composition" -- primarily to group related Encounters & Conditions into one semantic root. +// algorithm: +// - find source for each resource +// - (validate) ensure the current user and the source for each resource matches +// - check if there is a Composition resource Type already. +// - if Composition type already exists: +// - update "relatesTo" field with additional data. +// - else: +// - Create a Composition resource type (populated with "relatesTo" references to all provided Resources) +// - add AddResourceAssociation for all resources linked to the Composition resource +// - store the Composition resource +func (sr *SqliteRepository) AddResourceComposition(ctx context.Context, compositionTitle string, resources []*models.ResourceFhir) error { + currentUser := sr.GetCurrentUser(ctx) + + //generate placeholder source + placeholderSource := models.SourceCredential{UserID: currentUser.ID, SourceType: "manual", ModelBase: models.ModelBase{ID: uuid.MustParse("00000000-0000-0000-0000-000000000000")}} + + existingCompositionResources := []*models.ResourceFhir{} + rawResourceLookupTable := map[string]*models.ResourceFhir{} + + //find the source for each resource we'd like to merge. (for ownership verification) + sourceLookup := map[uuid.UUID]*models.SourceCredential{} + for _, resource := range resources { + if resource.SourceResourceType == pkg.FhirResourceTypeComposition { + //skip, Composition resources don't have a valid SourceCredential + existingCompositionResources = append(existingCompositionResources, resource) + + //compositions may include existing resources, make sure we handle these + for _, related := range resource.RelatedResourceFhir { + rawResourceLookupTable[fmt.Sprintf("%s/%s", related.SourceResourceType, related.SourceResourceID)] = related + } + continue + } + + if _, sourceOk := sourceLookup[resource.SourceID]; !sourceOk { + //source has not been added yet, lets query for it. + sourceCred, err := sr.GetSource(ctx, resource.SourceID.String()) + if err != nil { + return fmt.Errorf("could not find source %s", resource.SourceID.String()) + } + sourceLookup[resource.SourceID] = sourceCred + } + + rawResourceLookupTable[fmt.Sprintf("%s/%s", resource.SourceResourceType, resource.SourceResourceID)] = resource + } + + // (validate) ensure the current user and the source for each resource matches + for _, source := range sourceLookup { + if source.UserID != currentUser.ID { + return fmt.Errorf("source must be owned by the current user: %s vs %s", source.UserID, currentUser.ID) + } + } + + // - check if there is a Composition resource Type already. + var compositionResource *models.ResourceFhir + + if len(existingCompositionResources) > 0 { + //- if Composition type already exists in this set + // - update "relatesTo" field with additional data. + compositionResource = existingCompositionResources[0] + + //unassociated all existing composition resources. + for _, existingCompositionResource := range existingCompositionResources[1:] { + for _, relatedResource := range existingCompositionResource.RelatedResourceFhir { + if err := sr.RemoveResourceAssociation( + ctx, + &placeholderSource, + existingCompositionResource.SourceResourceType, + existingCompositionResource.SourceResourceID, + sourceLookup[relatedResource.SourceID], + relatedResource.SourceResourceType, + relatedResource.SourceResourceID, + ); err != nil { + //ignoring errors, could be due to duplicate edges + return fmt.Errorf("an error occurred while removing resource association: %v", err) + } + } + + //remove this resource + err := sr.GormClient.WithContext(ctx).Delete(existingCompositionResource) + if err.Error != nil { + return fmt.Errorf("an error occurred while removing resource: %v", err) + } + } + + } else { + //- else: + // - Create a Composition resource type (populated with "relatesTo" references to all provided Resources) + compositionResource = &models.ResourceFhir{ + OriginBase: models.OriginBase{ + UserID: placeholderSource.UserID, // + SourceID: placeholderSource.ID, //Empty SourceID expected ("0000-0000-0000-0000") + SourceResourceType: pkg.FhirResourceTypeComposition, + SourceResourceID: uuid.New().String(), + }, + SortDate: nil, //TOOD: figoure out the sortDate by looking for the earliest sort date for all nested resources + SortTitle: &compositionTitle, + RelatedResourceFhir: resources, + } + } + + // - Generate an "updated" RawResource json blob + rawCompositionResource := models.ResourceComposition{ + Title: compositionTitle, + RelatesTo: []models.ResourceCompositionRelatesTo{}, + } + + for relatedResourceKey, _ := range rawResourceLookupTable { + rawCompositionResource.RelatesTo = append(rawCompositionResource.RelatesTo, models.ResourceCompositionRelatesTo{ + Target: models.ResourceCompositionRelatesToTarget{ + TargetReference: models.ResourceCompositionRelatesToTargetReference{ + Reference: relatedResourceKey, + }, + }, + }) + } + + rawResourceJson, err := json.Marshal(rawCompositionResource) + if err != nil { + return err + } + compositionResource.ResourceRaw = rawResourceJson + + //store the Composition resource + _, err = sr.UpsertResource(ctx, compositionResource) + if err != nil { + return err + } + + // - add AddResourceAssociation for all resources linked to the Composition resource + for _, resource := range rawResourceLookupTable { + if err := sr.AddResourceAssociation( + ctx, + &placeholderSource, + compositionResource.SourceResourceType, + compositionResource.SourceResourceID, + sourceLookup[resource.SourceID], + resource.SourceResourceType, + resource.SourceResourceID, + ); err != nil { + //ignoring errors, could be due to duplicate edges + sr.Logger.Warnf("an error occurred while creating resource association: %v", err) + } + } + + return nil +} + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // SourceCredential //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/backend/pkg/database/sqlite_repository_test.go b/backend/pkg/database/sqlite_repository_test.go index 575b0bea..f2f7c07a 100644 --- a/backend/pkg/database/sqlite_repository_test.go +++ b/backend/pkg/database/sqlite_repository_test.go @@ -1,8 +1,21 @@ package database import ( + "fmt" sourceModels "github.com/fastenhealth/fasten-sources/clients/models" + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg" + mock_config "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/config/mock" + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/models" + "github.com/gin-gonic/gin" + "github.com/golang/mock/gomock" + "github.com/google/uuid" + "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + "golang.org/x/net/context" + "io/ioutil" + "log" + "os" "testing" ) @@ -15,3 +28,233 @@ func TestSourceCredentialInterface(t *testing.T) { require.Implements(t, (*sourceModels.DatabaseRepository)(nil), repo, "should implement the DatabaseRepository interface from fasten-sources") require.Implements(t, (*DatabaseRepository)(nil), repo, "should implement the DatabaseRepository interface") } + +// Define the suite, and absorb the built-in basic suite +// functionality from testify - including a T() method which +// returns the current testing context +type RepositoryTestSuite struct { + suite.Suite + MockCtrl *gomock.Controller + TestDatabase *os.File +} + +// BeforeTest has a function to be executed right before the test starts and receives the suite and test names as input +func (suite *RepositoryTestSuite) BeforeTest(suiteName, testName string) { + suite.MockCtrl = gomock.NewController(suite.T()) + + dbFile, err := ioutil.TempFile("", fmt.Sprintf("%s.*.db", testName)) + if err != nil { + log.Fatal(err) + } + suite.TestDatabase = dbFile + +} + +// AfterTest has a function to be executed right after the test finishes and receives the suite and test names as input +func (suite *RepositoryTestSuite) AfterTest(suiteName, testName string) { + suite.MockCtrl.Finish() + os.Remove(suite.TestDatabase.Name()) +} + +// In order for 'go test' to run this suite, we need to create +// a normal test function and pass our suite to suite.Run +func TestRepositoryTestSuite(t *testing.T) { + suite.Run(t, new(RepositoryTestSuite)) + +} + +func (suite *RepositoryTestSuite) TestNewRepository() { + //setup + fakeConfig := mock_config.NewMockInterface(suite.MockCtrl) + fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes() + fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes() + + //test + _, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name())) + + //assert + require.NoError(suite.T(), err) +} + +func (suite *RepositoryTestSuite) TestCreateUser() { + //setup + fakeConfig := mock_config.NewMockInterface(suite.MockCtrl) + fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes() + fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes() + dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name())) + require.NoError(suite.T(), err) + + //test + userModel := &models.User{ + Username: "test_username", + Password: "testpassword", + Email: "test@test.com", + } + dbRepo.CreateUser(context.Background(), userModel) + + //assert + require.NotEmpty(suite.T(), userModel.ID) +} + +func (suite *RepositoryTestSuite) TestCreateUser_WithExitingUser_ShouldFail() { + //setup + fakeConfig := mock_config.NewMockInterface(suite.MockCtrl) + fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes() + fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes() + dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name())) + require.NoError(suite.T(), err) + + //test + userModel := &models.User{ + Username: "test_username", + Password: "testpassword", + Email: "test@test.com", + } + err = dbRepo.CreateUser(context.Background(), userModel) + require.NoError(suite.T(), err) + + userModel2 := &models.User{ + Username: "test_username", + Password: "testpassword", + Email: "test@test.com", + } + err = dbRepo.CreateUser(context.Background(), userModel2) + //assert + require.Error(suite.T(), err) +} + +//TODO: ensure user's cannot specify the ID when creating a user. +func (suite *RepositoryTestSuite) TestCreateUser_WithUserProvidedId_ShouldBeReplaced() { + //setup + fakeConfig := mock_config.NewMockInterface(suite.MockCtrl) + fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes() + fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes() + dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name())) + require.NoError(suite.T(), err) + + //test + userProvidedId := uuid.New() + userModel := &models.User{ + ModelBase: models.ModelBase{ + ID: userProvidedId, + }, + Username: "test_username", + Password: "testpassword", + Email: "test@test.com", + } + dbRepo.CreateUser(context.Background(), userModel) + + //assert + require.NotEmpty(suite.T(), userModel.ID) + require.NotEqual(suite.T(), userProvidedId.String(), userModel.ID.String()) +} + +func (suite *RepositoryTestSuite) TestGetUserByUsername() { + //setup + fakeConfig := mock_config.NewMockInterface(suite.MockCtrl) + fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes() + fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes() + dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name())) + require.NoError(suite.T(), err) + userModel := &models.User{ + Username: "test_username", + Password: "testpassword", + Email: "test@test.com", + } + err = dbRepo.CreateUser(context.Background(), userModel) + require.NoError(suite.T(), err) + + //test + userModelResult, err := dbRepo.GetUserByUsername(context.Background(), "test_username") + + //assert + require.NoError(suite.T(), err) + require.Equal(suite.T(), userModel.ID, userModelResult.ID) +} + +func (suite *RepositoryTestSuite) TestGetUserByUsername_WithInvalidUsername() { + //setup + fakeConfig := mock_config.NewMockInterface(suite.MockCtrl) + fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes() + fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes() + dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name())) + require.NoError(suite.T(), err) + userModel := &models.User{ + Username: "test_username", + Password: "testpassword", + Email: "test@test.com", + } + err = dbRepo.CreateUser(context.Background(), userModel) + require.NoError(suite.T(), err) + + //test + _, err = dbRepo.GetUserByUsername(context.Background(), "userdoesntexist") + + //assert + require.Error(suite.T(), err) +} + +func (suite *RepositoryTestSuite) TestGetCurrentUser_WithContextBackgroundAuthUser() { + //setup + fakeConfig := mock_config.NewMockInterface(suite.MockCtrl) + fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes() + fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes() + dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name())) + require.NoError(suite.T(), err) + userModel := &models.User{ + Username: "test_username", + Password: "testpassword", + Email: "test@test.com", + } + err = dbRepo.CreateUser(context.Background(), userModel) + require.NoError(suite.T(), err) + + //test + userModelResult := dbRepo.GetCurrentUser(context.WithValue(context.Background(), pkg.ContextKeyTypeAuthUsername, "test_username")) + + //assert + require.NotNil(suite.T(), userModelResult) + require.Equal(suite.T(), userModelResult.Username, "test_username") +} + +func (suite *RepositoryTestSuite) TestGetCurrentUser_WithGinContextBackgroundAuthUser() { + //setup + fakeConfig := mock_config.NewMockInterface(suite.MockCtrl) + fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes() + fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes() + dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name())) + require.NoError(suite.T(), err) + userModel := &models.User{ + Username: "test_username", + Password: "testpassword", + Email: "test@test.com", + } + err = dbRepo.CreateUser(context.Background(), userModel) + require.NoError(suite.T(), err) + + //test + ginContext := gin.Context{} + ginContext.Set(pkg.ContextKeyTypeAuthUsername, "test_username") + userModelResult := dbRepo.GetCurrentUser(&ginContext) + + //assert + require.NotNil(suite.T(), userModelResult) + require.Equal(suite.T(), userModelResult.Username, "test_username") +} + +func (suite *RepositoryTestSuite) TestGetCurrentUser_WithContextBackgroundAuthUserAndNoUserExists_ShouldThrowError() { + //setup + fakeConfig := mock_config.NewMockInterface(suite.MockCtrl) + fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes() + fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes() + dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name())) + require.NoError(suite.T(), err) + + //test + userModelResult := dbRepo.GetCurrentUser(context.WithValue(context.Background(), pkg.ContextKeyTypeAuthUsername, "test_username")) + + //assert + require.Nil(suite.T(), userModelResult) +} + +//TODO - merging multiple Compositions is broken diff --git a/backend/pkg/models/resource_composition.go b/backend/pkg/models/resource_composition.go new file mode 100644 index 00000000..8f81291c --- /dev/null +++ b/backend/pkg/models/resource_composition.go @@ -0,0 +1,19 @@ +package models + +//this model is based on FHIR401 Resource Composition - https://github.com/fastenhealth/gofhir-models/blob/main/fhir401/composition.go +type ResourceComposition struct { + Title string `bson:"title" json:"title"` + RelatesTo []ResourceCompositionRelatesTo `bson:"relatesTo,omitempty" json:"relatesTo,omitempty"` +} + +type ResourceCompositionRelatesTo struct { + Target ResourceCompositionRelatesToTarget `bson:"target,omitempty" json:"target,omitempty"` +} + +type ResourceCompositionRelatesToTarget struct { + TargetReference ResourceCompositionRelatesToTargetReference `bson:"targetReference,omitempty" json:"targetReference,omitempty"` +} + +type ResourceCompositionRelatesToTargetReference struct { + Reference string `bson:"reference,omitempty" json:"reference,omitempty"` +} diff --git a/backend/pkg/models/resource_fhir.go b/backend/pkg/models/resource_fhir.go index fd45a9bc..7fef0e8d 100644 --- a/backend/pkg/models/resource_fhir.go +++ b/backend/pkg/models/resource_fhir.go @@ -8,8 +8,8 @@ import ( type ResourceFhir struct { OriginBase - SortDate time.Time `json:"sort_date" gorm:"sort_date"` - SortTitle string `json:"sort_title" gorm:"sort_title"` + SortDate *time.Time `json:"sort_date" gorm:"sort_date"` + SortTitle *string `json:"sort_title" gorm:"sort_title"` //embedded data ResourceRaw datatypes.JSON `json:"resource_raw" gorm:"resource_raw"` diff --git a/backend/pkg/utils/sort.go b/backend/pkg/utils/sort.go new file mode 100644 index 00000000..8d815447 --- /dev/null +++ b/backend/pkg/utils/sort.go @@ -0,0 +1,60 @@ +package utils + +import ( + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/models" + "sort" +) + +//default sort ASC (a, b, c, d, e...) +func SortResourcePtrListByTitle(resourceList []*models.ResourceFhir) []*models.ResourceFhir { + sort.SliceStable(resourceList, func(i, j int) bool { + if resourceList[i].SortTitle != nil && resourceList[j].SortTitle != nil { + return (*resourceList[i].SortTitle) < (*resourceList[j].SortTitle) + } else if resourceList[i].SortTitle != nil { + return true + } else { + return false + } + }) + return resourceList +} + +func SortResourceListByTitle(resourceList []models.ResourceFhir) []models.ResourceFhir { + sort.SliceStable(resourceList, func(i, j int) bool { + if resourceList[i].SortTitle != nil && resourceList[j].SortTitle != nil { + return (*resourceList[i].SortTitle) < (*resourceList[j].SortTitle) + } else if resourceList[i].SortTitle != nil { + return true + } else { + return false + } + }) + return resourceList +} + +//default sort DESC (today, yesterday, 2 days ago, 3 days ago...) +func SortResourcePtrListByDate(resourceList []*models.ResourceFhir) []*models.ResourceFhir { + sort.SliceStable(resourceList, func(i, j int) bool { + if resourceList[i].SortDate != nil && resourceList[j].SortDate != nil { + return (*resourceList[i].SortDate).After(*resourceList[j].SortDate) + } else if resourceList[i].SortDate != nil { + return true + } else { + return false + } + }) + return resourceList +} + +func SortResourceListByDate(resourceList []models.ResourceFhir) []models.ResourceFhir { + sort.SliceStable(resourceList, func(i, j int) bool { + if resourceList[i].SortDate != nil && resourceList[j].SortDate != nil { + return (*resourceList[i].SortDate).After(*resourceList[j].SortDate) + } else if resourceList[i].SortDate != nil { + return true + } else { + return false + } + }) + return resourceList +} diff --git a/backend/pkg/utils/sort_test.go b/backend/pkg/utils/sort_test.go new file mode 100644 index 00000000..77f38582 --- /dev/null +++ b/backend/pkg/utils/sort_test.go @@ -0,0 +1,70 @@ +package utils + +import ( + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/models" + "github.com/stretchr/testify/require" + "testing" + "time" +) + +func TestSortResourceListByTitle(t *testing.T) { + //setup + a := "a" + g := "g" + p := "p" + z := "z" + resources := []*models.ResourceFhir{ + { + SortTitle: &a, + }, + { + SortTitle: &g, + }, + { + SortTitle: &z, + }, + { + SortTitle: &p, + }, + } + + //test + resources = SortResourcePtrListByTitle(resources) + + //assert + require.Equal(t, "a", *resources[0].SortTitle) + require.Equal(t, "g", *resources[1].SortTitle) + require.Equal(t, "p", *resources[2].SortTitle) + require.Equal(t, "z", *resources[3].SortTitle) +} + +func TestSortResourceListByDate(t *testing.T) { + //setup + a := time.Now().Add(time.Hour * -24) + g := time.Now().Add(time.Hour * -48) + p := time.Now().Add(time.Hour * -72) + z := time.Now().Add(time.Hour * -100) + resources := []*models.ResourceFhir{ + { + SortDate: &a, + }, + { + SortDate: &g, + }, + { + SortDate: &z, + }, + { + SortDate: &p, + }, + } + + //test + resources = SortResourcePtrListByDate(resources) + + //assert + require.Equal(t, a, *resources[0].SortDate) + require.Equal(t, g, *resources[1].SortDate) + require.Equal(t, p, *resources[2].SortDate) + require.Equal(t, z, *resources[3].SortDate) +} diff --git a/backend/pkg/web/handler/auth.go b/backend/pkg/web/handler/auth.go index f47344bb..acbbc9ac 100644 --- a/backend/pkg/web/handler/auth.go +++ b/backend/pkg/web/handler/auth.go @@ -2,6 +2,7 @@ package handler import ( "fmt" + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/auth" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/config" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/database" @@ -11,8 +12,8 @@ import ( ) func AuthSignup(c *gin.Context) { - databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) - appConfig := c.MustGet("CONFIG").(config.Interface) + databaseRepo := c.MustGet(pkg.ContextKeyTypeDatabase).(database.DatabaseRepository) + appConfig := c.MustGet(pkg.ContextKeyTypeConfig).(config.Interface) var user models.User if err := c.ShouldBindJSON(&user); err != nil { @@ -32,8 +33,8 @@ func AuthSignup(c *gin.Context) { } func AuthSignin(c *gin.Context) { - databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) - appConfig := c.MustGet("CONFIG").(config.Interface) + databaseRepo := c.MustGet(pkg.ContextKeyTypeDatabase).(database.DatabaseRepository) + appConfig := c.MustGet(pkg.ContextKeyTypeConfig).(config.Interface) var user models.User if err := c.ShouldBindJSON(&user); err != nil { diff --git a/backend/pkg/web/handler/resource_fhir.go b/backend/pkg/web/handler/resource_fhir.go index 30a19e18..47227927 100644 --- a/backend/pkg/web/handler/resource_fhir.go +++ b/backend/pkg/web/handler/resource_fhir.go @@ -1,8 +1,10 @@ package handler import ( + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/database" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/models" + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/utils" "github.com/gin-gonic/gin" "github.com/sirupsen/logrus" "net/http" @@ -10,8 +12,8 @@ import ( ) func ListResourceFhir(c *gin.Context) { - logger := c.MustGet("LOGGER").(*logrus.Entry) - databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + logger := c.MustGet(pkg.ContextKeyTypeLogger).(*logrus.Entry) + databaseRepo := c.MustGet(pkg.ContextKeyTypeDatabase).(database.DatabaseRepository) listResourceQueryOptions := models.ListResourceQueryOptions{} if len(c.Query("sourceResourceType")) > 0 { @@ -29,6 +31,12 @@ func ListResourceFhir(c *gin.Context) { wrappedResourceModels, err := databaseRepo.ListResources(c, listResourceQueryOptions) + if c.Query("sortBy") == "title" { + wrappedResourceModels = utils.SortResourceListByTitle(wrappedResourceModels) + } else { + wrappedResourceModels = utils.SortResourceListByDate(wrappedResourceModels) + } + if err != nil { logger.Errorln("An error occurred while retrieving resources", err) c.JSON(http.StatusInternalServerError, gin.H{"success": false}) @@ -40,8 +48,8 @@ func ListResourceFhir(c *gin.Context) { //this endpoint retrieves a specific resource by its ID func GetResourceFhir(c *gin.Context) { - logger := c.MustGet("LOGGER").(*logrus.Entry) - databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + logger := c.MustGet(pkg.ContextKeyTypeLogger).(*logrus.Entry) + databaseRepo := c.MustGet(pkg.ContextKeyTypeDatabase).(database.DatabaseRepository) resourceId := strings.Trim(c.Param("resourceId"), "/") sourceId := strings.Trim(c.Param("sourceId"), "/") @@ -56,55 +64,27 @@ func GetResourceFhir(c *gin.Context) { c.JSON(http.StatusOK, gin.H{"success": true, "data": wrappedResourceModel}) } -func ReplaceResourceAssociation(c *gin.Context) { +func CreateResourceComposition(c *gin.Context) { - logger := c.MustGet("LOGGER").(*logrus.Entry) - databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + logger := c.MustGet(pkg.ContextKeyTypeLogger).(*logrus.Entry) + databaseRepo := c.MustGet(pkg.ContextKeyTypeDatabase).(database.DatabaseRepository) - resourceAssociation := models.ResourceAssociation{} - if err := c.ShouldBindJSON(&resourceAssociation); err != nil { - logger.Errorln("An error occurred while parsing posted resource association data", err) + type jsonPayload struct { + Resources []*models.ResourceFhir `json:"resources"` + Title string `json:"title"` + } + var payload jsonPayload + if err := c.ShouldBindJSON(&payload); err != nil { + logger.Errorln("An error occurred while parsing posted resources & title", err) c.JSON(http.StatusBadRequest, gin.H{"success": false}) return } - - sourceCred, err := databaseRepo.GetSource(c, resourceAssociation.SourceID) + err := databaseRepo.AddResourceComposition(c, payload.Title, payload.Resources) if err != nil { - logger.Errorln("An error occurred while retrieving source", err) + logger.Errorln("An error occurred while creating resource group (composition)", err) c.JSON(http.StatusInternalServerError, gin.H{"success": false}) return } - - if len(resourceAssociation.OldRelatedSourceID) > 0 { - oldRelatedSourceCred, err := databaseRepo.GetSource(c, resourceAssociation.OldRelatedSourceID) - if err != nil { - logger.Errorln("An error occurred while retrieving old related source", err) - c.JSON(http.StatusInternalServerError, gin.H{"success": false}) - return - } - - err = databaseRepo.RemoveResourceAssociation(c, sourceCred, resourceAssociation.SourceResourceType, resourceAssociation.SourceResourceID, oldRelatedSourceCred, resourceAssociation.OldRelatedSourceResourceType, resourceAssociation.OldRelatedSourceResourceID) - if err != nil { - logger.Errorln("An error occurred while deleting resource association", err) - c.JSON(http.StatusInternalServerError, gin.H{"success": false}) - return - } - } - - newRelatedSourceCred, err := databaseRepo.GetSource(c, resourceAssociation.NewRelatedSourceID) - if err != nil { - logger.Errorln("An error occurred while retrieving new related source", err) - c.JSON(http.StatusInternalServerError, gin.H{"success": false}) - return - } - - err = databaseRepo.AddResourceAssociation(c, sourceCred, resourceAssociation.SourceResourceType, resourceAssociation.SourceResourceID, newRelatedSourceCred, resourceAssociation.NewRelatedSourceResourceType, resourceAssociation.NewRelatedSourceResourceID) - if err != nil { - logger.Errorln("An error occurred while associating resource", err) - c.JSON(http.StatusInternalServerError, gin.H{"success": false}) - return - } - c.JSON(http.StatusOK, gin.H{"success": true}) } @@ -114,8 +94,8 @@ func ReplaceResourceAssociation(c *gin.Context) { // find the PredecessorMap // - filter to only vertices that are "Condition" or "Encounter" and are "root" nodes (have no edges directed to this node) func GetResourceFhirGraph(c *gin.Context) { - logger := c.MustGet("LOGGER").(*logrus.Entry) - databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + logger := c.MustGet(pkg.ContextKeyTypeLogger).(*logrus.Entry) + databaseRepo := c.MustGet(pkg.ContextKeyTypeDatabase).(database.DatabaseRepository) conditionResourceList, encounterResourceList, err := databaseRepo.GetFlattenedResourceGraph(c) if err != nil { diff --git a/backend/pkg/web/handler/source.go b/backend/pkg/web/handler/source.go index 4a650dc9..1257994e 100644 --- a/backend/pkg/web/handler/source.go +++ b/backend/pkg/web/handler/source.go @@ -6,6 +6,7 @@ import ( "github.com/fastenhealth/fasten-sources/clients/factory" sourceModels "github.com/fastenhealth/fasten-sources/clients/models" sourcePkg "github.com/fastenhealth/fasten-sources/pkg" + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/database" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/models" "github.com/gin-gonic/gin" @@ -15,8 +16,8 @@ import ( ) func CreateSource(c *gin.Context) { - logger := c.MustGet("LOGGER").(*logrus.Entry) - databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + logger := c.MustGet(pkg.ContextKeyTypeLogger).(*logrus.Entry) + databaseRepo := c.MustGet(pkg.ContextKeyTypeDatabase).(database.DatabaseRepository) sourceCred := models.SourceCredential{} if err := c.ShouldBindJSON(&sourceCred); err != nil { @@ -45,8 +46,8 @@ func CreateSource(c *gin.Context) { } func SourceSync(c *gin.Context) { - logger := c.MustGet("LOGGER").(*logrus.Entry) - databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + logger := c.MustGet(pkg.ContextKeyTypeLogger).(*logrus.Entry) + databaseRepo := c.MustGet(pkg.ContextKeyTypeDatabase).(database.DatabaseRepository) logger.Infof("Get SourceCredential Credentials: %v", c.Param("sourceId")) @@ -67,8 +68,8 @@ func SourceSync(c *gin.Context) { } func CreateManualSource(c *gin.Context) { - logger := c.MustGet("LOGGER").(*logrus.Entry) - databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + logger := c.MustGet(pkg.ContextKeyTypeLogger).(*logrus.Entry) + databaseRepo := c.MustGet(pkg.ContextKeyTypeDatabase).(database.DatabaseRepository) // single file file, err := c.FormFile("file") @@ -135,12 +136,12 @@ func CreateManualSource(c *gin.Context) { return } - c.JSON(http.StatusOK, gin.H{"success": true, "data": summary}) + c.JSON(http.StatusOK, gin.H{"success": true, "data": summary, "source": manualSourceCredential}) } func GetSource(c *gin.Context) { - logger := c.MustGet("LOGGER").(*logrus.Entry) - databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + logger := c.MustGet(pkg.ContextKeyTypeLogger).(*logrus.Entry) + databaseRepo := c.MustGet(pkg.ContextKeyTypeDatabase).(database.DatabaseRepository) sourceCred, err := databaseRepo.GetSource(c, c.Param("sourceId")) if err != nil { @@ -152,8 +153,8 @@ func GetSource(c *gin.Context) { } func GetSourceSummary(c *gin.Context) { - logger := c.MustGet("LOGGER").(*logrus.Entry) - databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + logger := c.MustGet(pkg.ContextKeyTypeLogger).(*logrus.Entry) + databaseRepo := c.MustGet(pkg.ContextKeyTypeDatabase).(database.DatabaseRepository) sourceSummary, err := databaseRepo.GetSourceSummary(c, c.Param("sourceId")) if err != nil { @@ -165,8 +166,8 @@ func GetSourceSummary(c *gin.Context) { } func ListSource(c *gin.Context) { - logger := c.MustGet("LOGGER").(*logrus.Entry) - databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + logger := c.MustGet(pkg.ContextKeyTypeLogger).(*logrus.Entry) + databaseRepo := c.MustGet(pkg.ContextKeyTypeDatabase).(database.DatabaseRepository) sourceCreds, err := databaseRepo.GetSources(c) if err != nil { diff --git a/backend/pkg/web/handler/source_test.go b/backend/pkg/web/handler/source_test.go new file mode 100644 index 00000000..b287168f --- /dev/null +++ b/backend/pkg/web/handler/source_test.go @@ -0,0 +1,130 @@ +package handler + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg" + mock_config "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/config/mock" + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/database" + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/models" + "github.com/gin-gonic/gin" + "github.com/golang/mock/gomock" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + "io" + "io/ioutil" + "log" + "mime/multipart" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "testing" +) + +// Define the suite, and absorb the built-in basic suite +// functionality from testify - including a T() method which +// returns the current testing context +type SourceHandlerTestSuite struct { + suite.Suite + MockCtrl *gomock.Controller + TestDatabase *os.File + + AppConfig *mock_config.MockInterface + AppRepository database.DatabaseRepository +} + +// BeforeTest has a function to be executed right before the test starts and receives the suite and test names as input +func (suite *SourceHandlerTestSuite) BeforeTest(suiteName, testName string) { + suite.MockCtrl = gomock.NewController(suite.T()) + + dbFile, err := ioutil.TempFile("", fmt.Sprintf("%s.*.db", testName)) + if err != nil { + log.Fatal(err) + } + suite.TestDatabase = dbFile + + appConfig := mock_config.NewMockInterface(suite.MockCtrl) + appConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes() + appConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes() + suite.AppConfig = appConfig + + appRepo, err := database.NewRepository(suite.AppConfig, logrus.WithField("test", suite.T().Name())) + suite.AppRepository = appRepo + + appRepo.CreateUser(context.Background(), &models.User{ + Username: "test_username", + Password: "test", + }) + +} + +// AfterTest has a function to be executed right after the test finishes and receives the suite and test names as input +func (suite *SourceHandlerTestSuite) AfterTest(suiteName, testName string) { + suite.MockCtrl.Finish() + os.Remove(suite.TestDatabase.Name()) +} + +// In order for 'go test' to run this suite, we need to create +// a normal test function and pass our suite to suite.Run +func TestSourceHandlerTestSuite(t *testing.T) { + suite.Run(t, new(SourceHandlerTestSuite)) +} + +func (suite *SourceHandlerTestSuite) TestCreateManualSourceHandler() { + //setup + w := httptest.NewRecorder() + ctx, _ := gin.CreateTestContext(w) + ctx.Set(pkg.ContextKeyTypeLogger, logrus.WithField("test", suite.T().Name())) + ctx.Set(pkg.ContextKeyTypeDatabase, suite.AppRepository) + ctx.Set(pkg.ContextKeyTypeConfig, suite.AppConfig) + ctx.Set(pkg.ContextKeyTypeAuthUsername, "test_username") + + //test + file, err := os.Open("testdata/Tania553_Harris789_545c2380-b77f-4919-ab5d-0f615f877250.json") + require.NoError(suite.T(), err) + defer file.Close() + + body := &bytes.Buffer{} + writer := multipart.NewWriter(body) + part, _ := writer.CreateFormFile("file", filepath.Base(file.Name())) + io.Copy(part, file) + writer.Close() + + req, err := http.NewRequest("POST", "/source/manual", body) + require.NoError(suite.T(), err) + req.Header.Add("Content-Type", writer.FormDataContentType()) + ctx.Request = req + + CreateManualSource(ctx) + + //assert + require.Equal(suite.T(), http.StatusOK, w.Code) + + type ResponseWrapper struct { + Data struct { + UpdatedResources []string `json:"UpdatedResources"` + TotalResources int `json:"TotalResources"` + } `json:"data"` + Success bool `json:"success"` + Source models.SourceCredential `json:"source"` + } + var respWrapper ResponseWrapper + err = json.Unmarshal(w.Body.Bytes(), &respWrapper) + require.NoError(suite.T(), err) + + require.Equal(suite.T(), true, respWrapper.Success) + require.Equal(suite.T(), "manual", string(respWrapper.Source.SourceType)) + require.Equal(suite.T(), 196, respWrapper.Data.TotalResources) + summary, err := suite.AppRepository.GetSourceSummary(ctx, respWrapper.Source.ID.String()) + require.NoError(suite.T(), err) + require.Equal(suite.T(), map[string]interface{}{ + "count": int64(5), + "resource_type": "Condition", + "source_id": respWrapper.Source.ID.String(), + }, summary.ResourceTypeCounts[3]) + +} diff --git a/backend/pkg/web/handler/summary.go b/backend/pkg/web/handler/summary.go index 182b5edc..cd228d51 100644 --- a/backend/pkg/web/handler/summary.go +++ b/backend/pkg/web/handler/summary.go @@ -1,6 +1,7 @@ package handler import ( + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/database" "github.com/gin-gonic/gin" "github.com/sirupsen/logrus" @@ -8,8 +9,8 @@ import ( ) func GetSummary(c *gin.Context) { - logger := c.MustGet("LOGGER").(*logrus.Entry) - databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + logger := c.MustGet(pkg.ContextKeyTypeLogger).(*logrus.Entry) + databaseRepo := c.MustGet(pkg.ContextKeyTypeDatabase).(database.DatabaseRepository) summary, err := databaseRepo.GetSummary(c) if err != nil { diff --git a/backend/pkg/web/handler/testdata/Tania553_Harris789_545c2380-b77f-4919-ab5d-0f615f877250.json b/backend/pkg/web/handler/testdata/Tania553_Harris789_545c2380-b77f-4919-ab5d-0f615f877250.json new file mode 100644 index 00000000..4a115c9c --- /dev/null +++ b/backend/pkg/web/handler/testdata/Tania553_Harris789_545c2380-b77f-4919-ab5d-0f615f877250.json @@ -0,0 +1,16198 @@ +{ + "resourceType": "Bundle", + "type": "transaction", + "entry": [ + { + "fullUrl": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "resource": { + "resourceType": "Patient", + "id": "57959813-8cd2-4e3c-8970-e4364b74980a", + "text": { + "status": "generated", + "div": "
Generated by Synthea.Version identifier: v2.4.0-404-ge7ce2295\n . Person seed: -6016242411370302863 Population seed: 0
" + }, + "extension": [ + { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race", + "extension": [ + { + "url": "ombCategory", + "valueCoding": { + "system": "urn:oid:2.16.840.1.113883.6.238", + "code": "2106-3", + "display": "White" + } + }, + { + "url": "text", + "valueString": "White" + } + ] + }, + { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity", + "extension": [ + { + "url": "ombCategory", + "valueCoding": { + "system": "urn:oid:2.16.840.1.113883.6.238", + "code": "2186-5", + "display": "Not Hispanic or Latino" + } + }, + { + "url": "text", + "valueString": "Not Hispanic or Latino" + } + ] + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName", + "valueString": "Patrick786 Robel940" + }, + { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex", + "valueCode": "F" + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/patient-birthPlace", + "valueAddress": { + "city": "Lowell", + "state": "Massachusetts", + "country": "US" + } + }, + { + "url": "http://synthetichealth.github.io/synthea/disability-adjusted-life-years", + "valueDecimal": 0.012998260499375002 + }, + { + "url": "http://synthetichealth.github.io/synthea/quality-adjusted-life-years", + "valueDecimal": 18.987001739500624 + } + ], + "identifier": [ + { + "system": "https://github.com/synthetichealth/synthea", + "value": "545c2380-b77f-4919-ab5d-0f615f877250" + }, + { + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0203", + "code": "MR", + "display": "Medical Record Number" + } + ], + "text": "Medical Record Number" + }, + "system": "http://hospital.smarthealthit.org", + "value": "545c2380-b77f-4919-ab5d-0f615f877250" + }, + { + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0203", + "code": "SS", + "display": "Social Security Number" + } + ], + "text": "Social Security Number" + }, + "system": "http://hl7.org/fhir/sid/us-ssn", + "value": "999-80-3174" + }, + { + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0203", + "code": "DL", + "display": "Driver's License" + } + ], + "text": "Driver's License" + }, + "system": "urn:oid:2.16.840.1.113883.4.3.25", + "value": "S99972064" + }, + { + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0203", + "code": "PPN", + "display": "Passport Number" + } + ], + "text": "Passport Number" + }, + "system": "http://standardhealthrecord.org/fhir/StructureDefinition/passportNumber", + "value": "X49558432X" + } + ], + "name": [ + { + "use": "official", + "family": "Harris789", + "given": [ + "Tania553" + ], + "prefix": [ + "Ms." + ] + } + ], + "telecom": [ + { + "system": "phone", + "value": "555-750-4688", + "use": "home" + } + ], + "gender": "female", + "birthDate": "1999-06-12", + "address": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/geolocation", + "extension": [ + { + "url": "latitude", + "valueDecimal": 42.83903673280652 + }, + { + "url": "longitude", + "valueDecimal": -71.07942713642242 + } + ] + } + ], + "line": [ + "584 Kuhlman Underpass" + ], + "city": "Haverhill", + "state": "Massachusetts", + "postalCode": "01830", + "country": "US" + } + ], + "maritalStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus", + "code": "S", + "display": "Never Married" + } + ], + "text": "Never Married" + }, + "multipleBirthBoolean": false, + "communication": [ + { + "language": { + "coding": [ + { + "system": "urn:ietf:bcp:47", + "code": "en-US", + "display": "English" + } + ], + "text": "English" + } + } + ] + }, + "request": { + "method": "POST", + "url": "Patient" + } + }, + { + "fullUrl": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "resource": { + "resourceType": "Organization", + "id": "783421ae-905a-3082-ae86-cb958fffaa7c", + "identifier": [ + { + "system": "https://github.com/synthetichealth/synthea", + "value": "783421ae-905a-3082-ae86-cb958fffaa7c" + } + ], + "active": true, + "type": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/organization-type", + "code": "prov", + "display": "Healthcare Provider" + } + ], + "text": "Healthcare Provider" + } + ], + "name": "GEMINI PHYSICAL THERAPY LLC", + "telecom": [ + { + "system": "phone", + "value": "978-372-3211" + } + ], + "address": [ + { + "line": [ + "679 S MAIN ST" + ], + "city": "HAVERHILL", + "state": "MA", + "postalCode": "01835-8721", + "country": "US" + } + ] + }, + "request": { + "method": "POST", + "url": "Organization" + } + }, + { + "fullUrl": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce", + "resource": { + "resourceType": "Practitioner", + "id": "0000016d-3a85-4cca-0000-0000000081ce", + "identifier": [ + { + "system": "http://hl7.org/fhir/sid/us-npi", + "value": "33230" + } + ], + "active": true, + "name": [ + { + "family": "Lindgren255", + "given": [ + "Jacalyn740" + ], + "prefix": [ + "Dr." + ] + } + ], + "telecom": [ + { + "system": "email", + "value": "Jacalyn740.Lindgren255@example.com", + "use": "work" + } + ], + "address": [ + { + "line": [ + "679 S MAIN ST" + ], + "city": "HAVERHILL", + "state": "MA", + "postalCode": "01835-8721", + "country": "US" + } + ], + "gender": "female" + }, + "request": { + "method": "POST", + "url": "Practitioner" + } + }, + { + "fullUrl": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b", + "resource": { + "resourceType": "Encounter", + "id": "95bce670-c38a-4fde-92b3-4ea39f189f1b", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + }, + "participant": [ + { + "individual": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce", + "display": "Dr. Jacalyn740 Lindgren255" + } + } + ], + "period": { + "start": "2010-06-26T23:35:42-04:00", + "end": "2010-06-26T23:50:42-04:00" + }, + "serviceProvider": { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, + { + "fullUrl": "urn:uuid:cd72a003-ffa9-44a2-9e9c-97004144f5d8", + "resource": { + "resourceType": "Observation", + "id": "cd72a003-ffa9-44a2-9e9c-97004144f5d8", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8302-2", + "display": "Body Height" + } + ], + "text": "Body Height" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "effectiveDateTime": "2010-06-26T23:35:42-04:00", + "issued": "2010-06-26T23:35:42.651-04:00", + "valueQuantity": { + "value": 132.05206138303643, + "unit": "cm", + "system": "http://unitsofmeasure.org", + "code": "cm" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:574b0113-cb4c-4ef6-891a-e4c4dc92c823", + "resource": { + "resourceType": "Observation", + "id": "574b0113-cb4c-4ef6-891a-e4c4dc92c823", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72514-3", + "display": "Pain severity - 0-10 verbal numeric rating [Score] - Reported" + } + ], + "text": "Pain severity - 0-10 verbal numeric rating [Score] - Reported" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "effectiveDateTime": "2010-06-26T23:35:42-04:00", + "issued": "2010-06-26T23:35:42.651-04:00", + "valueQuantity": { + "value": 3.070127918475897, + "unit": "{score}", + "system": "http://unitsofmeasure.org", + "code": "{score}" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:71082dc8-7ba7-483f-8c6d-356a2eac263a", + "resource": { + "resourceType": "Observation", + "id": "71082dc8-7ba7-483f-8c6d-356a2eac263a", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "29463-7", + "display": "Body Weight" + } + ], + "text": "Body Weight" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "effectiveDateTime": "2010-06-26T23:35:42-04:00", + "issued": "2010-06-26T23:35:42.651-04:00", + "valueQuantity": { + "value": 42.092743728168664, + "unit": "kg", + "system": "http://unitsofmeasure.org", + "code": "kg" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:67aa0812-560c-45fa-87f7-c120f4c995a9", + "resource": { + "resourceType": "Observation", + "id": "67aa0812-560c-45fa-87f7-c120f4c995a9", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "39156-5", + "display": "Body Mass Index" + } + ], + "text": "Body Mass Index" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "effectiveDateTime": "2010-06-26T23:35:42-04:00", + "issued": "2010-06-26T23:35:42.651-04:00", + "valueQuantity": { + "value": 24.13886606573649, + "unit": "kg/m2", + "system": "http://unitsofmeasure.org", + "code": "kg/m2" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:adbdeb71-2015-4df8-87e9-3bcffc52ca67", + "resource": { + "resourceType": "Observation", + "id": "adbdeb71-2015-4df8-87e9-3bcffc52ca67", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "59576-9", + "display": "Body mass index (BMI) [Percentile] Per age and gender" + } + ], + "text": "Body mass index (BMI) [Percentile] Per age and gender" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "effectiveDateTime": "2010-06-26T23:35:42-04:00", + "issued": "2010-06-26T23:35:42.651-04:00", + "valueQuantity": { + "value": 94.56321927940333, + "unit": "%", + "system": "http://unitsofmeasure.org", + "code": "%" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:1bcc7609-7489-46dc-aed8-4e44d012d2c4", + "resource": { + "resourceType": "Observation", + "id": "1bcc7609-7489-46dc-aed8-4e44d012d2c4", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "55284-4", + "display": "Blood Pressure" + } + ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "effectiveDateTime": "2010-06-26T23:35:42-04:00", + "issued": "2010-06-26T23:35:42.651-04:00", + "component": [ + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } + ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 85.17148371038968, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } + ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 121.62226051815269, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } + ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:02502e51-d280-40dc-8491-e47fa19f79a8", + "resource": { + "resourceType": "Observation", + "id": "02502e51-d280-40dc-8491-e47fa19f79a8", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "6690-2", + "display": "Leukocytes [#/volume] in Blood by Automated count" + } + ], + "text": "Leukocytes [#/volume] in Blood by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "effectiveDateTime": "2010-06-26T23:35:42-04:00", + "issued": "2010-06-26T23:35:42.651-04:00", + "valueQuantity": { + "value": 8.427002076208357, + "unit": "10*3/uL", + "system": "http://unitsofmeasure.org", + "code": "10*3/uL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:c264b850-53be-4961-995e-0ed3b49777c6", + "resource": { + "resourceType": "Observation", + "id": "c264b850-53be-4961-995e-0ed3b49777c6", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "789-8", + "display": "Erythrocytes [#/volume] in Blood by Automated count" + } + ], + "text": "Erythrocytes [#/volume] in Blood by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "effectiveDateTime": "2010-06-26T23:35:42-04:00", + "issued": "2010-06-26T23:35:42.651-04:00", + "valueQuantity": { + "value": 5.117161337318086, + "unit": "10*6/uL", + "system": "http://unitsofmeasure.org", + "code": "10*6/uL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:2aefe0c1-024a-4625-9fff-82080d2034c8", + "resource": { + "resourceType": "Observation", + "id": "2aefe0c1-024a-4625-9fff-82080d2034c8", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "718-7", + "display": "Hemoglobin [Mass/volume] in Blood" + } + ], + "text": "Hemoglobin [Mass/volume] in Blood" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "effectiveDateTime": "2010-06-26T23:35:42-04:00", + "issued": "2010-06-26T23:35:42.651-04:00", + "valueQuantity": { + "value": 12.997177409006884, + "unit": "g/dL", + "system": "http://unitsofmeasure.org", + "code": "g/dL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:0bca7f33-b7d4-41d5-bf77-195579b0a202", + "resource": { + "resourceType": "Observation", + "id": "0bca7f33-b7d4-41d5-bf77-195579b0a202", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "4544-3", + "display": "Hematocrit [Volume Fraction] of Blood by Automated count" + } + ], + "text": "Hematocrit [Volume Fraction] of Blood by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "effectiveDateTime": "2010-06-26T23:35:42-04:00", + "issued": "2010-06-26T23:35:42.651-04:00", + "valueQuantity": { + "value": 48.02322889512404, + "unit": "%", + "system": "http://unitsofmeasure.org", + "code": "%" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:141d142f-25e0-4ae0-945d-43aebd900410", + "resource": { + "resourceType": "Observation", + "id": "141d142f-25e0-4ae0-945d-43aebd900410", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "787-2", + "display": "MCV [Entitic volume] by Automated count" + } + ], + "text": "MCV [Entitic volume] by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "effectiveDateTime": "2010-06-26T23:35:42-04:00", + "issued": "2010-06-26T23:35:42.651-04:00", + "valueQuantity": { + "value": 88.93215593163453, + "unit": "fL", + "system": "http://unitsofmeasure.org", + "code": "fL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:de592e40-b3b8-4994-9e84-3365c824a682", + "resource": { + "resourceType": "Observation", + "id": "de592e40-b3b8-4994-9e84-3365c824a682", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "785-6", + "display": "MCH [Entitic mass] by Automated count" + } + ], + "text": "MCH [Entitic mass] by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "effectiveDateTime": "2010-06-26T23:35:42-04:00", + "issued": "2010-06-26T23:35:42.651-04:00", + "valueQuantity": { + "value": 27.734881037141538, + "unit": "pg", + "system": "http://unitsofmeasure.org", + "code": "pg" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:b0850dce-a2dd-42bc-873f-43e49f588c96", + "resource": { + "resourceType": "Observation", + "id": "b0850dce-a2dd-42bc-873f-43e49f588c96", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "786-4", + "display": "MCHC [Mass/volume] by Automated count" + } + ], + "text": "MCHC [Mass/volume] by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "effectiveDateTime": "2010-06-26T23:35:42-04:00", + "issued": "2010-06-26T23:35:42.651-04:00", + "valueQuantity": { + "value": 35.372602943673556, + "unit": "g/dL", + "system": "http://unitsofmeasure.org", + "code": "g/dL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:a56cfdf0-520a-4cf4-9a61-41422e68ce0c", + "resource": { + "resourceType": "Observation", + "id": "a56cfdf0-520a-4cf4-9a61-41422e68ce0c", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "21000-5", + "display": "Erythrocyte distribution width [Entitic volume] by Automated count" + } + ], + "text": "Erythrocyte distribution width [Entitic volume] by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "effectiveDateTime": "2010-06-26T23:35:42-04:00", + "issued": "2010-06-26T23:35:42.651-04:00", + "valueQuantity": { + "value": 43.6677922863001, + "unit": "fL", + "system": "http://unitsofmeasure.org", + "code": "fL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:dce4734a-6d78-4f75-9ef5-5d4b012417b5", + "resource": { + "resourceType": "Observation", + "id": "dce4734a-6d78-4f75-9ef5-5d4b012417b5", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "777-3", + "display": "Platelets [#/volume] in Blood by Automated count" + } + ], + "text": "Platelets [#/volume] in Blood by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "effectiveDateTime": "2010-06-26T23:35:42-04:00", + "issued": "2010-06-26T23:35:42.651-04:00", + "valueQuantity": { + "value": 328.9599910083864, + "unit": "10*3/uL", + "system": "http://unitsofmeasure.org", + "code": "10*3/uL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:7f731a0b-8abc-413d-81a6-4feaa066cf52", + "resource": { + "resourceType": "Observation", + "id": "7f731a0b-8abc-413d-81a6-4feaa066cf52", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "32207-3", + "display": "Platelet distribution width [Entitic volume] in Blood by Automated count" + } + ], + "text": "Platelet distribution width [Entitic volume] in Blood by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "effectiveDateTime": "2010-06-26T23:35:42-04:00", + "issued": "2010-06-26T23:35:42.651-04:00", + "valueQuantity": { + "value": 427.1270307825664, + "unit": "fL", + "system": "http://unitsofmeasure.org", + "code": "fL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:046b41eb-01cf-4dad-97a3-5d9cd59a42ca", + "resource": { + "resourceType": "Observation", + "id": "046b41eb-01cf-4dad-97a3-5d9cd59a42ca", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "32623-1", + "display": "Platelet mean volume [Entitic volume] in Blood by Automated count" + } + ], + "text": "Platelet mean volume [Entitic volume] in Blood by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "effectiveDateTime": "2010-06-26T23:35:42-04:00", + "issued": "2010-06-26T23:35:42.651-04:00", + "valueQuantity": { + "value": 9.556835279724679, + "unit": "fL", + "system": "http://unitsofmeasure.org", + "code": "fL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:53b82284-2d55-4059-a7d7-f8df8917e44b", + "resource": { + "resourceType": "Observation", + "id": "53b82284-2d55-4059-a7d7-f8df8917e44b", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "survey", + "display": "survey" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72166-2", + "display": "Tobacco smoking status NHIS" + } + ], + "text": "Tobacco smoking status NHIS" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "effectiveDateTime": "2010-06-26T23:35:42-04:00", + "issued": "2010-06-26T23:35:42.651-04:00", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "266919005", + "display": "Never smoker" + } + ], + "text": "Never smoker" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:5c8018c0-45e0-4639-b76b-d3d174eea6f7", + "resource": { + "resourceType": "Immunization", + "id": "5c8018c0-45e0-4639-b76b-d3d174eea6f7", + "status": "completed", + "vaccineCode": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "115", + "display": "Tdap" + } + ], + "text": "Tdap" + }, + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "occurrenceDateTime": "2010-06-26T23:35:42-04:00", + "primarySource": true + }, + "request": { + "method": "POST", + "url": "Immunization" + } + }, + { + "fullUrl": "urn:uuid:709c345b-8967-44ba-b352-556409b82a1c", + "resource": { + "resourceType": "Immunization", + "id": "709c345b-8967-44ba-b352-556409b82a1c", + "status": "completed", + "vaccineCode": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "occurrenceDateTime": "2010-06-26T23:35:42-04:00", + "primarySource": true + }, + "request": { + "method": "POST", + "url": "Immunization" + } + }, + { + "fullUrl": "urn:uuid:ee66ff0b-8bc7-47a5-bf35-4a467071961d", + "resource": { + "resourceType": "Immunization", + "id": "ee66ff0b-8bc7-47a5-bf35-4a467071961d", + "status": "completed", + "vaccineCode": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "62", + "display": "HPV, quadrivalent" + } + ], + "text": "HPV, quadrivalent" + }, + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "occurrenceDateTime": "2010-06-26T23:35:42-04:00", + "primarySource": true + }, + "request": { + "method": "POST", + "url": "Immunization" + } + }, + { + "fullUrl": "urn:uuid:b5bf3e2e-1458-4b60-ac5b-2137f4775226", + "resource": { + "resourceType": "Immunization", + "id": "b5bf3e2e-1458-4b60-ac5b-2137f4775226", + "status": "completed", + "vaccineCode": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "114", + "display": "meningococcal MCV4P" + } + ], + "text": "meningococcal MCV4P" + }, + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "occurrenceDateTime": "2010-06-26T23:35:42-04:00", + "primarySource": true + }, + "request": { + "method": "POST", + "url": "Immunization" + } + }, + { + "fullUrl": "urn:uuid:9c053a48-db4a-4674-962e-ae130296b4c4", + "resource": { + "resourceType": "DiagnosticReport", + "id": "9c053a48-db4a-4674-962e-ae130296b4c4", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0074", + "code": "LAB", + "display": "Laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "58410-2", + "display": "Complete blood count (hemogram) panel - Blood by Automated count" + } + ], + "text": "Complete blood count (hemogram) panel - Blood by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + }, + "effectiveDateTime": "2010-06-26T23:35:42-04:00", + "issued": "2010-06-26T23:35:42.651-04:00", + "result": [ + { + "reference": "urn:uuid:02502e51-d280-40dc-8491-e47fa19f79a8", + "display": "Leukocytes [#/volume] in Blood by Automated count" + }, + { + "reference": "urn:uuid:c264b850-53be-4961-995e-0ed3b49777c6", + "display": "Erythrocytes [#/volume] in Blood by Automated count" + }, + { + "reference": "urn:uuid:2aefe0c1-024a-4625-9fff-82080d2034c8", + "display": "Hemoglobin [Mass/volume] in Blood" + }, + { + "reference": "urn:uuid:0bca7f33-b7d4-41d5-bf77-195579b0a202", + "display": "Hematocrit [Volume Fraction] of Blood by Automated count" + }, + { + "reference": "urn:uuid:141d142f-25e0-4ae0-945d-43aebd900410", + "display": "MCV [Entitic volume] by Automated count" + }, + { + "reference": "urn:uuid:de592e40-b3b8-4994-9e84-3365c824a682", + "display": "MCH [Entitic mass] by Automated count" + }, + { + "reference": "urn:uuid:b0850dce-a2dd-42bc-873f-43e49f588c96", + "display": "MCHC [Mass/volume] by Automated count" + }, + { + "reference": "urn:uuid:a56cfdf0-520a-4cf4-9a61-41422e68ce0c", + "display": "Erythrocyte distribution width [Entitic volume] by Automated count" + }, + { + "reference": "urn:uuid:dce4734a-6d78-4f75-9ef5-5d4b012417b5", + "display": "Platelets [#/volume] in Blood by Automated count" + }, + { + "reference": "urn:uuid:7f731a0b-8abc-413d-81a6-4feaa066cf52", + "display": "Platelet distribution width [Entitic volume] in Blood by Automated count" + }, + { + "reference": "urn:uuid:046b41eb-01cf-4dad-97a3-5d9cd59a42ca", + "display": "Platelet mean volume [Entitic volume] in Blood by Automated count" + } + ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, + { + "fullUrl": "urn:uuid:428703b2-fa9e-4e0b-abf3-617c5d08dfc4", + "resource": { + "resourceType": "Claim", + "id": "428703b2-fa9e-4e0b-abf3-617c5d08dfc4", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Tania553 Harris789" + }, + "billablePeriod": { + "start": "2010-06-26T23:35:42-04:00", + "end": "2010-06-26T23:50:42-04:00" + }, + "created": "2010-06-26T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "supportingInfo": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code": "info" + } + ] + }, + "valueReference": { + "reference": "urn:uuid:5c8018c0-45e0-4639-b76b-d3d174eea6f7" + } + }, + { + "sequence": 2, + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code": "info" + } + ] + }, + "valueReference": { + "reference": "urn:uuid:709c345b-8967-44ba-b352-556409b82a1c" + } + }, + { + "sequence": 3, + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code": "info" + } + ] + }, + "valueReference": { + "reference": "urn:uuid:ee66ff0b-8bc7-47a5-bf35-4a467071961d" + } + }, + { + "sequence": 4, + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code": "info" + } + ] + }, + "valueReference": { + "reference": "urn:uuid:b5bf3e2e-1458-4b60-ac5b-2137f4775226" + } + } + ], + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Anthem" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + }, + "encounter": [ + { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + } + ] + }, + { + "sequence": 2, + "informationSequence": [ + 1 + ], + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "115", + "display": "Tdap" + } + ], + "text": "Tdap" + }, + "net": { + "value": 140.52, + "currency": "USD" + } + }, + { + "sequence": 3, + "informationSequence": [ + 2 + ], + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "net": { + "value": 140.52, + "currency": "USD" + } + }, + { + "sequence": 4, + "informationSequence": [ + 3 + ], + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "62", + "display": "HPV, quadrivalent" + } + ], + "text": "HPV, quadrivalent" + }, + "net": { + "value": 140.52, + "currency": "USD" + } + }, + { + "sequence": 5, + "informationSequence": [ + 4 + ], + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "114", + "display": "meningococcal MCV4P" + } + ], + "text": "meningococcal MCV4P" + }, + "net": { + "value": 140.52, + "currency": "USD" + } + } + ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:bceb2142-e749-4cfd-a3a6-00c48c2b5fca", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "bceb2142-e749-4cfd-a3a6-00c48c2b5fca", + "contained": [ + { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "performer": [ + { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + } + ] + }, + { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Anthem" + }, + "beneficiary": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "payor": [ + { + "display": "Anthem" + } + ] + } + ], + "identifier": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "428703b2-fa9e-4e0b-abf3-617c5d08dfc4" + }, + { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } + ], + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2010-06-26T23:50:42-04:00", + "end": "2011-06-26T23:50:42-04:00" + }, + "created": "2010-06-26T23:50:42-04:00", + "insurer": { + "display": "Anthem" + }, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "referral": { + "reference": "#referral" + }, + "claim": { + "reference": "urn:uuid:428703b2-fa9e-4e0b-abf3-617c5d08dfc4" + }, + "outcome": "complete", + "careTeam": [ + { + "sequence": 1, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "role": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } + ] + } + } + ], + "insurance": [ + { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Anthem" + } + } + ], + "item": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + }, + "servicedPeriod": { + "start": "2010-06-26T23:35:42-04:00", + "end": "2010-06-26T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "encounter": [ + { + "reference": "urn:uuid:95bce670-c38a-4fde-92b3-4ea39f189f1b" + } + ] + }, + { + "sequence": 2, + "informationSequence": [ + 1 + ], + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "115", + "display": "Tdap" + } + ], + "text": "Tdap" + }, + "servicedPeriod": { + "start": "2010-06-26T23:35:42-04:00", + "end": "2010-06-26T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "net": { + "value": 140.52, + "currency": "USD" + }, + "adjudication": [ + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display": "Line Beneficiary Coinsurance Amount" + } + ] + }, + "amount": { + "value": 28.104000000000003, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display": "Line Provider Payment Amount" + } + ] + }, + "amount": { + "value": 112.41600000000001, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display": "Line Submitted Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display": "Line Allowed Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display": "Line Beneficiary Part B Deductible Amount" + } + ] + }, + "amount": { + "value": 0, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display": "Line Processing Indicator Code" + } + ] + } + } + ] + }, + { + "sequence": 3, + "informationSequence": [ + 2 + ], + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "servicedPeriod": { + "start": "2010-06-26T23:35:42-04:00", + "end": "2010-06-26T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "net": { + "value": 140.52, + "currency": "USD" + }, + "adjudication": [ + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display": "Line Beneficiary Coinsurance Amount" + } + ] + }, + "amount": { + "value": 28.104000000000003, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display": "Line Provider Payment Amount" + } + ] + }, + "amount": { + "value": 112.41600000000001, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display": "Line Submitted Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display": "Line Allowed Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display": "Line Beneficiary Part B Deductible Amount" + } + ] + }, + "amount": { + "value": 0, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display": "Line Processing Indicator Code" + } + ] + } + } + ] + }, + { + "sequence": 4, + "informationSequence": [ + 3 + ], + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "62", + "display": "HPV, quadrivalent" + } + ], + "text": "HPV, quadrivalent" + }, + "servicedPeriod": { + "start": "2010-06-26T23:35:42-04:00", + "end": "2010-06-26T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "net": { + "value": 140.52, + "currency": "USD" + }, + "adjudication": [ + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display": "Line Beneficiary Coinsurance Amount" + } + ] + }, + "amount": { + "value": 28.104000000000003, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display": "Line Provider Payment Amount" + } + ] + }, + "amount": { + "value": 112.41600000000001, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display": "Line Submitted Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display": "Line Allowed Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display": "Line Beneficiary Part B Deductible Amount" + } + ] + }, + "amount": { + "value": 0, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display": "Line Processing Indicator Code" + } + ] + } + } + ] + }, + { + "sequence": 5, + "informationSequence": [ + 4 + ], + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "114", + "display": "meningococcal MCV4P" + } + ], + "text": "meningococcal MCV4P" + }, + "servicedPeriod": { + "start": "2010-06-26T23:35:42-04:00", + "end": "2010-06-26T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "net": { + "value": 140.52, + "currency": "USD" + }, + "adjudication": [ + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display": "Line Beneficiary Coinsurance Amount" + } + ] + }, + "amount": { + "value": 28.104000000000003, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display": "Line Provider Payment Amount" + } + ] + }, + "amount": { + "value": 112.41600000000001, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display": "Line Submitted Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display": "Line Allowed Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display": "Line Beneficiary Part B Deductible Amount" + } + ] + }, + "amount": { + "value": 0, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display": "Line Processing Indicator Code" + } + ] + } + } + ] + } + ], + "total": [ + { + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } + ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } + ], + "payment": { + "amount": { + "value": 449.66400000000004, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, + { + "fullUrl": "urn:uuid:80fe5bb1-0038-417a-8cd1-b978ee1f58a8", + "resource": { + "resourceType": "Encounter", + "id": "80fe5bb1-0038-417a-8cd1-b978ee1f58a8", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + }, + "participant": [ + { + "individual": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce", + "display": "Dr. Jacalyn740 Lindgren255" + } + } + ], + "period": { + "start": "2011-07-02T23:35:42-04:00", + "end": "2011-07-02T23:50:42-04:00" + }, + "serviceProvider": { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, + { + "fullUrl": "urn:uuid:78958aff-d44d-425f-b701-96e8a6dd5b04", + "resource": { + "resourceType": "Observation", + "id": "78958aff-d44d-425f-b701-96e8a6dd5b04", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8302-2", + "display": "Body Height" + } + ], + "text": "Body Height" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:80fe5bb1-0038-417a-8cd1-b978ee1f58a8" + }, + "effectiveDateTime": "2011-07-02T23:35:42-04:00", + "issued": "2011-07-02T23:35:42.651-04:00", + "valueQuantity": { + "value": 138.85336561716676, + "unit": "cm", + "system": "http://unitsofmeasure.org", + "code": "cm" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:0ed8d756-5ec3-454c-9a22-63dc15cb7fef", + "resource": { + "resourceType": "Observation", + "id": "0ed8d756-5ec3-454c-9a22-63dc15cb7fef", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72514-3", + "display": "Pain severity - 0-10 verbal numeric rating [Score] - Reported" + } + ], + "text": "Pain severity - 0-10 verbal numeric rating [Score] - Reported" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:80fe5bb1-0038-417a-8cd1-b978ee1f58a8" + }, + "effectiveDateTime": "2011-07-02T23:35:42-04:00", + "issued": "2011-07-02T23:35:42.651-04:00", + "valueQuantity": { + "value": 2.459666594450257, + "unit": "{score}", + "system": "http://unitsofmeasure.org", + "code": "{score}" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:cdd48d3d-8821-40ba-8a9c-6cd0ade01ee4", + "resource": { + "resourceType": "Observation", + "id": "cdd48d3d-8821-40ba-8a9c-6cd0ade01ee4", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "29463-7", + "display": "Body Weight" + } + ], + "text": "Body Weight" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:80fe5bb1-0038-417a-8cd1-b978ee1f58a8" + }, + "effectiveDateTime": "2011-07-02T23:35:42-04:00", + "issued": "2011-07-02T23:35:42.651-04:00", + "valueQuantity": { + "value": 48.68824875004585, + "unit": "kg", + "system": "http://unitsofmeasure.org", + "code": "kg" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:f9a33b76-278d-475e-ac83-c90b596c3fb4", + "resource": { + "resourceType": "Observation", + "id": "f9a33b76-278d-475e-ac83-c90b596c3fb4", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "39156-5", + "display": "Body Mass Index" + } + ], + "text": "Body Mass Index" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:80fe5bb1-0038-417a-8cd1-b978ee1f58a8" + }, + "effectiveDateTime": "2011-07-02T23:35:42-04:00", + "issued": "2011-07-02T23:35:42.651-04:00", + "valueQuantity": { + "value": 25.25290424727607, + "unit": "kg/m2", + "system": "http://unitsofmeasure.org", + "code": "kg/m2" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:241f61f2-11c2-4919-ad33-0aec02d3fd03", + "resource": { + "resourceType": "Observation", + "id": "241f61f2-11c2-4919-ad33-0aec02d3fd03", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "59576-9", + "display": "Body mass index (BMI) [Percentile] Per age and gender" + } + ], + "text": "Body mass index (BMI) [Percentile] Per age and gender" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:80fe5bb1-0038-417a-8cd1-b978ee1f58a8" + }, + "effectiveDateTime": "2011-07-02T23:35:42-04:00", + "issued": "2011-07-02T23:35:42.651-04:00", + "valueQuantity": { + "value": 94.52290965714471, + "unit": "%", + "system": "http://unitsofmeasure.org", + "code": "%" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:93e895fd-ec39-468f-8ce3-4f7963c1c81e", + "resource": { + "resourceType": "Observation", + "id": "93e895fd-ec39-468f-8ce3-4f7963c1c81e", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "55284-4", + "display": "Blood Pressure" + } + ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:80fe5bb1-0038-417a-8cd1-b978ee1f58a8" + }, + "effectiveDateTime": "2011-07-02T23:35:42-04:00", + "issued": "2011-07-02T23:35:42.651-04:00", + "component": [ + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } + ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 76.31094210870585, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } + ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 123.38236408520764, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } + ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:6823dec2-d3dc-4473-8bad-60c7fc8a674d", + "resource": { + "resourceType": "Observation", + "id": "6823dec2-d3dc-4473-8bad-60c7fc8a674d", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "survey", + "display": "survey" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72166-2", + "display": "Tobacco smoking status NHIS" + } + ], + "text": "Tobacco smoking status NHIS" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:80fe5bb1-0038-417a-8cd1-b978ee1f58a8" + }, + "effectiveDateTime": "2011-07-02T23:35:42-04:00", + "issued": "2011-07-02T23:35:42.651-04:00", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "266919005", + "display": "Never smoker" + } + ], + "text": "Never smoker" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:7b1f2ef6-1a3f-489f-ab37-c0f06e9cd0e3", + "resource": { + "resourceType": "Immunization", + "id": "7b1f2ef6-1a3f-489f-ab37-c0f06e9cd0e3", + "status": "completed", + "vaccineCode": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:80fe5bb1-0038-417a-8cd1-b978ee1f58a8" + }, + "occurrenceDateTime": "2011-07-02T23:35:42-04:00", + "primarySource": true + }, + "request": { + "method": "POST", + "url": "Immunization" + } + }, + { + "fullUrl": "urn:uuid:573b74b5-36b8-4e43-aa01-5e7074d067f2", + "resource": { + "resourceType": "Immunization", + "id": "573b74b5-36b8-4e43-aa01-5e7074d067f2", + "status": "completed", + "vaccineCode": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "62", + "display": "HPV, quadrivalent" + } + ], + "text": "HPV, quadrivalent" + }, + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:80fe5bb1-0038-417a-8cd1-b978ee1f58a8" + }, + "occurrenceDateTime": "2011-07-02T23:35:42-04:00", + "primarySource": true + }, + "request": { + "method": "POST", + "url": "Immunization" + } + }, + { + "fullUrl": "urn:uuid:3cc5cf91-2e72-4d26-9356-791b6e87a82f", + "resource": { + "resourceType": "Claim", + "id": "3cc5cf91-2e72-4d26-9356-791b6e87a82f", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Tania553 Harris789" + }, + "billablePeriod": { + "start": "2011-07-02T23:35:42-04:00", + "end": "2011-07-02T23:50:42-04:00" + }, + "created": "2011-07-02T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "supportingInfo": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code": "info" + } + ] + }, + "valueReference": { + "reference": "urn:uuid:7b1f2ef6-1a3f-489f-ab37-c0f06e9cd0e3" + } + }, + { + "sequence": 2, + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code": "info" + } + ] + }, + "valueReference": { + "reference": "urn:uuid:573b74b5-36b8-4e43-aa01-5e7074d067f2" + } + } + ], + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Anthem" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + }, + "encounter": [ + { + "reference": "urn:uuid:80fe5bb1-0038-417a-8cd1-b978ee1f58a8" + } + ] + }, + { + "sequence": 2, + "informationSequence": [ + 1 + ], + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "net": { + "value": 140.52, + "currency": "USD" + } + }, + { + "sequence": 3, + "informationSequence": [ + 2 + ], + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "62", + "display": "HPV, quadrivalent" + } + ], + "text": "HPV, quadrivalent" + }, + "net": { + "value": 140.52, + "currency": "USD" + } + } + ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:f109e427-4fcd-4ee3-8c7c-a080a09d23b3", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "f109e427-4fcd-4ee3-8c7c-a080a09d23b3", + "contained": [ + { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "performer": [ + { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + } + ] + }, + { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Anthem" + }, + "beneficiary": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "payor": [ + { + "display": "Anthem" + } + ] + } + ], + "identifier": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "3cc5cf91-2e72-4d26-9356-791b6e87a82f" + }, + { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } + ], + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2011-07-02T23:50:42-04:00", + "end": "2012-07-02T23:50:42-04:00" + }, + "created": "2011-07-02T23:50:42-04:00", + "insurer": { + "display": "Anthem" + }, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "referral": { + "reference": "#referral" + }, + "claim": { + "reference": "urn:uuid:3cc5cf91-2e72-4d26-9356-791b6e87a82f" + }, + "outcome": "complete", + "careTeam": [ + { + "sequence": 1, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "role": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } + ] + } + } + ], + "insurance": [ + { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Anthem" + } + } + ], + "item": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + }, + "servicedPeriod": { + "start": "2011-07-02T23:35:42-04:00", + "end": "2011-07-02T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "encounter": [ + { + "reference": "urn:uuid:80fe5bb1-0038-417a-8cd1-b978ee1f58a8" + } + ] + }, + { + "sequence": 2, + "informationSequence": [ + 1 + ], + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "servicedPeriod": { + "start": "2011-07-02T23:35:42-04:00", + "end": "2011-07-02T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "net": { + "value": 140.52, + "currency": "USD" + }, + "adjudication": [ + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display": "Line Beneficiary Coinsurance Amount" + } + ] + }, + "amount": { + "value": 28.104000000000003, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display": "Line Provider Payment Amount" + } + ] + }, + "amount": { + "value": 112.41600000000001, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display": "Line Submitted Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display": "Line Allowed Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display": "Line Beneficiary Part B Deductible Amount" + } + ] + }, + "amount": { + "value": 0, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display": "Line Processing Indicator Code" + } + ] + } + } + ] + }, + { + "sequence": 3, + "informationSequence": [ + 2 + ], + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "62", + "display": "HPV, quadrivalent" + } + ], + "text": "HPV, quadrivalent" + }, + "servicedPeriod": { + "start": "2011-07-02T23:35:42-04:00", + "end": "2011-07-02T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "net": { + "value": 140.52, + "currency": "USD" + }, + "adjudication": [ + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display": "Line Beneficiary Coinsurance Amount" + } + ] + }, + "amount": { + "value": 28.104000000000003, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display": "Line Provider Payment Amount" + } + ] + }, + "amount": { + "value": 112.41600000000001, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display": "Line Submitted Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display": "Line Allowed Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display": "Line Beneficiary Part B Deductible Amount" + } + ] + }, + "amount": { + "value": 0, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display": "Line Processing Indicator Code" + } + ] + } + } + ] + } + ], + "total": [ + { + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } + ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } + ], + "payment": { + "amount": { + "value": 224.83200000000002, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, + { + "fullUrl": "urn:uuid:b9db43ee-76cd-47c0-867b-3a3cf9f406b6", + "resource": { + "resourceType": "Encounter", + "id": "b9db43ee-76cd-47c0-867b-3a3cf9f406b6", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + }, + "participant": [ + { + "individual": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce", + "display": "Dr. Jacalyn740 Lindgren255" + } + } + ], + "period": { + "start": "2012-07-07T23:35:42-04:00", + "end": "2012-07-07T23:50:42-04:00" + }, + "serviceProvider": { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, + { + "fullUrl": "urn:uuid:e29369e8-e3e0-451f-a909-2e822da64a1d", + "resource": { + "resourceType": "Observation", + "id": "e29369e8-e3e0-451f-a909-2e822da64a1d", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8302-2", + "display": "Body Height" + } + ], + "text": "Body Height" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:b9db43ee-76cd-47c0-867b-3a3cf9f406b6" + }, + "effectiveDateTime": "2012-07-07T23:35:42-04:00", + "issued": "2012-07-07T23:35:42.651-04:00", + "valueQuantity": { + "value": 145.5449333779574, + "unit": "cm", + "system": "http://unitsofmeasure.org", + "code": "cm" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:3f9f4815-a473-4f7c-b518-f35379d275b3", + "resource": { + "resourceType": "Observation", + "id": "3f9f4815-a473-4f7c-b518-f35379d275b3", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72514-3", + "display": "Pain severity - 0-10 verbal numeric rating [Score] - Reported" + } + ], + "text": "Pain severity - 0-10 verbal numeric rating [Score] - Reported" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:b9db43ee-76cd-47c0-867b-3a3cf9f406b6" + }, + "effectiveDateTime": "2012-07-07T23:35:42-04:00", + "issued": "2012-07-07T23:35:42.651-04:00", + "valueQuantity": { + "value": 3.1653782239614827, + "unit": "{score}", + "system": "http://unitsofmeasure.org", + "code": "{score}" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:042a1f0a-bae5-4c81-9d53-7d8aaca0fa59", + "resource": { + "resourceType": "Observation", + "id": "042a1f0a-bae5-4c81-9d53-7d8aaca0fa59", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "29463-7", + "display": "Body Weight" + } + ], + "text": "Body Weight" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:b9db43ee-76cd-47c0-867b-3a3cf9f406b6" + }, + "effectiveDateTime": "2012-07-07T23:35:42-04:00", + "issued": "2012-07-07T23:35:42.651-04:00", + "valueQuantity": { + "value": 55.70344077238314, + "unit": "kg", + "system": "http://unitsofmeasure.org", + "code": "kg" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:611f14e2-b991-4330-8a08-99358ec89864", + "resource": { + "resourceType": "Observation", + "id": "611f14e2-b991-4330-8a08-99358ec89864", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "39156-5", + "display": "Body Mass Index" + } + ], + "text": "Body Mass Index" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:b9db43ee-76cd-47c0-867b-3a3cf9f406b6" + }, + "effectiveDateTime": "2012-07-07T23:35:42-04:00", + "issued": "2012-07-07T23:35:42.651-04:00", + "valueQuantity": { + "value": 26.295887851090935, + "unit": "kg/m2", + "system": "http://unitsofmeasure.org", + "code": "kg/m2" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:bf4ab8f4-172f-481e-9d92-e5bbf213ec1a", + "resource": { + "resourceType": "Observation", + "id": "bf4ab8f4-172f-481e-9d92-e5bbf213ec1a", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "59576-9", + "display": "Body mass index (BMI) [Percentile] Per age and gender" + } + ], + "text": "Body mass index (BMI) [Percentile] Per age and gender" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:b9db43ee-76cd-47c0-867b-3a3cf9f406b6" + }, + "effectiveDateTime": "2012-07-07T23:35:42-04:00", + "issued": "2012-07-07T23:35:42.651-04:00", + "valueQuantity": { + "value": 94.6477616911125, + "unit": "%", + "system": "http://unitsofmeasure.org", + "code": "%" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:0a55e5c1-9ce5-498b-84e2-5b17713d6d3b", + "resource": { + "resourceType": "Observation", + "id": "0a55e5c1-9ce5-498b-84e2-5b17713d6d3b", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "55284-4", + "display": "Blood Pressure" + } + ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:b9db43ee-76cd-47c0-867b-3a3cf9f406b6" + }, + "effectiveDateTime": "2012-07-07T23:35:42-04:00", + "issued": "2012-07-07T23:35:42.651-04:00", + "component": [ + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } + ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 81.3946941547834, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } + ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 106.75758340656998, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } + ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:29c6e2a7-fb7d-4ea2-b08f-97d8b12fd492", + "resource": { + "resourceType": "Observation", + "id": "29c6e2a7-fb7d-4ea2-b08f-97d8b12fd492", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "survey", + "display": "survey" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72166-2", + "display": "Tobacco smoking status NHIS" + } + ], + "text": "Tobacco smoking status NHIS" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:b9db43ee-76cd-47c0-867b-3a3cf9f406b6" + }, + "effectiveDateTime": "2012-07-07T23:35:42-04:00", + "issued": "2012-07-07T23:35:42.651-04:00", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "266919005", + "display": "Never smoker" + } + ], + "text": "Never smoker" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:ee6df6c8-96e4-4b6a-8a8b-3d95ad24816e", + "resource": { + "resourceType": "Immunization", + "id": "ee6df6c8-96e4-4b6a-8a8b-3d95ad24816e", + "status": "completed", + "vaccineCode": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:b9db43ee-76cd-47c0-867b-3a3cf9f406b6" + }, + "occurrenceDateTime": "2012-07-07T23:35:42-04:00", + "primarySource": true + }, + "request": { + "method": "POST", + "url": "Immunization" + } + }, + { + "fullUrl": "urn:uuid:64c5e265-005b-435b-ab34-c1f1d2cf7128", + "resource": { + "resourceType": "Immunization", + "id": "64c5e265-005b-435b-ab34-c1f1d2cf7128", + "status": "completed", + "vaccineCode": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "62", + "display": "HPV, quadrivalent" + } + ], + "text": "HPV, quadrivalent" + }, + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:b9db43ee-76cd-47c0-867b-3a3cf9f406b6" + }, + "occurrenceDateTime": "2012-07-07T23:35:42-04:00", + "primarySource": true + }, + "request": { + "method": "POST", + "url": "Immunization" + } + }, + { + "fullUrl": "urn:uuid:7134073a-c4ce-4baf-ab92-dbd11f2516c3", + "resource": { + "resourceType": "Claim", + "id": "7134073a-c4ce-4baf-ab92-dbd11f2516c3", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Tania553 Harris789" + }, + "billablePeriod": { + "start": "2012-07-07T23:35:42-04:00", + "end": "2012-07-07T23:50:42-04:00" + }, + "created": "2012-07-07T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "supportingInfo": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code": "info" + } + ] + }, + "valueReference": { + "reference": "urn:uuid:ee6df6c8-96e4-4b6a-8a8b-3d95ad24816e" + } + }, + { + "sequence": 2, + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code": "info" + } + ] + }, + "valueReference": { + "reference": "urn:uuid:64c5e265-005b-435b-ab34-c1f1d2cf7128" + } + } + ], + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Anthem" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + }, + "encounter": [ + { + "reference": "urn:uuid:b9db43ee-76cd-47c0-867b-3a3cf9f406b6" + } + ] + }, + { + "sequence": 2, + "informationSequence": [ + 1 + ], + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "net": { + "value": 140.52, + "currency": "USD" + } + }, + { + "sequence": 3, + "informationSequence": [ + 2 + ], + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "62", + "display": "HPV, quadrivalent" + } + ], + "text": "HPV, quadrivalent" + }, + "net": { + "value": 140.52, + "currency": "USD" + } + } + ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:e73eceff-6956-407b-baa9-a53f612a0745", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "e73eceff-6956-407b-baa9-a53f612a0745", + "contained": [ + { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "performer": [ + { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + } + ] + }, + { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Anthem" + }, + "beneficiary": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "payor": [ + { + "display": "Anthem" + } + ] + } + ], + "identifier": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "7134073a-c4ce-4baf-ab92-dbd11f2516c3" + }, + { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } + ], + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2012-07-07T23:50:42-04:00", + "end": "2013-07-07T23:50:42-04:00" + }, + "created": "2012-07-07T23:50:42-04:00", + "insurer": { + "display": "Anthem" + }, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "referral": { + "reference": "#referral" + }, + "claim": { + "reference": "urn:uuid:7134073a-c4ce-4baf-ab92-dbd11f2516c3" + }, + "outcome": "complete", + "careTeam": [ + { + "sequence": 1, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "role": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } + ] + } + } + ], + "insurance": [ + { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Anthem" + } + } + ], + "item": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + }, + "servicedPeriod": { + "start": "2012-07-07T23:35:42-04:00", + "end": "2012-07-07T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "encounter": [ + { + "reference": "urn:uuid:b9db43ee-76cd-47c0-867b-3a3cf9f406b6" + } + ] + }, + { + "sequence": 2, + "informationSequence": [ + 1 + ], + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "servicedPeriod": { + "start": "2012-07-07T23:35:42-04:00", + "end": "2012-07-07T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "net": { + "value": 140.52, + "currency": "USD" + }, + "adjudication": [ + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display": "Line Beneficiary Coinsurance Amount" + } + ] + }, + "amount": { + "value": 28.104000000000003, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display": "Line Provider Payment Amount" + } + ] + }, + "amount": { + "value": 112.41600000000001, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display": "Line Submitted Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display": "Line Allowed Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display": "Line Beneficiary Part B Deductible Amount" + } + ] + }, + "amount": { + "value": 0, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display": "Line Processing Indicator Code" + } + ] + } + } + ] + }, + { + "sequence": 3, + "informationSequence": [ + 2 + ], + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "62", + "display": "HPV, quadrivalent" + } + ], + "text": "HPV, quadrivalent" + }, + "servicedPeriod": { + "start": "2012-07-07T23:35:42-04:00", + "end": "2012-07-07T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "net": { + "value": 140.52, + "currency": "USD" + }, + "adjudication": [ + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display": "Line Beneficiary Coinsurance Amount" + } + ] + }, + "amount": { + "value": 28.104000000000003, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display": "Line Provider Payment Amount" + } + ] + }, + "amount": { + "value": 112.41600000000001, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display": "Line Submitted Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display": "Line Allowed Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display": "Line Beneficiary Part B Deductible Amount" + } + ] + }, + "amount": { + "value": 0, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display": "Line Processing Indicator Code" + } + ] + } + } + ] + } + ], + "total": [ + { + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } + ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } + ], + "payment": { + "amount": { + "value": 224.83200000000002, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, + { + "fullUrl": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "resource": { + "resourceType": "Organization", + "id": "a9f20dc1-5147-3789-bcef-bbecb41c5983", + "identifier": [ + { + "system": "https://github.com/synthetichealth/synthea", + "value": "a9f20dc1-5147-3789-bcef-bbecb41c5983" + } + ], + "active": true, + "type": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/organization-type", + "code": "prov", + "display": "Healthcare Provider" + } + ], + "text": "Healthcare Provider" + } + ], + "name": "HOLY FAMILY HOSPITAL", + "telecom": [ + { + "system": "phone", + "value": "9786870156" + } + ], + "address": [ + { + "line": [ + "70 EAST STREET" + ], + "city": "METHUEN", + "state": "MA", + "postalCode": "01844", + "country": "US" + } + ] + }, + "request": { + "method": "POST", + "url": "Organization" + } + }, + { + "fullUrl": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a", + "resource": { + "resourceType": "Practitioner", + "id": "0000016d-3a85-4cca-0000-00000000014a", + "identifier": [ + { + "system": "http://hl7.org/fhir/sid/us-npi", + "value": "330" + } + ], + "active": true, + "name": [ + { + "family": "Haag279", + "given": [ + "Roberto515" + ], + "prefix": [ + "Dr." + ] + } + ], + "telecom": [ + { + "system": "email", + "value": "Roberto515.Haag279@example.com", + "use": "work" + } + ], + "address": [ + { + "line": [ + "70 EAST STREET" + ], + "city": "METHUEN", + "state": "MA", + "postalCode": "01844", + "country": "US" + } + ], + "gender": "male" + }, + "request": { + "method": "POST", + "url": "Practitioner" + } + }, + { + "fullUrl": "urn:uuid:fbdc402b-eade-4b36-bf6f-5847f320250b", + "resource": { + "resourceType": "Encounter", + "id": "fbdc402b-eade-4b36-bf6f-5847f320250b", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "698314001", + "display": "Consultation for treatment" + } + ], + "text": "Consultation for treatment" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + }, + "participant": [ + { + "individual": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a", + "display": "Dr. Roberto515 Haag279" + } + } + ], + "period": { + "start": "2013-06-08T23:35:42-04:00", + "end": "2013-06-08T23:50:42-04:00" + }, + "serviceProvider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, + { + "fullUrl": "urn:uuid:0de25daa-1d47-4cb1-b1a9-d4e30c3e73d1", + "resource": { + "resourceType": "MedicationRequest", + "id": "0de25daa-1d47-4cb1-b1a9-d4e30c3e73d1", + "status": "stopped", + "intent": "order", + "medicationCodeableConcept": { + "coding": [ + { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "748856", + "display": "Yaz 28 Day Pack" + } + ], + "text": "Yaz 28 Day Pack" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:fbdc402b-eade-4b36-bf6f-5847f320250b" + }, + "authoredOn": "2013-06-08T23:35:42-04:00", + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a", + "display": "Dr. Roberto515 Haag279" + } + }, + "request": { + "method": "POST", + "url": "MedicationRequest" + } + }, + { + "fullUrl": "urn:uuid:2fb6461e-bd17-4d35-9116-138b0bc3009a", + "resource": { + "resourceType": "Claim", + "id": "2fb6461e-bd17-4d35-9116-138b0bc3009a", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "pharmacy" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2013-06-08T23:35:42-04:00", + "end": "2013-06-08T23:50:42-04:00" + }, + "created": "2013-06-08T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "prescription": { + "reference": "urn:uuid:0de25daa-1d47-4cb1-b1a9-d4e30c3e73d1" + }, + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "698314001", + "display": "Consultation for treatment" + } + ], + "text": "Consultation for treatment" + }, + "encounter": [ + { + "reference": "urn:uuid:fbdc402b-eade-4b36-bf6f-5847f320250b" + } + ] + } + ], + "total": { + "value": 23.2, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:470a4ec6-8fc4-43af-a3bb-9e916cefe3da", + "resource": { + "resourceType": "Claim", + "id": "470a4ec6-8fc4-43af-a3bb-9e916cefe3da", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Tania553 Harris789" + }, + "billablePeriod": { + "start": "2013-06-08T23:35:42-04:00", + "end": "2013-06-08T23:50:42-04:00" + }, + "created": "2013-06-08T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "698314001", + "display": "Consultation for treatment" + } + ], + "text": "Consultation for treatment" + }, + "encounter": [ + { + "reference": "urn:uuid:fbdc402b-eade-4b36-bf6f-5847f320250b" + } + ] + } + ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:3c6e1497-48fd-47e5-9289-d4b8e01a4773", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "3c6e1497-48fd-47e5-9289-d4b8e01a4773", + "contained": [ + { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "performer": [ + { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + } + ] + }, + { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "NO_INSURANCE" + }, + "beneficiary": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "payor": [ + { + "display": "NO_INSURANCE" + } + ] + } + ], + "identifier": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "470a4ec6-8fc4-43af-a3bb-9e916cefe3da" + }, + { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } + ], + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2013-06-08T23:50:42-04:00", + "end": "2014-06-08T23:50:42-04:00" + }, + "created": "2013-06-08T23:50:42-04:00", + "insurer": { + "display": "NO_INSURANCE" + }, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "referral": { + "reference": "#referral" + }, + "claim": { + "reference": "urn:uuid:470a4ec6-8fc4-43af-a3bb-9e916cefe3da" + }, + "outcome": "complete", + "careTeam": [ + { + "sequence": 1, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "role": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } + ] + } + } + ], + "insurance": [ + { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "698314001", + "display": "Consultation for treatment" + } + ], + "text": "Consultation for treatment" + }, + "servicedPeriod": { + "start": "2013-06-08T23:35:42-04:00", + "end": "2013-06-08T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } + ] + }, + "encounter": [ + { + "reference": "urn:uuid:fbdc402b-eade-4b36-bf6f-5847f320250b" + } + ] + } + ], + "total": [ + { + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } + ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } + ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, + { + "fullUrl": "urn:uuid:05798c97-9ffa-44e5-8ace-178c22d68677", + "resource": { + "resourceType": "Encounter", + "id": "05798c97-9ffa-44e5-8ace-178c22d68677", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + }, + "participant": [ + { + "individual": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce", + "display": "Dr. Jacalyn740 Lindgren255" + } + } + ], + "period": { + "start": "2013-07-13T23:35:42-04:00", + "end": "2013-07-13T23:50:42-04:00" + }, + "serviceProvider": { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, + { + "fullUrl": "urn:uuid:a6c88da0-c5bf-44f2-8bdc-12779422f82e", + "resource": { + "resourceType": "Observation", + "id": "a6c88da0-c5bf-44f2-8bdc-12779422f82e", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8302-2", + "display": "Body Height" + } + ], + "text": "Body Height" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:05798c97-9ffa-44e5-8ace-178c22d68677" + }, + "effectiveDateTime": "2013-07-13T23:35:42-04:00", + "issued": "2013-07-13T23:35:42.651-04:00", + "valueQuantity": { + "value": 149.53922360833567, + "unit": "cm", + "system": "http://unitsofmeasure.org", + "code": "cm" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:b231dfde-a6f9-4758-9df9-6b92ce932001", + "resource": { + "resourceType": "Observation", + "id": "b231dfde-a6f9-4758-9df9-6b92ce932001", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72514-3", + "display": "Pain severity - 0-10 verbal numeric rating [Score] - Reported" + } + ], + "text": "Pain severity - 0-10 verbal numeric rating [Score] - Reported" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:05798c97-9ffa-44e5-8ace-178c22d68677" + }, + "effectiveDateTime": "2013-07-13T23:35:42-04:00", + "issued": "2013-07-13T23:35:42.651-04:00", + "valueQuantity": { + "value": 3.80148902201755, + "unit": "{score}", + "system": "http://unitsofmeasure.org", + "code": "{score}" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:5b8e2824-a5d5-40bd-9c09-cd647a9c2880", + "resource": { + "resourceType": "Observation", + "id": "5b8e2824-a5d5-40bd-9c09-cd647a9c2880", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "29463-7", + "display": "Body Weight" + } + ], + "text": "Body Weight" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:05798c97-9ffa-44e5-8ace-178c22d68677" + }, + "effectiveDateTime": "2013-07-13T23:35:42-04:00", + "issued": "2013-07-13T23:35:42.651-04:00", + "valueQuantity": { + "value": 61.112119701434196, + "unit": "kg", + "system": "http://unitsofmeasure.org", + "code": "kg" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:87c35b72-39cb-49b2-8762-11dc0eebeb9d", + "resource": { + "resourceType": "Observation", + "id": "87c35b72-39cb-49b2-8762-11dc0eebeb9d", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "39156-5", + "display": "Body Mass Index" + } + ], + "text": "Body Mass Index" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:05798c97-9ffa-44e5-8ace-178c22d68677" + }, + "effectiveDateTime": "2013-07-13T23:35:42-04:00", + "issued": "2013-07-13T23:35:42.651-04:00", + "valueQuantity": { + "value": 27.32858241904286, + "unit": "kg/m2", + "system": "http://unitsofmeasure.org", + "code": "kg/m2" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:be11197a-bd6b-4fc6-a319-c33d3746c162", + "resource": { + "resourceType": "Observation", + "id": "be11197a-bd6b-4fc6-a319-c33d3746c162", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "59576-9", + "display": "Body mass index (BMI) [Percentile] Per age and gender" + } + ], + "text": "Body mass index (BMI) [Percentile] Per age and gender" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:05798c97-9ffa-44e5-8ace-178c22d68677" + }, + "effectiveDateTime": "2013-07-13T23:35:42-04:00", + "issued": "2013-07-13T23:35:42.651-04:00", + "valueQuantity": { + "value": 94.80578705502126, + "unit": "%", + "system": "http://unitsofmeasure.org", + "code": "%" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:16c6363e-cb34-477f-8092-0e47c6eca26d", + "resource": { + "resourceType": "Observation", + "id": "16c6363e-cb34-477f-8092-0e47c6eca26d", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "55284-4", + "display": "Blood Pressure" + } + ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:05798c97-9ffa-44e5-8ace-178c22d68677" + }, + "effectiveDateTime": "2013-07-13T23:35:42-04:00", + "issued": "2013-07-13T23:35:42.651-04:00", + "component": [ + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } + ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 78.6269821922178, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } + ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 102.6504262402982, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } + ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:4f2cdd2d-5126-4fe3-a51e-5d2bc18ee654", + "resource": { + "resourceType": "Observation", + "id": "4f2cdd2d-5126-4fe3-a51e-5d2bc18ee654", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "survey", + "display": "survey" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72166-2", + "display": "Tobacco smoking status NHIS" + } + ], + "text": "Tobacco smoking status NHIS" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:05798c97-9ffa-44e5-8ace-178c22d68677" + }, + "effectiveDateTime": "2013-07-13T23:35:42-04:00", + "issued": "2013-07-13T23:35:42.651-04:00", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "266919005", + "display": "Never smoker" + } + ], + "text": "Never smoker" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:7befcda4-fe2f-4aa2-ac9c-e2ac361e4766", + "resource": { + "resourceType": "Immunization", + "id": "7befcda4-fe2f-4aa2-ac9c-e2ac361e4766", + "status": "completed", + "vaccineCode": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:05798c97-9ffa-44e5-8ace-178c22d68677" + }, + "occurrenceDateTime": "2013-07-13T23:35:42-04:00", + "primarySource": true + }, + "request": { + "method": "POST", + "url": "Immunization" + } + }, + { + "fullUrl": "urn:uuid:db1ab2b4-fb91-4f1a-8d50-0308f63b08d4", + "resource": { + "resourceType": "Claim", + "id": "db1ab2b4-fb91-4f1a-8d50-0308f63b08d4", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Tania553 Harris789" + }, + "billablePeriod": { + "start": "2013-07-13T23:35:42-04:00", + "end": "2013-07-13T23:50:42-04:00" + }, + "created": "2013-07-13T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "supportingInfo": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code": "info" + } + ] + }, + "valueReference": { + "reference": "urn:uuid:7befcda4-fe2f-4aa2-ac9c-e2ac361e4766" + } + } + ], + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Anthem" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + }, + "encounter": [ + { + "reference": "urn:uuid:05798c97-9ffa-44e5-8ace-178c22d68677" + } + ] + }, + { + "sequence": 2, + "informationSequence": [ + 1 + ], + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "net": { + "value": 140.52, + "currency": "USD" + } + } + ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:eea00fac-82d4-4ea8-87fd-d65ff46d4cc3", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "eea00fac-82d4-4ea8-87fd-d65ff46d4cc3", + "contained": [ + { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "performer": [ + { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + } + ] + }, + { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Anthem" + }, + "beneficiary": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "payor": [ + { + "display": "Anthem" + } + ] + } + ], + "identifier": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "db1ab2b4-fb91-4f1a-8d50-0308f63b08d4" + }, + { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } + ], + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2013-07-13T23:50:42-04:00", + "end": "2014-07-13T23:50:42-04:00" + }, + "created": "2013-07-13T23:50:42-04:00", + "insurer": { + "display": "Anthem" + }, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "referral": { + "reference": "#referral" + }, + "claim": { + "reference": "urn:uuid:db1ab2b4-fb91-4f1a-8d50-0308f63b08d4" + }, + "outcome": "complete", + "careTeam": [ + { + "sequence": 1, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "role": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } + ] + } + } + ], + "insurance": [ + { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Anthem" + } + } + ], + "item": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + }, + "servicedPeriod": { + "start": "2013-07-13T23:35:42-04:00", + "end": "2013-07-13T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "encounter": [ + { + "reference": "urn:uuid:05798c97-9ffa-44e5-8ace-178c22d68677" + } + ] + }, + { + "sequence": 2, + "informationSequence": [ + 1 + ], + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "servicedPeriod": { + "start": "2013-07-13T23:35:42-04:00", + "end": "2013-07-13T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "net": { + "value": 140.52, + "currency": "USD" + }, + "adjudication": [ + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display": "Line Beneficiary Coinsurance Amount" + } + ] + }, + "amount": { + "value": 28.104000000000003, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display": "Line Provider Payment Amount" + } + ] + }, + "amount": { + "value": 112.41600000000001, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display": "Line Submitted Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display": "Line Allowed Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display": "Line Beneficiary Part B Deductible Amount" + } + ] + }, + "amount": { + "value": 0, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display": "Line Processing Indicator Code" + } + ] + } + } + ] + } + ], + "total": [ + { + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } + ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } + ], + "payment": { + "amount": { + "value": 112.41600000000001, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, + { + "fullUrl": "urn:uuid:90536902-2ec3-4b22-ac5f-cb622b95bd86", + "resource": { + "resourceType": "Encounter", + "id": "90536902-2ec3-4b22-ac5f-cb622b95bd86", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } + ], + "text": "Encounter for symptom" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + }, + "participant": [ + { + "individual": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a", + "display": "Dr. Roberto515 Haag279" + } + } + ], + "period": { + "start": "2013-12-30T22:35:42-05:00", + "end": "2013-12-30T22:50:42-05:00" + }, + "reasonCode": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } + ] + } + ], + "serviceProvider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, + { + "fullUrl": "urn:uuid:8f1c74d4-aa24-4d84-beae-46e55be49cf9", + "resource": { + "resourceType": "Condition", + "id": "8f1c74d4-aa24-4d84-beae-46e55be49cf9", + "clinicalStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "resolved" + } + ] + }, + "verificationStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } + ] + }, + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } + ], + "text": "Viral sinusitis (disorder)" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:90536902-2ec3-4b22-ac5f-cb622b95bd86" + }, + "onsetDateTime": "2013-12-30T22:35:42-05:00", + "abatementDateTime": "2014-01-06T22:35:42-05:00", + "recordedDate": "2013-12-30T22:35:42-05:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, + { + "fullUrl": "urn:uuid:9fc36e17-0114-45ac-b639-82ed6fe33534", + "resource": { + "resourceType": "Claim", + "id": "9fc36e17-0114-45ac-b639-82ed6fe33534", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Tania553 Harris789" + }, + "billablePeriod": { + "start": "2013-12-30T22:35:42-05:00", + "end": "2013-12-30T22:50:42-05:00" + }, + "created": "2013-12-30T22:50:42-05:00", + "provider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "diagnosis": [ + { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:8f1c74d4-aa24-4d84-beae-46e55be49cf9" + } + } + ], + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } + ], + "text": "Encounter for symptom" + }, + "encounter": [ + { + "reference": "urn:uuid:90536902-2ec3-4b22-ac5f-cb622b95bd86" + } + ] + }, + { + "sequence": 2, + "diagnosisSequence": [ + 1 + ], + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } + ], + "text": "Viral sinusitis (disorder)" + } + } + ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:6224b49b-ba6e-4d4f-9dc8-fc07823fa73e", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "6224b49b-ba6e-4d4f-9dc8-fc07823fa73e", + "contained": [ + { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "performer": [ + { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + } + ] + }, + { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "NO_INSURANCE" + }, + "beneficiary": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "payor": [ + { + "display": "NO_INSURANCE" + } + ] + } + ], + "identifier": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "9fc36e17-0114-45ac-b639-82ed6fe33534" + }, + { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } + ], + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2013-12-30T22:50:42-05:00", + "end": "2014-12-30T22:50:42-05:00" + }, + "created": "2013-12-30T22:50:42-05:00", + "insurer": { + "display": "NO_INSURANCE" + }, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "referral": { + "reference": "#referral" + }, + "claim": { + "reference": "urn:uuid:9fc36e17-0114-45ac-b639-82ed6fe33534" + }, + "outcome": "complete", + "careTeam": [ + { + "sequence": 1, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "role": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } + ] + } + } + ], + "diagnosis": [ + { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:8f1c74d4-aa24-4d84-beae-46e55be49cf9" + }, + "type": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } + ] + } + ] + } + ], + "insurance": [ + { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } + ], + "text": "Encounter for symptom" + }, + "servicedPeriod": { + "start": "2013-12-30T22:35:42-05:00", + "end": "2013-12-30T22:50:42-05:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } + ] + }, + "encounter": [ + { + "reference": "urn:uuid:90536902-2ec3-4b22-ac5f-cb622b95bd86" + } + ] + }, + { + "sequence": 2, + "diagnosisSequence": [ + 1 + ], + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } + ], + "text": "Viral sinusitis (disorder)" + }, + "servicedPeriod": { + "start": "2013-12-30T22:35:42-05:00", + "end": "2013-12-30T22:50:42-05:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } + ] + } + } + ], + "total": [ + { + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } + ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } + ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, + { + "fullUrl": "urn:uuid:4e70fb25-c25d-4e4f-9f40-e682b0815786", + "resource": { + "resourceType": "Encounter", + "id": "4e70fb25-c25d-4e4f-9f40-e682b0815786", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + }, + "participant": [ + { + "individual": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce", + "display": "Dr. Jacalyn740 Lindgren255" + } + } + ], + "period": { + "start": "2014-07-19T23:35:42-04:00", + "end": "2014-07-19T23:50:42-04:00" + }, + "serviceProvider": { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, + { + "fullUrl": "urn:uuid:d1de3bba-1426-4810-9851-a29db15cd7a0", + "resource": { + "resourceType": "Observation", + "id": "d1de3bba-1426-4810-9851-a29db15cd7a0", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8302-2", + "display": "Body Height" + } + ], + "text": "Body Height" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:4e70fb25-c25d-4e4f-9f40-e682b0815786" + }, + "effectiveDateTime": "2014-07-19T23:35:42-04:00", + "issued": "2014-07-19T23:35:42.651-04:00", + "valueQuantity": { + "value": 151.02538832308642, + "unit": "cm", + "system": "http://unitsofmeasure.org", + "code": "cm" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:0373caf2-df18-4e13-850b-4eabdcec1e2e", + "resource": { + "resourceType": "Observation", + "id": "0373caf2-df18-4e13-850b-4eabdcec1e2e", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72514-3", + "display": "Pain severity - 0-10 verbal numeric rating [Score] - Reported" + } + ], + "text": "Pain severity - 0-10 verbal numeric rating [Score] - Reported" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:4e70fb25-c25d-4e4f-9f40-e682b0815786" + }, + "effectiveDateTime": "2014-07-19T23:35:42-04:00", + "issued": "2014-07-19T23:35:42.651-04:00", + "valueQuantity": { + "value": 1.0764250824750103, + "unit": "{score}", + "system": "http://unitsofmeasure.org", + "code": "{score}" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:8db25348-18f7-4b85-8d41-c2cd56e2aa98", + "resource": { + "resourceType": "Observation", + "id": "8db25348-18f7-4b85-8d41-c2cd56e2aa98", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "29463-7", + "display": "Body Weight" + } + ], + "text": "Body Weight" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:4e70fb25-c25d-4e4f-9f40-e682b0815786" + }, + "effectiveDateTime": "2014-07-19T23:35:42-04:00", + "issued": "2014-07-19T23:35:42.651-04:00", + "valueQuantity": { + "value": 64.29509381909817, + "unit": "kg", + "system": "http://unitsofmeasure.org", + "code": "kg" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:b35999b4-d8bf-4dc8-ad2d-a6ad13590c9e", + "resource": { + "resourceType": "Observation", + "id": "b35999b4-d8bf-4dc8-ad2d-a6ad13590c9e", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "39156-5", + "display": "Body Mass Index" + } + ], + "text": "Body Mass Index" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:4e70fb25-c25d-4e4f-9f40-e682b0815786" + }, + "effectiveDateTime": "2014-07-19T23:35:42-04:00", + "issued": "2014-07-19T23:35:42.651-04:00", + "valueQuantity": { + "value": 28.18888593137271, + "unit": "kg/m2", + "system": "http://unitsofmeasure.org", + "code": "kg/m2" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:2fb7e72f-c2ed-4981-9105-4f3e157b213f", + "resource": { + "resourceType": "Observation", + "id": "2fb7e72f-c2ed-4981-9105-4f3e157b213f", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "59576-9", + "display": "Body mass index (BMI) [Percentile] Per age and gender" + } + ], + "text": "Body mass index (BMI) [Percentile] Per age and gender" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:4e70fb25-c25d-4e4f-9f40-e682b0815786" + }, + "effectiveDateTime": "2014-07-19T23:35:42-04:00", + "issued": "2014-07-19T23:35:42.651-04:00", + "valueQuantity": { + "value": 94.87600349596794, + "unit": "%", + "system": "http://unitsofmeasure.org", + "code": "%" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:406177ca-af0f-44c5-8eb5-caee0bcdc0ec", + "resource": { + "resourceType": "Observation", + "id": "406177ca-af0f-44c5-8eb5-caee0bcdc0ec", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "55284-4", + "display": "Blood Pressure" + } + ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:4e70fb25-c25d-4e4f-9f40-e682b0815786" + }, + "effectiveDateTime": "2014-07-19T23:35:42-04:00", + "issued": "2014-07-19T23:35:42.651-04:00", + "component": [ + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } + ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 81.53618225928905, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } + ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 126.54581730674404, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } + ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:d8e8afdc-ef9e-4fd2-a8e2-210329c7bae6", + "resource": { + "resourceType": "Observation", + "id": "d8e8afdc-ef9e-4fd2-a8e2-210329c7bae6", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "survey", + "display": "survey" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72166-2", + "display": "Tobacco smoking status NHIS" + } + ], + "text": "Tobacco smoking status NHIS" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:4e70fb25-c25d-4e4f-9f40-e682b0815786" + }, + "effectiveDateTime": "2014-07-19T23:35:42-04:00", + "issued": "2014-07-19T23:35:42.651-04:00", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "266919005", + "display": "Never smoker" + } + ], + "text": "Never smoker" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:b7d14314-fc30-4599-9375-2708f745fcb1", + "resource": { + "resourceType": "Immunization", + "id": "b7d14314-fc30-4599-9375-2708f745fcb1", + "status": "completed", + "vaccineCode": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:4e70fb25-c25d-4e4f-9f40-e682b0815786" + }, + "occurrenceDateTime": "2014-07-19T23:35:42-04:00", + "primarySource": true + }, + "request": { + "method": "POST", + "url": "Immunization" + } + }, + { + "fullUrl": "urn:uuid:35cd5e92-833a-4dbb-aa29-e35b78237a85", + "resource": { + "resourceType": "Claim", + "id": "35cd5e92-833a-4dbb-aa29-e35b78237a85", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Tania553 Harris789" + }, + "billablePeriod": { + "start": "2014-07-19T23:35:42-04:00", + "end": "2014-07-19T23:50:42-04:00" + }, + "created": "2014-07-19T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "supportingInfo": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code": "info" + } + ] + }, + "valueReference": { + "reference": "urn:uuid:b7d14314-fc30-4599-9375-2708f745fcb1" + } + } + ], + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Anthem" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + }, + "encounter": [ + { + "reference": "urn:uuid:4e70fb25-c25d-4e4f-9f40-e682b0815786" + } + ] + }, + { + "sequence": 2, + "informationSequence": [ + 1 + ], + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "net": { + "value": 140.52, + "currency": "USD" + } + } + ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:cb7fbd60-0314-4a33-ae2b-43903fee9173", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "cb7fbd60-0314-4a33-ae2b-43903fee9173", + "contained": [ + { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "performer": [ + { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + } + ] + }, + { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Anthem" + }, + "beneficiary": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "payor": [ + { + "display": "Anthem" + } + ] + } + ], + "identifier": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "35cd5e92-833a-4dbb-aa29-e35b78237a85" + }, + { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } + ], + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2014-07-19T23:50:42-04:00", + "end": "2015-07-19T23:50:42-04:00" + }, + "created": "2014-07-19T23:50:42-04:00", + "insurer": { + "display": "Anthem" + }, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "referral": { + "reference": "#referral" + }, + "claim": { + "reference": "urn:uuid:35cd5e92-833a-4dbb-aa29-e35b78237a85" + }, + "outcome": "complete", + "careTeam": [ + { + "sequence": 1, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "role": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } + ] + } + } + ], + "insurance": [ + { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Anthem" + } + } + ], + "item": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + }, + "servicedPeriod": { + "start": "2014-07-19T23:35:42-04:00", + "end": "2014-07-19T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "encounter": [ + { + "reference": "urn:uuid:4e70fb25-c25d-4e4f-9f40-e682b0815786" + } + ] + }, + { + "sequence": 2, + "informationSequence": [ + 1 + ], + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "servicedPeriod": { + "start": "2014-07-19T23:35:42-04:00", + "end": "2014-07-19T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "net": { + "value": 140.52, + "currency": "USD" + }, + "adjudication": [ + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display": "Line Beneficiary Coinsurance Amount" + } + ] + }, + "amount": { + "value": 28.104000000000003, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display": "Line Provider Payment Amount" + } + ] + }, + "amount": { + "value": 112.41600000000001, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display": "Line Submitted Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display": "Line Allowed Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display": "Line Beneficiary Part B Deductible Amount" + } + ] + }, + "amount": { + "value": 0, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display": "Line Processing Indicator Code" + } + ] + } + } + ] + } + ], + "total": [ + { + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } + ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } + ], + "payment": { + "amount": { + "value": 112.41600000000001, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, + { + "fullUrl": "urn:uuid:00e0bf1f-e605-4565-9eac-43b477101231", + "resource": { + "resourceType": "Encounter", + "id": "00e0bf1f-e605-4565-9eac-43b477101231", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "698314001", + "display": "Consultation for treatment" + } + ], + "text": "Consultation for treatment" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + }, + "participant": [ + { + "individual": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a", + "display": "Dr. Roberto515 Haag279" + } + } + ], + "period": { + "start": "2015-05-29T23:35:42-04:00", + "end": "2015-05-29T23:50:42-04:00" + }, + "serviceProvider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, + { + "fullUrl": "urn:uuid:8410aa11-b714-4f99-8dd4-a5d9aedff045", + "resource": { + "resourceType": "MedicationRequest", + "id": "8410aa11-b714-4f99-8dd4-a5d9aedff045", + "status": "stopped", + "intent": "order", + "medicationCodeableConcept": { + "coding": [ + { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "749762", + "display": "Seasonique 91 Day Pack" + } + ], + "text": "Seasonique 91 Day Pack" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:00e0bf1f-e605-4565-9eac-43b477101231" + }, + "authoredOn": "2015-05-29T23:35:42-04:00", + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a", + "display": "Dr. Roberto515 Haag279" + } + }, + "request": { + "method": "POST", + "url": "MedicationRequest" + } + }, + { + "fullUrl": "urn:uuid:d0bf151e-2f9b-44e2-812c-bbbb663dd112", + "resource": { + "resourceType": "Claim", + "id": "d0bf151e-2f9b-44e2-812c-bbbb663dd112", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "pharmacy" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2015-05-29T23:35:42-04:00", + "end": "2015-05-29T23:50:42-04:00" + }, + "created": "2015-05-29T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "prescription": { + "reference": "urn:uuid:8410aa11-b714-4f99-8dd4-a5d9aedff045" + }, + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "698314001", + "display": "Consultation for treatment" + } + ], + "text": "Consultation for treatment" + }, + "encounter": [ + { + "reference": "urn:uuid:00e0bf1f-e605-4565-9eac-43b477101231" + } + ] + } + ], + "total": { + "value": 47.38, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:5289075e-dd69-45d2-8681-c88ad0642d7e", + "resource": { + "resourceType": "Claim", + "id": "5289075e-dd69-45d2-8681-c88ad0642d7e", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Tania553 Harris789" + }, + "billablePeriod": { + "start": "2015-05-29T23:35:42-04:00", + "end": "2015-05-29T23:50:42-04:00" + }, + "created": "2015-05-29T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "698314001", + "display": "Consultation for treatment" + } + ], + "text": "Consultation for treatment" + }, + "encounter": [ + { + "reference": "urn:uuid:00e0bf1f-e605-4565-9eac-43b477101231" + } + ] + } + ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:334097dd-a9a8-46fe-b728-6a31290acc5a", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "334097dd-a9a8-46fe-b728-6a31290acc5a", + "contained": [ + { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "performer": [ + { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + } + ] + }, + { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "NO_INSURANCE" + }, + "beneficiary": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "payor": [ + { + "display": "NO_INSURANCE" + } + ] + } + ], + "identifier": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "5289075e-dd69-45d2-8681-c88ad0642d7e" + }, + { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } + ], + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2015-05-29T23:50:42-04:00", + "end": "2016-05-29T23:50:42-04:00" + }, + "created": "2015-05-29T23:50:42-04:00", + "insurer": { + "display": "NO_INSURANCE" + }, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "referral": { + "reference": "#referral" + }, + "claim": { + "reference": "urn:uuid:5289075e-dd69-45d2-8681-c88ad0642d7e" + }, + "outcome": "complete", + "careTeam": [ + { + "sequence": 1, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "role": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } + ] + } + } + ], + "insurance": [ + { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "698314001", + "display": "Consultation for treatment" + } + ], + "text": "Consultation for treatment" + }, + "servicedPeriod": { + "start": "2015-05-29T23:35:42-04:00", + "end": "2015-05-29T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } + ] + }, + "encounter": [ + { + "reference": "urn:uuid:00e0bf1f-e605-4565-9eac-43b477101231" + } + ] + } + ], + "total": [ + { + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } + ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } + ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, + { + "fullUrl": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb", + "resource": { + "resourceType": "Encounter", + "id": "3b60dd3a-011c-46ff-964e-e1aaf5c505eb", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + }, + "participant": [ + { + "individual": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce", + "display": "Dr. Jacalyn740 Lindgren255" + } + } + ], + "period": { + "start": "2015-07-25T23:35:42-04:00", + "end": "2015-07-25T23:50:42-04:00" + }, + "serviceProvider": { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, + { + "fullUrl": "urn:uuid:7db9e0c1-b214-4d3c-a166-4915318c31db", + "resource": { + "resourceType": "Observation", + "id": "7db9e0c1-b214-4d3c-a166-4915318c31db", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8302-2", + "display": "Body Height" + } + ], + "text": "Body Height" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "effectiveDateTime": "2015-07-25T23:35:42-04:00", + "issued": "2015-07-25T23:35:42.651-04:00", + "valueQuantity": { + "value": 151.66269152600725, + "unit": "cm", + "system": "http://unitsofmeasure.org", + "code": "cm" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:0c669903-5dc2-4d48-af6f-492f859063b3", + "resource": { + "resourceType": "Observation", + "id": "0c669903-5dc2-4d48-af6f-492f859063b3", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72514-3", + "display": "Pain severity - 0-10 verbal numeric rating [Score] - Reported" + } + ], + "text": "Pain severity - 0-10 verbal numeric rating [Score] - Reported" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "effectiveDateTime": "2015-07-25T23:35:42-04:00", + "issued": "2015-07-25T23:35:42.651-04:00", + "valueQuantity": { + "value": 1.9210486999377254, + "unit": "{score}", + "system": "http://unitsofmeasure.org", + "code": "{score}" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:24fb2601-e110-4ba9-ae9b-2e0465547468", + "resource": { + "resourceType": "Observation", + "id": "24fb2601-e110-4ba9-ae9b-2e0465547468", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "29463-7", + "display": "Body Weight" + } + ], + "text": "Body Weight" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "effectiveDateTime": "2015-07-25T23:35:42-04:00", + "issued": "2015-07-25T23:35:42.651-04:00", + "valueQuantity": { + "value": 66.63265335291655, + "unit": "kg", + "system": "http://unitsofmeasure.org", + "code": "kg" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:a09305ea-96d3-49ca-8479-aeceb1e8e98e", + "resource": { + "resourceType": "Observation", + "id": "a09305ea-96d3-49ca-8479-aeceb1e8e98e", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "39156-5", + "display": "Body Mass Index" + } + ], + "text": "Body Mass Index" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "effectiveDateTime": "2015-07-25T23:35:42-04:00", + "issued": "2015-07-25T23:35:42.651-04:00", + "valueQuantity": { + "value": 28.968738897616298, + "unit": "kg/m2", + "system": "http://unitsofmeasure.org", + "code": "kg/m2" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:e94c80e5-d157-4a48-b2f0-2056ff8b9239", + "resource": { + "resourceType": "Observation", + "id": "e94c80e5-d157-4a48-b2f0-2056ff8b9239", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "59576-9", + "display": "Body mass index (BMI) [Percentile] Per age and gender" + } + ], + "text": "Body mass index (BMI) [Percentile] Per age and gender" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "effectiveDateTime": "2015-07-25T23:35:42-04:00", + "issued": "2015-07-25T23:35:42.651-04:00", + "valueQuantity": { + "value": 94.90765715742681, + "unit": "%", + "system": "http://unitsofmeasure.org", + "code": "%" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:af60a5b9-0b2d-4e34-8d45-d7e9883750cf", + "resource": { + "resourceType": "Observation", + "id": "af60a5b9-0b2d-4e34-8d45-d7e9883750cf", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "55284-4", + "display": "Blood Pressure" + } + ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "effectiveDateTime": "2015-07-25T23:35:42-04:00", + "issued": "2015-07-25T23:35:42.651-04:00", + "component": [ + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } + ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 71.79847614624363, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } + ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 123.84680008350652, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } + ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:1465815c-1eb2-48cf-a61a-f82768480d86", + "resource": { + "resourceType": "Observation", + "id": "1465815c-1eb2-48cf-a61a-f82768480d86", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "6690-2", + "display": "Leukocytes [#/volume] in Blood by Automated count" + } + ], + "text": "Leukocytes [#/volume] in Blood by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "effectiveDateTime": "2015-07-25T23:35:42-04:00", + "issued": "2015-07-25T23:35:42.651-04:00", + "valueQuantity": { + "value": 5.451825308548753, + "unit": "10*3/uL", + "system": "http://unitsofmeasure.org", + "code": "10*3/uL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:84e92050-85cd-4449-8a45-66653427c8cd", + "resource": { + "resourceType": "Observation", + "id": "84e92050-85cd-4449-8a45-66653427c8cd", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "789-8", + "display": "Erythrocytes [#/volume] in Blood by Automated count" + } + ], + "text": "Erythrocytes [#/volume] in Blood by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "effectiveDateTime": "2015-07-25T23:35:42-04:00", + "issued": "2015-07-25T23:35:42.651-04:00", + "valueQuantity": { + "value": 5.31445237218615, + "unit": "10*6/uL", + "system": "http://unitsofmeasure.org", + "code": "10*6/uL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:37f13565-68b4-4266-b3bd-71a28c79fef0", + "resource": { + "resourceType": "Observation", + "id": "37f13565-68b4-4266-b3bd-71a28c79fef0", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "718-7", + "display": "Hemoglobin [Mass/volume] in Blood" + } + ], + "text": "Hemoglobin [Mass/volume] in Blood" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "effectiveDateTime": "2015-07-25T23:35:42-04:00", + "issued": "2015-07-25T23:35:42.651-04:00", + "valueQuantity": { + "value": 14.292709690805538, + "unit": "g/dL", + "system": "http://unitsofmeasure.org", + "code": "g/dL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:19cdc95a-0248-450f-b67c-3a824c906bf5", + "resource": { + "resourceType": "Observation", + "id": "19cdc95a-0248-450f-b67c-3a824c906bf5", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "4544-3", + "display": "Hematocrit [Volume Fraction] of Blood by Automated count" + } + ], + "text": "Hematocrit [Volume Fraction] of Blood by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "effectiveDateTime": "2015-07-25T23:35:42-04:00", + "issued": "2015-07-25T23:35:42.651-04:00", + "valueQuantity": { + "value": 44.866775641527624, + "unit": "%", + "system": "http://unitsofmeasure.org", + "code": "%" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:ce9f7e1f-2492-44a4-a087-8f709b6e30ff", + "resource": { + "resourceType": "Observation", + "id": "ce9f7e1f-2492-44a4-a087-8f709b6e30ff", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "787-2", + "display": "MCV [Entitic volume] by Automated count" + } + ], + "text": "MCV [Entitic volume] by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "effectiveDateTime": "2015-07-25T23:35:42-04:00", + "issued": "2015-07-25T23:35:42.651-04:00", + "valueQuantity": { + "value": 90.25248694163055, + "unit": "fL", + "system": "http://unitsofmeasure.org", + "code": "fL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:8252f417-a6c4-45dc-9e6d-4175a7e2b922", + "resource": { + "resourceType": "Observation", + "id": "8252f417-a6c4-45dc-9e6d-4175a7e2b922", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "785-6", + "display": "MCH [Entitic mass] by Automated count" + } + ], + "text": "MCH [Entitic mass] by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "effectiveDateTime": "2015-07-25T23:35:42-04:00", + "issued": "2015-07-25T23:35:42.651-04:00", + "valueQuantity": { + "value": 32.82622570479111, + "unit": "pg", + "system": "http://unitsofmeasure.org", + "code": "pg" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:ce3c716e-a7b6-46cd-9b19-c1272fb57b82", + "resource": { + "resourceType": "Observation", + "id": "ce3c716e-a7b6-46cd-9b19-c1272fb57b82", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "786-4", + "display": "MCHC [Mass/volume] by Automated count" + } + ], + "text": "MCHC [Mass/volume] by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "effectiveDateTime": "2015-07-25T23:35:42-04:00", + "issued": "2015-07-25T23:35:42.651-04:00", + "valueQuantity": { + "value": 34.71848655675484, + "unit": "g/dL", + "system": "http://unitsofmeasure.org", + "code": "g/dL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:ba2368e8-b57d-4ae9-9ad7-f871cf0c8b3b", + "resource": { + "resourceType": "Observation", + "id": "ba2368e8-b57d-4ae9-9ad7-f871cf0c8b3b", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "21000-5", + "display": "Erythrocyte distribution width [Entitic volume] by Automated count" + } + ], + "text": "Erythrocyte distribution width [Entitic volume] by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "effectiveDateTime": "2015-07-25T23:35:42-04:00", + "issued": "2015-07-25T23:35:42.651-04:00", + "valueQuantity": { + "value": 44.86740369479697, + "unit": "fL", + "system": "http://unitsofmeasure.org", + "code": "fL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:623dc13b-14b7-4b6b-a451-d325c3373987", + "resource": { + "resourceType": "Observation", + "id": "623dc13b-14b7-4b6b-a451-d325c3373987", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "777-3", + "display": "Platelets [#/volume] in Blood by Automated count" + } + ], + "text": "Platelets [#/volume] in Blood by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "effectiveDateTime": "2015-07-25T23:35:42-04:00", + "issued": "2015-07-25T23:35:42.651-04:00", + "valueQuantity": { + "value": 258.7522579452467, + "unit": "10*3/uL", + "system": "http://unitsofmeasure.org", + "code": "10*3/uL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:9a507a71-31d7-4a21-88df-8d8ea334e03c", + "resource": { + "resourceType": "Observation", + "id": "9a507a71-31d7-4a21-88df-8d8ea334e03c", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "32207-3", + "display": "Platelet distribution width [Entitic volume] in Blood by Automated count" + } + ], + "text": "Platelet distribution width [Entitic volume] in Blood by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "effectiveDateTime": "2015-07-25T23:35:42-04:00", + "issued": "2015-07-25T23:35:42.651-04:00", + "valueQuantity": { + "value": 400.3792798918357, + "unit": "fL", + "system": "http://unitsofmeasure.org", + "code": "fL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:703cc745-4daa-4860-9a41-a3dd2e03a3d5", + "resource": { + "resourceType": "Observation", + "id": "703cc745-4daa-4860-9a41-a3dd2e03a3d5", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "32623-1", + "display": "Platelet mean volume [Entitic volume] in Blood by Automated count" + } + ], + "text": "Platelet mean volume [Entitic volume] in Blood by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "effectiveDateTime": "2015-07-25T23:35:42-04:00", + "issued": "2015-07-25T23:35:42.651-04:00", + "valueQuantity": { + "value": 10.766353162839396, + "unit": "fL", + "system": "http://unitsofmeasure.org", + "code": "fL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:ec539e68-68eb-4abb-8928-d828eab266ce", + "resource": { + "resourceType": "Observation", + "id": "ec539e68-68eb-4abb-8928-d828eab266ce", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "survey", + "display": "survey" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72166-2", + "display": "Tobacco smoking status NHIS" + } + ], + "text": "Tobacco smoking status NHIS" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "effectiveDateTime": "2015-07-25T23:35:42-04:00", + "issued": "2015-07-25T23:35:42.651-04:00", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "266919005", + "display": "Never smoker" + } + ], + "text": "Never smoker" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:ea6fd4e9-dc30-47ed-a2af-ed536195db73", + "resource": { + "resourceType": "Immunization", + "id": "ea6fd4e9-dc30-47ed-a2af-ed536195db73", + "status": "completed", + "vaccineCode": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "occurrenceDateTime": "2015-07-25T23:35:42-04:00", + "primarySource": true + }, + "request": { + "method": "POST", + "url": "Immunization" + } + }, + { + "fullUrl": "urn:uuid:1f20dc56-ec7c-4e78-b0fa-c12d611cd87d", + "resource": { + "resourceType": "Immunization", + "id": "1f20dc56-ec7c-4e78-b0fa-c12d611cd87d", + "status": "completed", + "vaccineCode": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "114", + "display": "meningococcal MCV4P" + } + ], + "text": "meningococcal MCV4P" + }, + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "occurrenceDateTime": "2015-07-25T23:35:42-04:00", + "primarySource": true + }, + "request": { + "method": "POST", + "url": "Immunization" + } + }, + { + "fullUrl": "urn:uuid:c1c8e28f-6217-43ed-9734-a55845fd7732", + "resource": { + "resourceType": "DiagnosticReport", + "id": "c1c8e28f-6217-43ed-9734-a55845fd7732", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0074", + "code": "LAB", + "display": "Laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "58410-2", + "display": "Complete blood count (hemogram) panel - Blood by Automated count" + } + ], + "text": "Complete blood count (hemogram) panel - Blood by Automated count" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + }, + "effectiveDateTime": "2015-07-25T23:35:42-04:00", + "issued": "2015-07-25T23:35:42.651-04:00", + "result": [ + { + "reference": "urn:uuid:1465815c-1eb2-48cf-a61a-f82768480d86", + "display": "Leukocytes [#/volume] in Blood by Automated count" + }, + { + "reference": "urn:uuid:84e92050-85cd-4449-8a45-66653427c8cd", + "display": "Erythrocytes [#/volume] in Blood by Automated count" + }, + { + "reference": "urn:uuid:37f13565-68b4-4266-b3bd-71a28c79fef0", + "display": "Hemoglobin [Mass/volume] in Blood" + }, + { + "reference": "urn:uuid:19cdc95a-0248-450f-b67c-3a824c906bf5", + "display": "Hematocrit [Volume Fraction] of Blood by Automated count" + }, + { + "reference": "urn:uuid:ce9f7e1f-2492-44a4-a087-8f709b6e30ff", + "display": "MCV [Entitic volume] by Automated count" + }, + { + "reference": "urn:uuid:8252f417-a6c4-45dc-9e6d-4175a7e2b922", + "display": "MCH [Entitic mass] by Automated count" + }, + { + "reference": "urn:uuid:ce3c716e-a7b6-46cd-9b19-c1272fb57b82", + "display": "MCHC [Mass/volume] by Automated count" + }, + { + "reference": "urn:uuid:ba2368e8-b57d-4ae9-9ad7-f871cf0c8b3b", + "display": "Erythrocyte distribution width [Entitic volume] by Automated count" + }, + { + "reference": "urn:uuid:623dc13b-14b7-4b6b-a451-d325c3373987", + "display": "Platelets [#/volume] in Blood by Automated count" + }, + { + "reference": "urn:uuid:9a507a71-31d7-4a21-88df-8d8ea334e03c", + "display": "Platelet distribution width [Entitic volume] in Blood by Automated count" + }, + { + "reference": "urn:uuid:703cc745-4daa-4860-9a41-a3dd2e03a3d5", + "display": "Platelet mean volume [Entitic volume] in Blood by Automated count" + } + ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, + { + "fullUrl": "urn:uuid:225b8676-0db8-4195-b5d2-d250f7fb1af2", + "resource": { + "resourceType": "Claim", + "id": "225b8676-0db8-4195-b5d2-d250f7fb1af2", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Tania553 Harris789" + }, + "billablePeriod": { + "start": "2015-07-25T23:35:42-04:00", + "end": "2015-07-25T23:50:42-04:00" + }, + "created": "2015-07-25T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "supportingInfo": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code": "info" + } + ] + }, + "valueReference": { + "reference": "urn:uuid:ea6fd4e9-dc30-47ed-a2af-ed536195db73" + } + }, + { + "sequence": 2, + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code": "info" + } + ] + }, + "valueReference": { + "reference": "urn:uuid:1f20dc56-ec7c-4e78-b0fa-c12d611cd87d" + } + } + ], + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Anthem" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + }, + "encounter": [ + { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + } + ] + }, + { + "sequence": 2, + "informationSequence": [ + 1 + ], + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "net": { + "value": 140.52, + "currency": "USD" + } + }, + { + "sequence": 3, + "informationSequence": [ + 2 + ], + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "114", + "display": "meningococcal MCV4P" + } + ], + "text": "meningococcal MCV4P" + }, + "net": { + "value": 140.52, + "currency": "USD" + } + } + ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:eafe7583-1871-44b3-9703-cf183a9881c1", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "eafe7583-1871-44b3-9703-cf183a9881c1", + "contained": [ + { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "performer": [ + { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + } + ] + }, + { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Anthem" + }, + "beneficiary": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "payor": [ + { + "display": "Anthem" + } + ] + } + ], + "identifier": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "225b8676-0db8-4195-b5d2-d250f7fb1af2" + }, + { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } + ], + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2015-07-25T23:50:42-04:00", + "end": "2016-07-25T23:50:42-04:00" + }, + "created": "2015-07-25T23:50:42-04:00", + "insurer": { + "display": "Anthem" + }, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "referral": { + "reference": "#referral" + }, + "claim": { + "reference": "urn:uuid:225b8676-0db8-4195-b5d2-d250f7fb1af2" + }, + "outcome": "complete", + "careTeam": [ + { + "sequence": 1, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "role": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } + ] + } + } + ], + "insurance": [ + { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Anthem" + } + } + ], + "item": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + }, + "servicedPeriod": { + "start": "2015-07-25T23:35:42-04:00", + "end": "2015-07-25T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "encounter": [ + { + "reference": "urn:uuid:3b60dd3a-011c-46ff-964e-e1aaf5c505eb" + } + ] + }, + { + "sequence": 2, + "informationSequence": [ + 1 + ], + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "servicedPeriod": { + "start": "2015-07-25T23:35:42-04:00", + "end": "2015-07-25T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "net": { + "value": 140.52, + "currency": "USD" + }, + "adjudication": [ + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display": "Line Beneficiary Coinsurance Amount" + } + ] + }, + "amount": { + "value": 28.104000000000003, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display": "Line Provider Payment Amount" + } + ] + }, + "amount": { + "value": 112.41600000000001, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display": "Line Submitted Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display": "Line Allowed Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display": "Line Beneficiary Part B Deductible Amount" + } + ] + }, + "amount": { + "value": 0, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display": "Line Processing Indicator Code" + } + ] + } + } + ] + }, + { + "sequence": 3, + "informationSequence": [ + 2 + ], + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "114", + "display": "meningococcal MCV4P" + } + ], + "text": "meningococcal MCV4P" + }, + "servicedPeriod": { + "start": "2015-07-25T23:35:42-04:00", + "end": "2015-07-25T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "net": { + "value": 140.52, + "currency": "USD" + }, + "adjudication": [ + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display": "Line Beneficiary Coinsurance Amount" + } + ] + }, + "amount": { + "value": 28.104000000000003, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display": "Line Provider Payment Amount" + } + ] + }, + "amount": { + "value": 112.41600000000001, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display": "Line Submitted Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display": "Line Allowed Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display": "Line Beneficiary Part B Deductible Amount" + } + ] + }, + "amount": { + "value": 0, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display": "Line Processing Indicator Code" + } + ] + } + } + ] + } + ], + "total": [ + { + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } + ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } + ], + "payment": { + "amount": { + "value": 224.83200000000002, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, + { + "fullUrl": "urn:uuid:bc1bd547-9007-4dcd-af8e-2b50e02452c5", + "resource": { + "resourceType": "Encounter", + "id": "bc1bd547-9007-4dcd-af8e-2b50e02452c5", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "EMER" + }, + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "50849002", + "display": "Emergency room admission (procedure)" + } + ], + "text": "Emergency room admission (procedure)" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + }, + "participant": [ + { + "individual": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a", + "display": "Dr. Roberto515 Haag279" + } + } + ], + "period": { + "start": "2016-05-04T23:35:42-04:00", + "end": "2016-05-05T00:45:42-04:00" + }, + "serviceProvider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, + { + "fullUrl": "urn:uuid:9e8a7f98-8530-4464-bc31-079a9bbb16cd", + "resource": { + "resourceType": "Condition", + "id": "9e8a7f98-8530-4464-bc31-079a9bbb16cd", + "clinicalStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "resolved" + } + ] + }, + "verificationStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } + ] + }, + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "283385000", + "display": "Laceration of thigh" + } + ], + "text": "Laceration of thigh" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:bc1bd547-9007-4dcd-af8e-2b50e02452c5" + }, + "onsetDateTime": "2016-05-04T23:35:42-04:00", + "abatementDateTime": "2016-05-25T23:35:42-04:00", + "recordedDate": "2016-05-04T23:35:42-04:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, + { + "fullUrl": "urn:uuid:ddf6a420-693e-4acd-b865-74af823256d9", + "resource": { + "resourceType": "Procedure", + "id": "ddf6a420-693e-4acd-b865-74af823256d9", + "status": "completed", + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "288086009", + "display": "Suture open wound" + } + ], + "text": "Suture open wound" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:bc1bd547-9007-4dcd-af8e-2b50e02452c5" + }, + "performedPeriod": { + "start": "2016-05-04T23:35:42-04:00", + "end": "2016-05-04T23:45:42-04:00" + }, + "reasonReference": [ + { + "reference": "urn:uuid:9e8a7f98-8530-4464-bc31-079a9bbb16cd", + "display": "Laceration of thigh" + } + ] + }, + "request": { + "method": "POST", + "url": "Procedure" + } + }, + { + "fullUrl": "urn:uuid:395d20f9-8b5c-4808-8554-a04979abd7b8", + "resource": { + "resourceType": "MedicationRequest", + "id": "395d20f9-8b5c-4808-8554-a04979abd7b8", + "status": "stopped", + "intent": "order", + "medicationCodeableConcept": { + "coding": [ + { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "313782", + "display": "Acetaminophen 325 MG Oral Tablet" + } + ], + "text": "Acetaminophen 325 MG Oral Tablet" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:bc1bd547-9007-4dcd-af8e-2b50e02452c5" + }, + "authoredOn": "2016-05-04T23:35:42-04:00", + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a", + "display": "Dr. Roberto515 Haag279" + }, + "dosageInstruction": [ + { + "sequence": 1, + "asNeededBoolean": true + } + ] + }, + "request": { + "method": "POST", + "url": "MedicationRequest" + } + }, + { + "fullUrl": "urn:uuid:b6165129-7f34-4bcd-b466-6044533d461f", + "resource": { + "resourceType": "Claim", + "id": "b6165129-7f34-4bcd-b466-6044533d461f", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "pharmacy" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2016-05-04T23:35:42-04:00", + "end": "2016-05-05T00:45:42-04:00" + }, + "created": "2016-05-05T00:45:42-04:00", + "provider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "prescription": { + "reference": "urn:uuid:395d20f9-8b5c-4808-8554-a04979abd7b8" + }, + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "50849002", + "display": "Emergency room admission (procedure)" + } + ], + "text": "Emergency room admission (procedure)" + }, + "encounter": [ + { + "reference": "urn:uuid:bc1bd547-9007-4dcd-af8e-2b50e02452c5" + } + ] + } + ], + "total": { + "value": 4.72, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:e8f8b682-c325-4b58-b328-69541ecf548d", + "resource": { + "resourceType": "CareTeam", + "id": "e8f8b682-c325-4b58-b328-69541ecf548d", + "status": "inactive", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:bc1bd547-9007-4dcd-af8e-2b50e02452c5" + }, + "period": { + "start": "2016-05-04T23:35:42-04:00", + "end": "2016-05-25T23:35:42-04:00" + }, + "participant": [ + { + "role": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "116153009", + "display": "Patient" + } + ], + "text": "Patient" + } + ], + "member": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + } + }, + { + "role": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "303118004", + "display": "Person in the healthcare environment (person)" + } + ], + "text": "Person in the healthcare environment (person)" + } + ], + "member": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a", + "display": "Dr. Roberto515 Haag279" + } + }, + { + "role": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "303118004", + "display": "Healthcare related organization (qualifier value)" + } + ], + "text": "Healthcare related organization (qualifier value)" + } + ], + "member": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + } + } + ], + "reasonCode": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "283385000", + "display": "Laceration of thigh" + } + ], + "text": "Laceration of thigh" + } + ], + "managingOrganization": [ + { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + } + ] + }, + "request": { + "method": "POST", + "url": "CareTeam" + } + }, + { + "fullUrl": "urn:uuid:09cbcbb8-e08c-4c1e-9084-77d4f046d15b", + "resource": { + "resourceType": "CarePlan", + "id": "09cbcbb8-e08c-4c1e-9084-77d4f046d15b", + "text": { + "status": "generated", + "div": "
Care Plan for Wound care.
Activities:
Care plan is meant to treat Laceration of thigh.
" + }, + "status": "completed", + "intent": "order", + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "225358003", + "display": "Wound care" + } + ], + "text": "Wound care" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:bc1bd547-9007-4dcd-af8e-2b50e02452c5" + }, + "period": { + "start": "2016-05-04T23:35:42-04:00", + "end": "2016-05-25T23:35:42-04:00" + }, + "careTeam": [ + { + "reference": "urn:uuid:e8f8b682-c325-4b58-b328-69541ecf548d" + } + ], + "addresses": [ + { + "reference": "urn:uuid:9e8a7f98-8530-4464-bc31-079a9bbb16cd" + } + ], + "activity": [ + { + "detail": { + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "385949008", + "display": "Dressing change management" + } + ], + "text": "Dressing change management" + }, + "status": "completed", + "location": { + "display": "HOLY FAMILY HOSPITAL" + } + } + }, + { + "detail": { + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "439830001", + "display": "Behavior to prevent infection" + } + ], + "text": "Behavior to prevent infection" + }, + "status": "completed", + "location": { + "display": "HOLY FAMILY HOSPITAL" + } + } + } + ] + }, + "request": { + "method": "POST", + "url": "CarePlan" + } + }, + { + "fullUrl": "urn:uuid:e2386e4d-f51b-4693-ba29-832596fd5581", + "resource": { + "resourceType": "Claim", + "id": "e2386e4d-f51b-4693-ba29-832596fd5581", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Tania553 Harris789" + }, + "billablePeriod": { + "start": "2016-05-04T23:35:42-04:00", + "end": "2016-05-05T00:45:42-04:00" + }, + "created": "2016-05-05T00:45:42-04:00", + "provider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "diagnosis": [ + { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:9e8a7f98-8530-4464-bc31-079a9bbb16cd" + } + } + ], + "procedure": [ + { + "sequence": 1, + "procedureReference": { + "reference": "urn:uuid:ddf6a420-693e-4acd-b865-74af823256d9" + } + } + ], + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "50849002", + "display": "Emergency room admission (procedure)" + } + ], + "text": "Emergency room admission (procedure)" + }, + "encounter": [ + { + "reference": "urn:uuid:bc1bd547-9007-4dcd-af8e-2b50e02452c5" + } + ] + }, + { + "sequence": 2, + "diagnosisSequence": [ + 1 + ], + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "283385000", + "display": "Laceration of thigh" + } + ], + "text": "Laceration of thigh" + } + }, + { + "sequence": 3, + "procedureSequence": [ + 1 + ], + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "288086009", + "display": "Suture open wound" + } + ], + "text": "Suture open wound" + }, + "net": { + "value": 9883.42, + "currency": "USD" + } + } + ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:fc821981-5f17-437f-930e-897c82c24de4", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "fc821981-5f17-437f-930e-897c82c24de4", + "contained": [ + { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "performer": [ + { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + } + ] + }, + { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "NO_INSURANCE" + }, + "beneficiary": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "payor": [ + { + "display": "NO_INSURANCE" + } + ] + } + ], + "identifier": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "e2386e4d-f51b-4693-ba29-832596fd5581" + }, + { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } + ], + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2016-05-05T00:45:42-04:00", + "end": "2017-05-05T00:45:42-04:00" + }, + "created": "2016-05-05T00:45:42-04:00", + "insurer": { + "display": "NO_INSURANCE" + }, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "referral": { + "reference": "#referral" + }, + "claim": { + "reference": "urn:uuid:e2386e4d-f51b-4693-ba29-832596fd5581" + }, + "outcome": "complete", + "careTeam": [ + { + "sequence": 1, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "role": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } + ] + } + } + ], + "diagnosis": [ + { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:9e8a7f98-8530-4464-bc31-079a9bbb16cd" + }, + "type": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } + ] + } + ] + } + ], + "insurance": [ + { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "50849002", + "display": "Emergency room admission (procedure)" + } + ], + "text": "Emergency room admission (procedure)" + }, + "servicedPeriod": { + "start": "2016-05-04T23:35:42-04:00", + "end": "2016-05-05T00:45:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "20", + "display": "Urgent Care Facility" + } + ] + }, + "encounter": [ + { + "reference": "urn:uuid:bc1bd547-9007-4dcd-af8e-2b50e02452c5" + } + ] + }, + { + "sequence": 2, + "diagnosisSequence": [ + 1 + ], + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "283385000", + "display": "Laceration of thigh" + } + ], + "text": "Laceration of thigh" + }, + "servicedPeriod": { + "start": "2016-05-04T23:35:42-04:00", + "end": "2016-05-05T00:45:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "20", + "display": "Urgent Care Facility" + } + ] + } + }, + { + "sequence": 3, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "288086009", + "display": "Suture open wound" + } + ], + "text": "Suture open wound" + }, + "servicedPeriod": { + "start": "2016-05-04T23:35:42-04:00", + "end": "2016-05-05T00:45:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "20", + "display": "Urgent Care Facility" + } + ] + }, + "net": { + "value": 9883.42, + "currency": "USD" + }, + "adjudication": [ + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display": "Line Beneficiary Coinsurance Amount" + } + ] + }, + "amount": { + "value": 1976.6840000000002, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display": "Line Provider Payment Amount" + } + ] + }, + "amount": { + "value": 7906.736000000001, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display": "Line Submitted Charge Amount" + } + ] + }, + "amount": { + "value": 9883.42, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display": "Line Allowed Charge Amount" + } + ] + }, + "amount": { + "value": 9883.42, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display": "Line Beneficiary Part B Deductible Amount" + } + ] + }, + "amount": { + "value": 0, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display": "Line Processing Indicator Code" + } + ] + } + } + ] + } + ], + "total": [ + { + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } + ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } + ], + "payment": { + "amount": { + "value": 7906.736000000001, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, + { + "fullUrl": "urn:uuid:fe7ec842-c621-4c21-bd23-8b77d8a21dca", + "resource": { + "resourceType": "Encounter", + "id": "fe7ec842-c621-4c21-bd23-8b77d8a21dca", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "698314001", + "display": "Consultation for treatment" + } + ], + "text": "Consultation for treatment" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + }, + "participant": [ + { + "individual": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a", + "display": "Dr. Roberto515 Haag279" + } + } + ], + "period": { + "start": "2016-05-23T23:35:42-04:00", + "end": "2016-05-23T23:50:42-04:00" + }, + "serviceProvider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, + { + "fullUrl": "urn:uuid:d9c3e877-f75a-4daa-8ce4-62dc2a3ab909", + "resource": { + "resourceType": "MedicationRequest", + "id": "d9c3e877-f75a-4daa-8ce4-62dc2a3ab909", + "status": "stopped", + "intent": "order", + "medicationCodeableConcept": { + "coding": [ + { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "978950", + "display": "Natazia 28 Day Pack" + } + ], + "text": "Natazia 28 Day Pack" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:fe7ec842-c621-4c21-bd23-8b77d8a21dca" + }, + "authoredOn": "2016-05-23T23:35:42-04:00", + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a", + "display": "Dr. Roberto515 Haag279" + } + }, + "request": { + "method": "POST", + "url": "MedicationRequest" + } + }, + { + "fullUrl": "urn:uuid:273468e6-b467-4c2b-91cc-4566f794ad68", + "resource": { + "resourceType": "Claim", + "id": "273468e6-b467-4c2b-91cc-4566f794ad68", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "pharmacy" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2016-05-23T23:35:42-04:00", + "end": "2016-05-23T23:50:42-04:00" + }, + "created": "2016-05-23T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "prescription": { + "reference": "urn:uuid:d9c3e877-f75a-4daa-8ce4-62dc2a3ab909" + }, + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "698314001", + "display": "Consultation for treatment" + } + ], + "text": "Consultation for treatment" + }, + "encounter": [ + { + "reference": "urn:uuid:fe7ec842-c621-4c21-bd23-8b77d8a21dca" + } + ] + } + ], + "total": { + "value": 33.25, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:56cb174a-06dd-46a1-a731-0e0397bd73b0", + "resource": { + "resourceType": "Claim", + "id": "56cb174a-06dd-46a1-a731-0e0397bd73b0", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Tania553 Harris789" + }, + "billablePeriod": { + "start": "2016-05-23T23:35:42-04:00", + "end": "2016-05-23T23:50:42-04:00" + }, + "created": "2016-05-23T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "698314001", + "display": "Consultation for treatment" + } + ], + "text": "Consultation for treatment" + }, + "encounter": [ + { + "reference": "urn:uuid:fe7ec842-c621-4c21-bd23-8b77d8a21dca" + } + ] + } + ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:2c289d9d-e56f-460d-a50d-90afe2e589ac", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "2c289d9d-e56f-460d-a50d-90afe2e589ac", + "contained": [ + { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "performer": [ + { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + } + ] + }, + { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "NO_INSURANCE" + }, + "beneficiary": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "payor": [ + { + "display": "NO_INSURANCE" + } + ] + } + ], + "identifier": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "56cb174a-06dd-46a1-a731-0e0397bd73b0" + }, + { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } + ], + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2016-05-23T23:50:42-04:00", + "end": "2017-05-23T23:50:42-04:00" + }, + "created": "2016-05-23T23:50:42-04:00", + "insurer": { + "display": "NO_INSURANCE" + }, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "referral": { + "reference": "#referral" + }, + "claim": { + "reference": "urn:uuid:56cb174a-06dd-46a1-a731-0e0397bd73b0" + }, + "outcome": "complete", + "careTeam": [ + { + "sequence": 1, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "role": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } + ] + } + } + ], + "insurance": [ + { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "698314001", + "display": "Consultation for treatment" + } + ], + "text": "Consultation for treatment" + }, + "servicedPeriod": { + "start": "2016-05-23T23:35:42-04:00", + "end": "2016-05-23T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } + ] + }, + "encounter": [ + { + "reference": "urn:uuid:fe7ec842-c621-4c21-bd23-8b77d8a21dca" + } + ] + } + ], + "total": [ + { + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } + ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } + ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, + { + "fullUrl": "urn:uuid:cd5d7afb-e148-4b44-81e4-834507b28cbc", + "resource": { + "resourceType": "Encounter", + "id": "cd5d7afb-e148-4b44-81e4-834507b28cbc", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + }, + "participant": [ + { + "individual": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce", + "display": "Dr. Jacalyn740 Lindgren255" + } + } + ], + "period": { + "start": "2016-07-30T23:35:42-04:00", + "end": "2016-07-30T23:50:42-04:00" + }, + "serviceProvider": { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, + { + "fullUrl": "urn:uuid:456a8935-61d5-4a57-a106-fffede832266", + "resource": { + "resourceType": "Observation", + "id": "456a8935-61d5-4a57-a106-fffede832266", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8302-2", + "display": "Body Height" + } + ], + "text": "Body Height" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:cd5d7afb-e148-4b44-81e4-834507b28cbc" + }, + "effectiveDateTime": "2016-07-30T23:35:42-04:00", + "issued": "2016-07-30T23:35:42.651-04:00", + "valueQuantity": { + "value": 151.9789430482647, + "unit": "cm", + "system": "http://unitsofmeasure.org", + "code": "cm" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:b798c501-4dd4-400d-8dfe-b0ef6b3517c0", + "resource": { + "resourceType": "Observation", + "id": "b798c501-4dd4-400d-8dfe-b0ef6b3517c0", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72514-3", + "display": "Pain severity - 0-10 verbal numeric rating [Score] - Reported" + } + ], + "text": "Pain severity - 0-10 verbal numeric rating [Score] - Reported" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:cd5d7afb-e148-4b44-81e4-834507b28cbc" + }, + "effectiveDateTime": "2016-07-30T23:35:42-04:00", + "issued": "2016-07-30T23:35:42.651-04:00", + "valueQuantity": { + "value": 1.0533888930404331, + "unit": "{score}", + "system": "http://unitsofmeasure.org", + "code": "{score}" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:389358d7-0cef-44c7-8ddd-030a165029c5", + "resource": { + "resourceType": "Observation", + "id": "389358d7-0cef-44c7-8ddd-030a165029c5", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "29463-7", + "display": "Body Weight" + } + ], + "text": "Body Weight" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:cd5d7afb-e148-4b44-81e4-834507b28cbc" + }, + "effectiveDateTime": "2016-07-30T23:35:42-04:00", + "issued": "2016-07-30T23:35:42.651-04:00", + "valueQuantity": { + "value": 68.57276409163076, + "unit": "kg", + "system": "http://unitsofmeasure.org", + "code": "kg" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:105aebc2-1e2e-410f-815d-0327821cb565", + "resource": { + "resourceType": "Observation", + "id": "105aebc2-1e2e-410f-815d-0327821cb565", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "39156-5", + "display": "Body Mass Index" + } + ], + "text": "Body Mass Index" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:cd5d7afb-e148-4b44-81e4-834507b28cbc" + }, + "effectiveDateTime": "2016-07-30T23:35:42-04:00", + "issued": "2016-07-30T23:35:42.651-04:00", + "valueQuantity": { + "value": 29.688264873540472, + "unit": "kg/m2", + "system": "http://unitsofmeasure.org", + "code": "kg/m2" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:3b99c719-0cb1-4e88-8334-8de3de372b48", + "resource": { + "resourceType": "Observation", + "id": "3b99c719-0cb1-4e88-8334-8de3de372b48", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "59576-9", + "display": "Body mass index (BMI) [Percentile] Per age and gender" + } + ], + "text": "Body mass index (BMI) [Percentile] Per age and gender" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:cd5d7afb-e148-4b44-81e4-834507b28cbc" + }, + "effectiveDateTime": "2016-07-30T23:35:42-04:00", + "issued": "2016-07-30T23:35:42.651-04:00", + "valueQuantity": { + "value": 94.92389148839354, + "unit": "%", + "system": "http://unitsofmeasure.org", + "code": "%" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:238c86f4-632c-49b0-83ae-7b05eb35ed17", + "resource": { + "resourceType": "Observation", + "id": "238c86f4-632c-49b0-83ae-7b05eb35ed17", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "55284-4", + "display": "Blood Pressure" + } + ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:cd5d7afb-e148-4b44-81e4-834507b28cbc" + }, + "effectiveDateTime": "2016-07-30T23:35:42-04:00", + "issued": "2016-07-30T23:35:42.651-04:00", + "component": [ + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } + ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 80.74859899301299, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } + ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136.11534633379068, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } + ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:cabb769f-1948-404e-8d6c-f2b3b2081325", + "resource": { + "resourceType": "Observation", + "id": "cabb769f-1948-404e-8d6c-f2b3b2081325", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "survey", + "display": "survey" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72166-2", + "display": "Tobacco smoking status NHIS" + } + ], + "text": "Tobacco smoking status NHIS" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:cd5d7afb-e148-4b44-81e4-834507b28cbc" + }, + "effectiveDateTime": "2016-07-30T23:35:42-04:00", + "issued": "2016-07-30T23:35:42.651-04:00", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "266919005", + "display": "Never smoker" + } + ], + "text": "Never smoker" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:48ddb2aa-1fd9-4907-b78f-3253a014e2e9", + "resource": { + "resourceType": "Immunization", + "id": "48ddb2aa-1fd9-4907-b78f-3253a014e2e9", + "status": "completed", + "vaccineCode": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:cd5d7afb-e148-4b44-81e4-834507b28cbc" + }, + "occurrenceDateTime": "2016-07-30T23:35:42-04:00", + "primarySource": true + }, + "request": { + "method": "POST", + "url": "Immunization" + } + }, + { + "fullUrl": "urn:uuid:0e3f4573-84ea-411f-ace9-bbf2c5de7a80", + "resource": { + "resourceType": "Claim", + "id": "0e3f4573-84ea-411f-ace9-bbf2c5de7a80", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Tania553 Harris789" + }, + "billablePeriod": { + "start": "2016-07-30T23:35:42-04:00", + "end": "2016-07-30T23:50:42-04:00" + }, + "created": "2016-07-30T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "supportingInfo": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code": "info" + } + ] + }, + "valueReference": { + "reference": "urn:uuid:48ddb2aa-1fd9-4907-b78f-3253a014e2e9" + } + } + ], + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Anthem" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + }, + "encounter": [ + { + "reference": "urn:uuid:cd5d7afb-e148-4b44-81e4-834507b28cbc" + } + ] + }, + { + "sequence": 2, + "informationSequence": [ + 1 + ], + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "net": { + "value": 140.52, + "currency": "USD" + } + } + ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:a2ae590b-d3b5-42f0-9aae-3980f1e9318e", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "a2ae590b-d3b5-42f0-9aae-3980f1e9318e", + "contained": [ + { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "performer": [ + { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + } + ] + }, + { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Anthem" + }, + "beneficiary": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "payor": [ + { + "display": "Anthem" + } + ] + } + ], + "identifier": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "0e3f4573-84ea-411f-ace9-bbf2c5de7a80" + }, + { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } + ], + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2016-07-30T23:50:42-04:00", + "end": "2017-07-30T23:50:42-04:00" + }, + "created": "2016-07-30T23:50:42-04:00", + "insurer": { + "display": "Anthem" + }, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "referral": { + "reference": "#referral" + }, + "claim": { + "reference": "urn:uuid:0e3f4573-84ea-411f-ace9-bbf2c5de7a80" + }, + "outcome": "complete", + "careTeam": [ + { + "sequence": 1, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "role": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } + ] + } + } + ], + "insurance": [ + { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Anthem" + } + } + ], + "item": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "410620009", + "display": "Well child visit (procedure)" + } + ], + "text": "Well child visit (procedure)" + }, + "servicedPeriod": { + "start": "2016-07-30T23:35:42-04:00", + "end": "2016-07-30T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "encounter": [ + { + "reference": "urn:uuid:cd5d7afb-e148-4b44-81e4-834507b28cbc" + } + ] + }, + { + "sequence": 2, + "informationSequence": [ + 1 + ], + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "servicedPeriod": { + "start": "2016-07-30T23:35:42-04:00", + "end": "2016-07-30T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "net": { + "value": 140.52, + "currency": "USD" + }, + "adjudication": [ + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display": "Line Beneficiary Coinsurance Amount" + } + ] + }, + "amount": { + "value": 28.104000000000003, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display": "Line Provider Payment Amount" + } + ] + }, + "amount": { + "value": 112.41600000000001, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display": "Line Submitted Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display": "Line Allowed Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display": "Line Beneficiary Part B Deductible Amount" + } + ] + }, + "amount": { + "value": 0, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display": "Line Processing Indicator Code" + } + ] + } + } + ] + } + ], + "total": [ + { + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } + ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } + ], + "payment": { + "amount": { + "value": 112.41600000000001, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, + { + "fullUrl": "urn:uuid:717881ea-2503-44e7-a3b3-45d4666148d8", + "resource": { + "resourceType": "Encounter", + "id": "717881ea-2503-44e7-a3b3-45d4666148d8", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } + ], + "text": "Encounter for symptom" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + }, + "participant": [ + { + "individual": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a", + "display": "Dr. Roberto515 Haag279" + } + } + ], + "period": { + "start": "2016-09-29T23:35:42-04:00", + "end": "2016-09-29T23:50:42-04:00" + }, + "reasonCode": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } + ] + } + ], + "serviceProvider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, + { + "fullUrl": "urn:uuid:91308819-a229-43e6-a84d-308bb8d9f7f5", + "resource": { + "resourceType": "Condition", + "id": "91308819-a229-43e6-a84d-308bb8d9f7f5", + "clinicalStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "resolved" + } + ] + }, + "verificationStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } + ] + }, + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } + ], + "text": "Viral sinusitis (disorder)" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:717881ea-2503-44e7-a3b3-45d4666148d8" + }, + "onsetDateTime": "2016-09-29T23:35:42-04:00", + "abatementDateTime": "2016-10-13T23:35:42-04:00", + "recordedDate": "2016-09-29T23:35:42-04:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, + { + "fullUrl": "urn:uuid:75f08279-cc2a-4670-a132-01b3280c7ec3", + "resource": { + "resourceType": "Claim", + "id": "75f08279-cc2a-4670-a132-01b3280c7ec3", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Tania553 Harris789" + }, + "billablePeriod": { + "start": "2016-09-29T23:35:42-04:00", + "end": "2016-09-29T23:50:42-04:00" + }, + "created": "2016-09-29T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "diagnosis": [ + { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:91308819-a229-43e6-a84d-308bb8d9f7f5" + } + } + ], + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } + ], + "text": "Encounter for symptom" + }, + "encounter": [ + { + "reference": "urn:uuid:717881ea-2503-44e7-a3b3-45d4666148d8" + } + ] + }, + { + "sequence": 2, + "diagnosisSequence": [ + 1 + ], + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } + ], + "text": "Viral sinusitis (disorder)" + } + } + ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:1d69022d-bc24-4dd3-8b22-b8c581706ae5", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "1d69022d-bc24-4dd3-8b22-b8c581706ae5", + "contained": [ + { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "performer": [ + { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + } + ] + }, + { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "NO_INSURANCE" + }, + "beneficiary": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "payor": [ + { + "display": "NO_INSURANCE" + } + ] + } + ], + "identifier": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "75f08279-cc2a-4670-a132-01b3280c7ec3" + }, + { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } + ], + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2016-09-29T23:50:42-04:00", + "end": "2017-09-29T23:50:42-04:00" + }, + "created": "2016-09-29T23:50:42-04:00", + "insurer": { + "display": "NO_INSURANCE" + }, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "referral": { + "reference": "#referral" + }, + "claim": { + "reference": "urn:uuid:75f08279-cc2a-4670-a132-01b3280c7ec3" + }, + "outcome": "complete", + "careTeam": [ + { + "sequence": 1, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "role": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } + ] + } + } + ], + "diagnosis": [ + { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:91308819-a229-43e6-a84d-308bb8d9f7f5" + }, + "type": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } + ] + } + ] + } + ], + "insurance": [ + { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } + ], + "text": "Encounter for symptom" + }, + "servicedPeriod": { + "start": "2016-09-29T23:35:42-04:00", + "end": "2016-09-29T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } + ] + }, + "encounter": [ + { + "reference": "urn:uuid:717881ea-2503-44e7-a3b3-45d4666148d8" + } + ] + }, + { + "sequence": 2, + "diagnosisSequence": [ + 1 + ], + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } + ], + "text": "Viral sinusitis (disorder)" + }, + "servicedPeriod": { + "start": "2016-09-29T23:35:42-04:00", + "end": "2016-09-29T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } + ] + } + } + ], + "total": [ + { + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } + ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } + ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, + { + "fullUrl": "urn:uuid:858f7499-560d-493d-9bd4-62f55b121f1a", + "resource": { + "resourceType": "Encounter", + "id": "858f7499-560d-493d-9bd4-62f55b121f1a", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } + ], + "text": "General examination of patient (procedure)" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + }, + "participant": [ + { + "individual": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce", + "display": "Dr. Jacalyn740 Lindgren255" + } + } + ], + "period": { + "start": "2017-08-05T23:35:42-04:00", + "end": "2017-08-05T23:50:42-04:00" + }, + "serviceProvider": { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, + { + "fullUrl": "urn:uuid:1dde2651-4744-47f1-9fb7-5f0fdad2b316", + "resource": { + "resourceType": "Condition", + "id": "1dde2651-4744-47f1-9fb7-5f0fdad2b316", + "clinicalStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "active" + } + ] + }, + "verificationStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } + ] + }, + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "162864005", + "display": "Body mass index 30+ - obesity (finding)" + } + ], + "text": "Body mass index 30+ - obesity (finding)" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:858f7499-560d-493d-9bd4-62f55b121f1a" + }, + "onsetDateTime": "2017-08-05T23:35:42-04:00", + "recordedDate": "2017-08-05T23:35:42-04:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, + { + "fullUrl": "urn:uuid:4fa11d6d-b4d3-44dc-8083-ddf01b98742f", + "resource": { + "resourceType": "Condition", + "id": "4fa11d6d-b4d3-44dc-8083-ddf01b98742f", + "clinicalStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "active" + } + ] + }, + "verificationStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } + ] + }, + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "59621000", + "display": "Hypertension" + } + ], + "text": "Hypertension" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:858f7499-560d-493d-9bd4-62f55b121f1a" + }, + "onsetDateTime": "2017-08-05T23:35:42-04:00", + "recordedDate": "2017-08-05T23:35:42-04:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, + { + "fullUrl": "urn:uuid:466a7fca-ea58-4163-9b14-e760948d5ad1", + "resource": { + "resourceType": "Observation", + "id": "466a7fca-ea58-4163-9b14-e760948d5ad1", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8302-2", + "display": "Body Height" + } + ], + "text": "Body Height" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:858f7499-560d-493d-9bd4-62f55b121f1a" + }, + "effectiveDateTime": "2017-08-05T23:35:42-04:00", + "issued": "2017-08-05T23:35:42.651-04:00", + "valueQuantity": { + "value": 152.15817064004855, + "unit": "cm", + "system": "http://unitsofmeasure.org", + "code": "cm" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:9e36f038-84c8-4c0b-a91d-f13dbea7e724", + "resource": { + "resourceType": "Observation", + "id": "9e36f038-84c8-4c0b-a91d-f13dbea7e724", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72514-3", + "display": "Pain severity - 0-10 verbal numeric rating [Score] - Reported" + } + ], + "text": "Pain severity - 0-10 verbal numeric rating [Score] - Reported" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:858f7499-560d-493d-9bd4-62f55b121f1a" + }, + "effectiveDateTime": "2017-08-05T23:35:42-04:00", + "issued": "2017-08-05T23:35:42.651-04:00", + "valueQuantity": { + "value": 0.7380012870494554, + "unit": "{score}", + "system": "http://unitsofmeasure.org", + "code": "{score}" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:1d65530a-c843-430e-b39d-c50eff319c2f", + "resource": { + "resourceType": "Observation", + "id": "1d65530a-c843-430e-b39d-c50eff319c2f", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "29463-7", + "display": "Body Weight" + } + ], + "text": "Body Weight" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:858f7499-560d-493d-9bd4-62f55b121f1a" + }, + "effectiveDateTime": "2017-08-05T23:35:42-04:00", + "issued": "2017-08-05T23:35:42.651-04:00", + "valueQuantity": { + "value": 70.33423093390505, + "unit": "kg", + "system": "http://unitsofmeasure.org", + "code": "kg" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:fd9b9645-3e27-456c-9815-0cfe29aa088a", + "resource": { + "resourceType": "Observation", + "id": "fd9b9645-3e27-456c-9815-0cfe29aa088a", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "39156-5", + "display": "Body Mass Index" + } + ], + "text": "Body Mass Index" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:858f7499-560d-493d-9bd4-62f55b121f1a" + }, + "effectiveDateTime": "2017-08-05T23:35:42-04:00", + "issued": "2017-08-05T23:35:42.651-04:00", + "valueQuantity": { + "value": 30.379189757789213, + "unit": "kg/m2", + "system": "http://unitsofmeasure.org", + "code": "kg/m2" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:812c5baa-51f0-4d6e-8d4e-5006dc4c1611", + "resource": { + "resourceType": "Observation", + "id": "812c5baa-51f0-4d6e-8d4e-5006dc4c1611", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "59576-9", + "display": "Body mass index (BMI) [Percentile] Per age and gender" + } + ], + "text": "Body mass index (BMI) [Percentile] Per age and gender" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:858f7499-560d-493d-9bd4-62f55b121f1a" + }, + "effectiveDateTime": "2017-08-05T23:35:42-04:00", + "issued": "2017-08-05T23:35:42.651-04:00", + "valueQuantity": { + "value": 94.9324324792929, + "unit": "%", + "system": "http://unitsofmeasure.org", + "code": "%" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:fbba7e05-e993-41c8-9038-7aaae78ba2c1", + "resource": { + "resourceType": "Observation", + "id": "fbba7e05-e993-41c8-9038-7aaae78ba2c1", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "55284-4", + "display": "Blood Pressure" + } + ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:858f7499-560d-493d-9bd4-62f55b121f1a" + }, + "effectiveDateTime": "2017-08-05T23:35:42-04:00", + "issued": "2017-08-05T23:35:42.651-04:00", + "component": [ + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } + ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 120.09638868149413, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } + ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 188.91283161144722, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } + ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:804206c2-3b72-47f7-a5ad-023bafc65e79", + "resource": { + "resourceType": "Observation", + "id": "804206c2-3b72-47f7-a5ad-023bafc65e79", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "survey", + "display": "survey" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72166-2", + "display": "Tobacco smoking status NHIS" + } + ], + "text": "Tobacco smoking status NHIS" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:858f7499-560d-493d-9bd4-62f55b121f1a" + }, + "effectiveDateTime": "2017-08-05T23:35:42-04:00", + "issued": "2017-08-05T23:35:42.651-04:00", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "266919005", + "display": "Never smoker" + } + ], + "text": "Never smoker" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:aba44cf6-0c97-4d19-982c-9c3d6401342b", + "resource": { + "resourceType": "MedicationRequest", + "id": "aba44cf6-0c97-4d19-982c-9c3d6401342b", + "status": "stopped", + "intent": "order", + "medicationCodeableConcept": { + "coding": [ + { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "316049", + "display": "Hydrochlorothiazide 25 MG" + } + ], + "text": "Hydrochlorothiazide 25 MG" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:858f7499-560d-493d-9bd4-62f55b121f1a" + }, + "authoredOn": "2017-08-05T23:35:42-04:00", + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce", + "display": "Dr. Jacalyn740 Lindgren255" + }, + "reasonReference": [ + { + "reference": "urn:uuid:4fa11d6d-b4d3-44dc-8083-ddf01b98742f" + } + ] + }, + "request": { + "method": "POST", + "url": "MedicationRequest" + } + }, + { + "fullUrl": "urn:uuid:91f10549-e35b-43e9-b5f7-be56d0fb5e6a", + "resource": { + "resourceType": "Claim", + "id": "91f10549-e35b-43e9-b5f7-be56d0fb5e6a", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "pharmacy" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2017-08-05T23:35:42-04:00", + "end": "2017-08-05T23:50:42-04:00" + }, + "created": "2017-08-05T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "prescription": { + "reference": "urn:uuid:aba44cf6-0c97-4d19-982c-9c3d6401342b" + }, + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } + ], + "text": "General examination of patient (procedure)" + }, + "encounter": [ + { + "reference": "urn:uuid:858f7499-560d-493d-9bd4-62f55b121f1a" + } + ] + } + ], + "total": { + "value": 263.49, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:3e3a5e54-eb43-4c01-8354-8ce692a09f7b", + "resource": { + "resourceType": "Immunization", + "id": "3e3a5e54-eb43-4c01-8354-8ce692a09f7b", + "status": "completed", + "vaccineCode": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:858f7499-560d-493d-9bd4-62f55b121f1a" + }, + "occurrenceDateTime": "2017-08-05T23:35:42-04:00", + "primarySource": true + }, + "request": { + "method": "POST", + "url": "Immunization" + } + }, + { + "fullUrl": "urn:uuid:6d6872fc-bbad-4ee3-98de-94e799f91e3f", + "resource": { + "resourceType": "CareTeam", + "id": "6d6872fc-bbad-4ee3-98de-94e799f91e3f", + "status": "active", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:858f7499-560d-493d-9bd4-62f55b121f1a" + }, + "period": { + "start": "2017-08-05T23:35:42-04:00" + }, + "participant": [ + { + "role": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "116153009", + "display": "Patient" + } + ], + "text": "Patient" + } + ], + "member": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + } + }, + { + "role": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "303118004", + "display": "Person in the healthcare environment (person)" + } + ], + "text": "Person in the healthcare environment (person)" + } + ], + "member": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce", + "display": "Dr. Jacalyn740 Lindgren255" + } + }, + { + "role": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "303118004", + "display": "Healthcare related organization (qualifier value)" + } + ], + "text": "Healthcare related organization (qualifier value)" + } + ], + "member": { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + } + } + ], + "reasonCode": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "59621000", + "display": "Hypertension" + } + ], + "text": "Hypertension" + } + ], + "managingOrganization": [ + { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + } + ] + }, + "request": { + "method": "POST", + "url": "CareTeam" + } + }, + { + "fullUrl": "urn:uuid:a322b60e-8d4d-4dcc-b10d-71bf7f0393d7", + "resource": { + "resourceType": "Goal", + "id": "a322b60e-8d4d-4dcc-b10d-71bf7f0393d7", + "lifecycleStatus": "accepted", + "achievementStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/goal-achievement", + "code": "in-progress" + } + ] + }, + "description": { + "text": "Maintain blood pressure below 140/90 mm[Hg]" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + } + }, + "request": { + "method": "POST", + "url": "Goal" + } + }, + { + "fullUrl": "urn:uuid:9d267e04-f462-4b1f-8ca0-9a49038c0077", + "resource": { + "resourceType": "Goal", + "id": "9d267e04-f462-4b1f-8ca0-9a49038c0077", + "lifecycleStatus": "accepted", + "achievementStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/goal-achievement", + "code": "in-progress" + } + ] + }, + "description": { + "text": "Reduce sodium intake to no more than 2,400 mg/day" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + } + }, + "request": { + "method": "POST", + "url": "Goal" + } + }, + { + "fullUrl": "urn:uuid:aa0f3692-d429-4fff-a33e-8c04f89ee791", + "resource": { + "resourceType": "CarePlan", + "id": "aa0f3692-d429-4fff-a33e-8c04f89ee791", + "text": { + "status": "generated", + "div": "
Care Plan for Lifestyle education regarding hypertension.
Activities:
Care plan is meant to treat Hypertension.
" + }, + "status": "active", + "intent": "order", + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "443402002", + "display": "Lifestyle education regarding hypertension" + } + ], + "text": "Lifestyle education regarding hypertension" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:858f7499-560d-493d-9bd4-62f55b121f1a" + }, + "period": { + "start": "2017-08-05T23:35:42-04:00" + }, + "careTeam": [ + { + "reference": "urn:uuid:6d6872fc-bbad-4ee3-98de-94e799f91e3f" + } + ], + "addresses": [ + { + "reference": "urn:uuid:4fa11d6d-b4d3-44dc-8083-ddf01b98742f" + } + ], + "goal": [ + { + "reference": "urn:uuid:a322b60e-8d4d-4dcc-b10d-71bf7f0393d7" + }, + { + "reference": "urn:uuid:9d267e04-f462-4b1f-8ca0-9a49038c0077" + } + ], + "activity": [ + { + "detail": { + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "386463000", + "display": "Prescribed activity/exercise education" + } + ], + "text": "Prescribed activity/exercise education" + }, + "status": "in-progress", + "location": { + "display": "GEMINI PHYSICAL THERAPY LLC" + } + } + }, + { + "detail": { + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "413473000", + "display": "Counseling about alcohol consumption" + } + ], + "text": "Counseling about alcohol consumption" + }, + "status": "in-progress", + "location": { + "display": "GEMINI PHYSICAL THERAPY LLC" + } + } + }, + { + "detail": { + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "1151000175103", + "display": "Dietary approaches to stop hypertension diet" + } + ], + "text": "Dietary approaches to stop hypertension diet" + }, + "status": "in-progress", + "location": { + "display": "GEMINI PHYSICAL THERAPY LLC" + } + } + }, + { + "detail": { + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "225323000", + "display": "Smoking cessation education" + } + ], + "text": "Smoking cessation education" + }, + "status": "in-progress", + "location": { + "display": "GEMINI PHYSICAL THERAPY LLC" + } + } + } + ] + }, + "request": { + "method": "POST", + "url": "CarePlan" + } + }, + { + "fullUrl": "urn:uuid:f3e3ac71-3d15-4334-b349-e8bdfbd4727e", + "resource": { + "resourceType": "Claim", + "id": "f3e3ac71-3d15-4334-b349-e8bdfbd4727e", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Tania553 Harris789" + }, + "billablePeriod": { + "start": "2017-08-05T23:35:42-04:00", + "end": "2017-08-05T23:50:42-04:00" + }, + "created": "2017-08-05T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "supportingInfo": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code": "info" + } + ] + }, + "valueReference": { + "reference": "urn:uuid:3e3a5e54-eb43-4c01-8354-8ce692a09f7b" + } + } + ], + "diagnosis": [ + { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:1dde2651-4744-47f1-9fb7-5f0fdad2b316" + } + }, + { + "sequence": 2, + "diagnosisReference": { + "reference": "urn:uuid:4fa11d6d-b4d3-44dc-8083-ddf01b98742f" + } + } + ], + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Anthem" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } + ], + "text": "General examination of patient (procedure)" + }, + "encounter": [ + { + "reference": "urn:uuid:858f7499-560d-493d-9bd4-62f55b121f1a" + } + ] + }, + { + "sequence": 2, + "informationSequence": [ + 1 + ], + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "net": { + "value": 140.52, + "currency": "USD" + } + }, + { + "sequence": 3, + "diagnosisSequence": [ + 1 + ], + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "162864005", + "display": "Body mass index 30+ - obesity (finding)" + } + ], + "text": "Body mass index 30+ - obesity (finding)" + } + }, + { + "sequence": 4, + "diagnosisSequence": [ + 2 + ], + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "59621000", + "display": "Hypertension" + } + ], + "text": "Hypertension" + } + } + ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:907ac329-6306-43fd-81a4-0ecc4d108e0d", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "907ac329-6306-43fd-81a4-0ecc4d108e0d", + "contained": [ + { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "performer": [ + { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + } + ] + }, + { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Anthem" + }, + "beneficiary": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "payor": [ + { + "display": "Anthem" + } + ] + } + ], + "identifier": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "f3e3ac71-3d15-4334-b349-e8bdfbd4727e" + }, + { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } + ], + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2017-08-05T23:50:42-04:00", + "end": "2018-08-05T23:50:42-04:00" + }, + "created": "2017-08-05T23:50:42-04:00", + "insurer": { + "display": "Anthem" + }, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "referral": { + "reference": "#referral" + }, + "claim": { + "reference": "urn:uuid:f3e3ac71-3d15-4334-b349-e8bdfbd4727e" + }, + "outcome": "complete", + "careTeam": [ + { + "sequence": 1, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "role": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } + ] + } + } + ], + "diagnosis": [ + { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:1dde2651-4744-47f1-9fb7-5f0fdad2b316" + }, + "type": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } + ] + } + ] + }, + { + "sequence": 2, + "diagnosisReference": { + "reference": "urn:uuid:4fa11d6d-b4d3-44dc-8083-ddf01b98742f" + }, + "type": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } + ] + } + ] + } + ], + "insurance": [ + { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Anthem" + } + } + ], + "item": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } + ], + "text": "General examination of patient (procedure)" + }, + "servicedPeriod": { + "start": "2017-08-05T23:35:42-04:00", + "end": "2017-08-05T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "encounter": [ + { + "reference": "urn:uuid:858f7499-560d-493d-9bd4-62f55b121f1a" + } + ] + }, + { + "sequence": 2, + "informationSequence": [ + 1 + ], + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "servicedPeriod": { + "start": "2017-08-05T23:35:42-04:00", + "end": "2017-08-05T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "net": { + "value": 140.52, + "currency": "USD" + }, + "adjudication": [ + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display": "Line Beneficiary Coinsurance Amount" + } + ] + }, + "amount": { + "value": 28.104000000000003, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display": "Line Provider Payment Amount" + } + ] + }, + "amount": { + "value": 112.41600000000001, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display": "Line Submitted Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display": "Line Allowed Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display": "Line Beneficiary Part B Deductible Amount" + } + ] + }, + "amount": { + "value": 0, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display": "Line Processing Indicator Code" + } + ] + } + } + ] + }, + { + "sequence": 3, + "diagnosisSequence": [ + 1 + ], + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "162864005", + "display": "Body mass index 30+ - obesity (finding)" + } + ], + "text": "Body mass index 30+ - obesity (finding)" + }, + "servicedPeriod": { + "start": "2017-08-05T23:35:42-04:00", + "end": "2017-08-05T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + } + }, + { + "sequence": 4, + "diagnosisSequence": [ + 2 + ], + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "59621000", + "display": "Hypertension" + } + ], + "text": "Hypertension" + }, + "servicedPeriod": { + "start": "2017-08-05T23:35:42-04:00", + "end": "2017-08-05T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + } + } + ], + "total": [ + { + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } + ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } + ], + "payment": { + "amount": { + "value": 112.41600000000001, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, + { + "fullUrl": "urn:uuid:14b4c6bf-149b-4a9c-8e5a-fdf1ad4ae501", + "resource": { + "resourceType": "Encounter", + "id": "14b4c6bf-149b-4a9c-8e5a-fdf1ad4ae501", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "390906007", + "display": "Hypertension follow-up encounter" + } + ], + "text": "Hypertension follow-up encounter" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + }, + "participant": [ + { + "individual": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a", + "display": "Dr. Roberto515 Haag279" + } + } + ], + "period": { + "start": "2017-09-04T23:35:42-04:00", + "end": "2017-09-04T23:50:42-04:00" + }, + "serviceProvider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, + { + "fullUrl": "urn:uuid:e381d1b3-4bf5-40f2-941a-b8ddaf06a757", + "resource": { + "resourceType": "Observation", + "id": "e381d1b3-4bf5-40f2-941a-b8ddaf06a757", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "55284-4", + "display": "Blood Pressure" + } + ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:14b4c6bf-149b-4a9c-8e5a-fdf1ad4ae501" + }, + "effectiveDateTime": "2017-09-04T23:35:42-04:00", + "issued": "2017-09-04T23:35:42.651-04:00", + "component": [ + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } + ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 109.70230698313489, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } + ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 163.9071552178571, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } + ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:7506c9db-f6aa-4430-97bc-ee37412cc921", + "resource": { + "resourceType": "MedicationRequest", + "id": "7506c9db-f6aa-4430-97bc-ee37412cc921", + "status": "stopped", + "intent": "order", + "medicationCodeableConcept": { + "coding": [ + { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "746030", + "display": "Atenolol 50 MG / Chlorthalidone 25 MG Oral Tablet" + } + ], + "text": "Atenolol 50 MG / Chlorthalidone 25 MG Oral Tablet" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:14b4c6bf-149b-4a9c-8e5a-fdf1ad4ae501" + }, + "authoredOn": "2017-09-04T23:35:42-04:00", + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a", + "display": "Dr. Roberto515 Haag279" + }, + "reasonReference": [ + { + "reference": "urn:uuid:4fa11d6d-b4d3-44dc-8083-ddf01b98742f" + } + ] + }, + "request": { + "method": "POST", + "url": "MedicationRequest" + } + }, + { + "fullUrl": "urn:uuid:9283153e-0698-4835-aa8d-05cbdbe580db", + "resource": { + "resourceType": "Claim", + "id": "9283153e-0698-4835-aa8d-05cbdbe580db", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "pharmacy" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2017-09-04T23:35:42-04:00", + "end": "2017-09-04T23:50:42-04:00" + }, + "created": "2017-09-04T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "prescription": { + "reference": "urn:uuid:7506c9db-f6aa-4430-97bc-ee37412cc921" + }, + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "390906007", + "display": "Hypertension follow-up encounter" + } + ], + "text": "Hypertension follow-up encounter" + }, + "encounter": [ + { + "reference": "urn:uuid:14b4c6bf-149b-4a9c-8e5a-fdf1ad4ae501" + } + ] + } + ], + "total": { + "value": 263.49, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:cb3febbf-46ac-41d7-95ff-db7c63ba02a5", + "resource": { + "resourceType": "Claim", + "id": "cb3febbf-46ac-41d7-95ff-db7c63ba02a5", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Tania553 Harris789" + }, + "billablePeriod": { + "start": "2017-09-04T23:35:42-04:00", + "end": "2017-09-04T23:50:42-04:00" + }, + "created": "2017-09-04T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "390906007", + "display": "Hypertension follow-up encounter" + } + ], + "text": "Hypertension follow-up encounter" + }, + "encounter": [ + { + "reference": "urn:uuid:14b4c6bf-149b-4a9c-8e5a-fdf1ad4ae501" + } + ] + } + ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:7c1d1efb-41ce-4dac-abdd-88b02f33b684", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "7c1d1efb-41ce-4dac-abdd-88b02f33b684", + "contained": [ + { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "performer": [ + { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + } + ] + }, + { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "NO_INSURANCE" + }, + "beneficiary": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "payor": [ + { + "display": "NO_INSURANCE" + } + ] + } + ], + "identifier": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "cb3febbf-46ac-41d7-95ff-db7c63ba02a5" + }, + { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } + ], + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2017-09-04T23:50:42-04:00", + "end": "2018-09-04T23:50:42-04:00" + }, + "created": "2017-09-04T23:50:42-04:00", + "insurer": { + "display": "NO_INSURANCE" + }, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "referral": { + "reference": "#referral" + }, + "claim": { + "reference": "urn:uuid:cb3febbf-46ac-41d7-95ff-db7c63ba02a5" + }, + "outcome": "complete", + "careTeam": [ + { + "sequence": 1, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "role": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } + ] + } + } + ], + "insurance": [ + { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "390906007", + "display": "Hypertension follow-up encounter" + } + ], + "text": "Hypertension follow-up encounter" + }, + "servicedPeriod": { + "start": "2017-09-04T23:35:42-04:00", + "end": "2017-09-04T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } + ] + }, + "encounter": [ + { + "reference": "urn:uuid:14b4c6bf-149b-4a9c-8e5a-fdf1ad4ae501" + } + ] + } + ], + "total": [ + { + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } + ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } + ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, + { + "fullUrl": "urn:uuid:36f889c6-1ef4-480d-9508-3811a64609b4", + "resource": { + "resourceType": "Encounter", + "id": "36f889c6-1ef4-480d-9508-3811a64609b4", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "390906007", + "display": "Hypertension follow-up encounter" + } + ], + "text": "Hypertension follow-up encounter" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + }, + "participant": [ + { + "individual": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a", + "display": "Dr. Roberto515 Haag279" + } + } + ], + "period": { + "start": "2017-11-03T23:35:42-04:00", + "end": "2017-11-03T23:50:42-04:00" + }, + "serviceProvider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, + { + "fullUrl": "urn:uuid:5725ce02-3472-4120-8fad-a390f2be133f", + "resource": { + "resourceType": "Observation", + "id": "5725ce02-3472-4120-8fad-a390f2be133f", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "55284-4", + "display": "Blood Pressure" + } + ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:36f889c6-1ef4-480d-9508-3811a64609b4" + }, + "effectiveDateTime": "2017-11-03T23:35:42-04:00", + "issued": "2017-11-03T23:35:42.651-04:00", + "component": [ + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } + ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 110.68281728084656, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } + ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 142.96992696995835, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } + ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:bee0a162-5f61-4f95-93c9-959b118032b8", + "resource": { + "resourceType": "MedicationRequest", + "id": "bee0a162-5f61-4f95-93c9-959b118032b8", + "status": "active", + "intent": "order", + "medicationCodeableConcept": { + "coding": [ + { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "999969", + "display": "Amlodipine 5 MG / Hydrochlorothiazide 12.5 MG / Olmesartan medoxomil 20 MG" + } + ], + "text": "Amlodipine 5 MG / Hydrochlorothiazide 12.5 MG / Olmesartan medoxomil 20 MG" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:36f889c6-1ef4-480d-9508-3811a64609b4" + }, + "authoredOn": "2017-11-03T23:35:42-04:00", + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a", + "display": "Dr. Roberto515 Haag279" + }, + "reasonReference": [ + { + "reference": "urn:uuid:4fa11d6d-b4d3-44dc-8083-ddf01b98742f" + } + ] + }, + "request": { + "method": "POST", + "url": "MedicationRequest" + } + }, + { + "fullUrl": "urn:uuid:03dfd544-531e-4ac6-a6d7-a16d46d04d0d", + "resource": { + "resourceType": "Claim", + "id": "03dfd544-531e-4ac6-a6d7-a16d46d04d0d", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "pharmacy" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2017-11-03T23:35:42-04:00", + "end": "2017-11-03T23:50:42-04:00" + }, + "created": "2017-11-03T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "prescription": { + "reference": "urn:uuid:bee0a162-5f61-4f95-93c9-959b118032b8" + }, + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Anthem" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "390906007", + "display": "Hypertension follow-up encounter" + } + ], + "text": "Hypertension follow-up encounter" + }, + "encounter": [ + { + "reference": "urn:uuid:36f889c6-1ef4-480d-9508-3811a64609b4" + } + ] + } + ], + "total": { + "value": 263.49, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:7e7c29e3-c5f8-46b5-a9c1-aeb7506cdd41", + "resource": { + "resourceType": "Claim", + "id": "7e7c29e3-c5f8-46b5-a9c1-aeb7506cdd41", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Tania553 Harris789" + }, + "billablePeriod": { + "start": "2017-11-03T23:35:42-04:00", + "end": "2017-11-03T23:50:42-04:00" + }, + "created": "2017-11-03T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "390906007", + "display": "Hypertension follow-up encounter" + } + ], + "text": "Hypertension follow-up encounter" + }, + "encounter": [ + { + "reference": "urn:uuid:36f889c6-1ef4-480d-9508-3811a64609b4" + } + ] + } + ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:48f9993b-84fd-4b4b-afbb-25c45765cceb", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "48f9993b-84fd-4b4b-afbb-25c45765cceb", + "contained": [ + { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "performer": [ + { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + } + ] + }, + { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "NO_INSURANCE" + }, + "beneficiary": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "payor": [ + { + "display": "NO_INSURANCE" + } + ] + } + ], + "identifier": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "7e7c29e3-c5f8-46b5-a9c1-aeb7506cdd41" + }, + { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } + ], + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2017-11-03T23:50:42-04:00", + "end": "2018-11-03T23:50:42-04:00" + }, + "created": "2017-11-03T23:50:42-04:00", + "insurer": { + "display": "NO_INSURANCE" + }, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "referral": { + "reference": "#referral" + }, + "claim": { + "reference": "urn:uuid:7e7c29e3-c5f8-46b5-a9c1-aeb7506cdd41" + }, + "outcome": "complete", + "careTeam": [ + { + "sequence": 1, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "role": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } + ] + } + } + ], + "insurance": [ + { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "390906007", + "display": "Hypertension follow-up encounter" + } + ], + "text": "Hypertension follow-up encounter" + }, + "servicedPeriod": { + "start": "2017-11-03T23:35:42-04:00", + "end": "2017-11-03T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } + ] + }, + "encounter": [ + { + "reference": "urn:uuid:36f889c6-1ef4-480d-9508-3811a64609b4" + } + ] + } + ], + "total": [ + { + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } + ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } + ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, + { + "fullUrl": "urn:uuid:8dcc9b79-6d7c-4d15-bfce-4a27ac0ae79b", + "resource": { + "resourceType": "Encounter", + "id": "8dcc9b79-6d7c-4d15-bfce-4a27ac0ae79b", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "390906007", + "display": "Hypertension follow-up encounter" + } + ], + "text": "Hypertension follow-up encounter" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + }, + "participant": [ + { + "individual": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a", + "display": "Dr. Roberto515 Haag279" + } + } + ], + "period": { + "start": "2018-01-02T22:35:42-05:00", + "end": "2018-01-02T23:05:42-05:00" + }, + "serviceProvider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, + { + "fullUrl": "urn:uuid:a17c0152-a871-4c6e-b337-87ec57b0fa49", + "resource": { + "resourceType": "Observation", + "id": "a17c0152-a871-4c6e-b337-87ec57b0fa49", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "55284-4", + "display": "Blood Pressure" + } + ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:8dcc9b79-6d7c-4d15-bfce-4a27ac0ae79b" + }, + "effectiveDateTime": "2018-01-02T22:35:42-05:00", + "issued": "2018-01-02T22:35:42.651-05:00", + "component": [ + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } + ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 99.67155697698848, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } + ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 147.9412314150588, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } + ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:6392bf2a-eaa8-4996-a87e-43d9a4fa6f58", + "resource": { + "resourceType": "Procedure", + "id": "6392bf2a-eaa8-4996-a87e-43d9a4fa6f58", + "status": "completed", + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "183856001", + "display": "Referral to hypertension clinic" + } + ], + "text": "Referral to hypertension clinic" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:8dcc9b79-6d7c-4d15-bfce-4a27ac0ae79b" + }, + "performedPeriod": { + "start": "2018-01-02T22:35:42-05:00", + "end": "2018-01-02T22:50:42-05:00" + } + }, + "request": { + "method": "POST", + "url": "Procedure" + } + }, + { + "fullUrl": "urn:uuid:7b5f883f-7ea3-4d38-9109-5429de42cc75", + "resource": { + "resourceType": "Claim", + "id": "7b5f883f-7ea3-4d38-9109-5429de42cc75", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Tania553 Harris789" + }, + "billablePeriod": { + "start": "2018-01-02T22:35:42-05:00", + "end": "2018-01-02T23:05:42-05:00" + }, + "created": "2018-01-02T23:05:42-05:00", + "provider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "procedure": [ + { + "sequence": 1, + "procedureReference": { + "reference": "urn:uuid:6392bf2a-eaa8-4996-a87e-43d9a4fa6f58" + } + } + ], + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "390906007", + "display": "Hypertension follow-up encounter" + } + ], + "text": "Hypertension follow-up encounter" + }, + "encounter": [ + { + "reference": "urn:uuid:8dcc9b79-6d7c-4d15-bfce-4a27ac0ae79b" + } + ] + }, + { + "sequence": 2, + "procedureSequence": [ + 1 + ], + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "183856001", + "display": "Referral to hypertension clinic" + } + ], + "text": "Referral to hypertension clinic" + }, + "net": { + "value": 516.65, + "currency": "USD" + } + } + ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:491d2890-4fb7-4367-975a-a862376a2bd7", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "491d2890-4fb7-4367-975a-a862376a2bd7", + "contained": [ + { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "performer": [ + { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + } + ] + }, + { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "NO_INSURANCE" + }, + "beneficiary": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "payor": [ + { + "display": "NO_INSURANCE" + } + ] + } + ], + "identifier": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "7b5f883f-7ea3-4d38-9109-5429de42cc75" + }, + { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } + ], + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2018-01-02T23:05:42-05:00", + "end": "2019-01-02T23:05:42-05:00" + }, + "created": "2018-01-02T23:05:42-05:00", + "insurer": { + "display": "NO_INSURANCE" + }, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "referral": { + "reference": "#referral" + }, + "claim": { + "reference": "urn:uuid:7b5f883f-7ea3-4d38-9109-5429de42cc75" + }, + "outcome": "complete", + "careTeam": [ + { + "sequence": 1, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "role": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } + ] + } + } + ], + "insurance": [ + { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "390906007", + "display": "Hypertension follow-up encounter" + } + ], + "text": "Hypertension follow-up encounter" + }, + "servicedPeriod": { + "start": "2018-01-02T22:35:42-05:00", + "end": "2018-01-02T23:05:42-05:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } + ] + }, + "encounter": [ + { + "reference": "urn:uuid:8dcc9b79-6d7c-4d15-bfce-4a27ac0ae79b" + } + ] + }, + { + "sequence": 2, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "183856001", + "display": "Referral to hypertension clinic" + } + ], + "text": "Referral to hypertension clinic" + }, + "servicedPeriod": { + "start": "2018-01-02T22:35:42-05:00", + "end": "2018-01-02T23:05:42-05:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } + ] + }, + "net": { + "value": 516.65, + "currency": "USD" + }, + "adjudication": [ + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display": "Line Beneficiary Coinsurance Amount" + } + ] + }, + "amount": { + "value": 103.33, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display": "Line Provider Payment Amount" + } + ] + }, + "amount": { + "value": 413.32, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display": "Line Submitted Charge Amount" + } + ] + }, + "amount": { + "value": 516.65, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display": "Line Allowed Charge Amount" + } + ] + }, + "amount": { + "value": 516.65, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display": "Line Beneficiary Part B Deductible Amount" + } + ] + }, + "amount": { + "value": 0, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display": "Line Processing Indicator Code" + } + ] + } + } + ] + } + ], + "total": [ + { + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } + ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } + ], + "payment": { + "amount": { + "value": 413.32, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, + { + "fullUrl": "urn:uuid:b29706c4-2e57-41f7-8e7d-cd510bfd8d4a", + "resource": { + "resourceType": "Encounter", + "id": "b29706c4-2e57-41f7-8e7d-cd510bfd8d4a", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "698314001", + "display": "Consultation for treatment" + } + ], + "text": "Consultation for treatment" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + }, + "participant": [ + { + "individual": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a", + "display": "Dr. Roberto515 Haag279" + } + } + ], + "period": { + "start": "2018-05-13T23:35:42-04:00", + "end": "2018-05-13T23:50:42-04:00" + }, + "serviceProvider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, + { + "fullUrl": "urn:uuid:42ae14d1-af65-4ab2-ab85-7aa3528b3117", + "resource": { + "resourceType": "MedicationRequest", + "id": "42ae14d1-af65-4ab2-ab85-7aa3528b3117", + "status": "stopped", + "intent": "order", + "medicationCodeableConcept": { + "coding": [ + { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "757594", + "display": "Jolivette 28 Day Pack" + } + ], + "text": "Jolivette 28 Day Pack" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:b29706c4-2e57-41f7-8e7d-cd510bfd8d4a" + }, + "authoredOn": "2018-05-13T23:35:42-04:00", + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a", + "display": "Dr. Roberto515 Haag279" + } + }, + "request": { + "method": "POST", + "url": "MedicationRequest" + } + }, + { + "fullUrl": "urn:uuid:1407ea30-f713-4002-b680-247a84176d4b", + "resource": { + "resourceType": "Claim", + "id": "1407ea30-f713-4002-b680-247a84176d4b", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "pharmacy" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2018-05-13T23:35:42-04:00", + "end": "2018-05-13T23:50:42-04:00" + }, + "created": "2018-05-13T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "prescription": { + "reference": "urn:uuid:42ae14d1-af65-4ab2-ab85-7aa3528b3117" + }, + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "698314001", + "display": "Consultation for treatment" + } + ], + "text": "Consultation for treatment" + }, + "encounter": [ + { + "reference": "urn:uuid:b29706c4-2e57-41f7-8e7d-cd510bfd8d4a" + } + ] + } + ], + "total": { + "value": 30.75, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:ac80378d-afdb-40ca-a96a-217d00ec27a9", + "resource": { + "resourceType": "Claim", + "id": "ac80378d-afdb-40ca-a96a-217d00ec27a9", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Tania553 Harris789" + }, + "billablePeriod": { + "start": "2018-05-13T23:35:42-04:00", + "end": "2018-05-13T23:50:42-04:00" + }, + "created": "2018-05-13T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:a9f20dc1-5147-3789-bcef-bbecb41c5983", + "display": "HOLY FAMILY HOSPITAL" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "698314001", + "display": "Consultation for treatment" + } + ], + "text": "Consultation for treatment" + }, + "encounter": [ + { + "reference": "urn:uuid:b29706c4-2e57-41f7-8e7d-cd510bfd8d4a" + } + ] + } + ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:eb9fc85c-7469-4cb0-a6bd-f3e56798404f", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "eb9fc85c-7469-4cb0-a6bd-f3e56798404f", + "contained": [ + { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "performer": [ + { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + } + ] + }, + { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "NO_INSURANCE" + }, + "beneficiary": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "payor": [ + { + "display": "NO_INSURANCE" + } + ] + } + ], + "identifier": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "ac80378d-afdb-40ca-a96a-217d00ec27a9" + }, + { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } + ], + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2018-05-13T23:50:42-04:00", + "end": "2019-05-13T23:50:42-04:00" + }, + "created": "2018-05-13T23:50:42-04:00", + "insurer": { + "display": "NO_INSURANCE" + }, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "referral": { + "reference": "#referral" + }, + "claim": { + "reference": "urn:uuid:ac80378d-afdb-40ca-a96a-217d00ec27a9" + }, + "outcome": "complete", + "careTeam": [ + { + "sequence": 1, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000014a" + }, + "role": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } + ] + } + } + ], + "insurance": [ + { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "NO_INSURANCE" + } + } + ], + "item": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "698314001", + "display": "Consultation for treatment" + } + ], + "text": "Consultation for treatment" + }, + "servicedPeriod": { + "start": "2018-05-13T23:35:42-04:00", + "end": "2018-05-13T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } + ] + }, + "encounter": [ + { + "reference": "urn:uuid:b29706c4-2e57-41f7-8e7d-cd510bfd8d4a" + } + ] + } + ], + "total": [ + { + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } + ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } + ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, + { + "fullUrl": "urn:uuid:51d12755-88a9-4861-985f-4ec3f734bf63", + "resource": { + "resourceType": "Encounter", + "id": "51d12755-88a9-4861-985f-4ec3f734bf63", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } + ], + "text": "General examination of patient (procedure)" + } + ], + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Ms. Tania553 Harris789" + }, + "participant": [ + { + "individual": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce", + "display": "Dr. Jacalyn740 Lindgren255" + } + } + ], + "period": { + "start": "2018-08-11T23:35:42-04:00", + "end": "2018-08-11T23:50:42-04:00" + }, + "serviceProvider": { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, + { + "fullUrl": "urn:uuid:170d30dc-66b2-4c9e-9f6c-b6074932bb46", + "resource": { + "resourceType": "Observation", + "id": "170d30dc-66b2-4c9e-9f6c-b6074932bb46", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8302-2", + "display": "Body Height" + } + ], + "text": "Body Height" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:51d12755-88a9-4861-985f-4ec3f734bf63" + }, + "effectiveDateTime": "2018-08-11T23:35:42-04:00", + "issued": "2018-08-11T23:35:42.651-04:00", + "valueQuantity": { + "value": 152.26816916412497, + "unit": "cm", + "system": "http://unitsofmeasure.org", + "code": "cm" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:a722c8f1-950e-4a47-b158-e59df9096608", + "resource": { + "resourceType": "Observation", + "id": "a722c8f1-950e-4a47-b158-e59df9096608", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72514-3", + "display": "Pain severity - 0-10 verbal numeric rating [Score] - Reported" + } + ], + "text": "Pain severity - 0-10 verbal numeric rating [Score] - Reported" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:51d12755-88a9-4861-985f-4ec3f734bf63" + }, + "effectiveDateTime": "2018-08-11T23:35:42-04:00", + "issued": "2018-08-11T23:35:42.651-04:00", + "valueQuantity": { + "value": 2.3907776840875865, + "unit": "{score}", + "system": "http://unitsofmeasure.org", + "code": "{score}" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:8a07f639-b7f7-4367-beb2-5019cdefbbfc", + "resource": { + "resourceType": "Observation", + "id": "8a07f639-b7f7-4367-beb2-5019cdefbbfc", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "29463-7", + "display": "Body Weight" + } + ], + "text": "Body Weight" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:51d12755-88a9-4861-985f-4ec3f734bf63" + }, + "effectiveDateTime": "2018-08-11T23:35:42-04:00", + "issued": "2018-08-11T23:35:42.651-04:00", + "valueQuantity": { + "value": 72.07338046953858, + "unit": "kg", + "system": "http://unitsofmeasure.org", + "code": "kg" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:9cbbe94e-6928-4d62-8c23-2439f199466d", + "resource": { + "resourceType": "Observation", + "id": "9cbbe94e-6928-4d62-8c23-2439f199466d", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "39156-5", + "display": "Body Mass Index" + } + ], + "text": "Body Mass Index" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:51d12755-88a9-4861-985f-4ec3f734bf63" + }, + "effectiveDateTime": "2018-08-11T23:35:42-04:00", + "issued": "2018-08-11T23:35:42.651-04:00", + "valueQuantity": { + "value": 31.08541290865568, + "unit": "kg/m2", + "system": "http://unitsofmeasure.org", + "code": "kg/m2" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:d4651b24-9a80-4a46-90a2-29a851c2d2ce", + "resource": { + "resourceType": "Observation", + "id": "d4651b24-9a80-4a46-90a2-29a851c2d2ce", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "59576-9", + "display": "Body mass index (BMI) [Percentile] Per age and gender" + } + ], + "text": "Body mass index (BMI) [Percentile] Per age and gender" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:51d12755-88a9-4861-985f-4ec3f734bf63" + }, + "effectiveDateTime": "2018-08-11T23:35:42-04:00", + "issued": "2018-08-11T23:35:42.651-04:00", + "valueQuantity": { + "value": 94.93558382536055, + "unit": "%", + "system": "http://unitsofmeasure.org", + "code": "%" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:e16d3136-7f42-44e1-89fd-503e8764d41d", + "resource": { + "resourceType": "Observation", + "id": "e16d3136-7f42-44e1-89fd-503e8764d41d", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "55284-4", + "display": "Blood Pressure" + } + ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:51d12755-88a9-4861-985f-4ec3f734bf63" + }, + "effectiveDateTime": "2018-08-11T23:35:42-04:00", + "issued": "2018-08-11T23:35:42.651-04:00", + "component": [ + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } + ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 110.4401769347791, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } + ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 154.09745345898082, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } + ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:a3bf4137-e096-46ff-a829-11f58a7a365c", + "resource": { + "resourceType": "Observation", + "id": "a3bf4137-e096-46ff-a829-11f58a7a365c", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "survey", + "display": "survey" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72166-2", + "display": "Tobacco smoking status NHIS" + } + ], + "text": "Tobacco smoking status NHIS" + }, + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:51d12755-88a9-4861-985f-4ec3f734bf63" + }, + "effectiveDateTime": "2018-08-11T23:35:42-04:00", + "issued": "2018-08-11T23:35:42.651-04:00", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "266919005", + "display": "Never smoker" + } + ], + "text": "Never smoker" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, + { + "fullUrl": "urn:uuid:76b47b2c-6f91-47cb-8c69-f33ea345efcb", + "resource": { + "resourceType": "Immunization", + "id": "76b47b2c-6f91-47cb-8c69-f33ea345efcb", + "status": "completed", + "vaccineCode": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "encounter": { + "reference": "urn:uuid:51d12755-88a9-4861-985f-4ec3f734bf63" + }, + "occurrenceDateTime": "2018-08-11T23:35:42-04:00", + "primarySource": true + }, + "request": { + "method": "POST", + "url": "Immunization" + } + }, + { + "fullUrl": "urn:uuid:3602f834-1408-41d4-95b2-770fa35821a0", + "resource": { + "resourceType": "Claim", + "id": "3602f834-1408-41d4-95b2-770fa35821a0", + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a", + "display": "Tania553 Harris789" + }, + "billablePeriod": { + "start": "2018-08-11T23:35:42-04:00", + "end": "2018-08-11T23:50:42-04:00" + }, + "created": "2018-08-11T23:50:42-04:00", + "provider": { + "reference": "urn:uuid:783421ae-905a-3082-ae86-cb958fffaa7c", + "display": "GEMINI PHYSICAL THERAPY LLC" + }, + "priority": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } + ] + }, + "supportingInfo": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claiminformationcategory", + "code": "info" + } + ] + }, + "valueReference": { + "reference": "urn:uuid:76b47b2c-6f91-47cb-8c69-f33ea345efcb" + } + } + ], + "insurance": [ + { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Anthem" + } + } + ], + "item": [ + { + "sequence": 1, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } + ], + "text": "General examination of patient (procedure)" + }, + "encounter": [ + { + "reference": "urn:uuid:51d12755-88a9-4861-985f-4ec3f734bf63" + } + ] + }, + { + "sequence": 2, + "informationSequence": [ + 1 + ], + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "net": { + "value": 140.52, + "currency": "USD" + } + } + ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, + { + "fullUrl": "urn:uuid:7365faf1-cf9e-489c-904e-65aff0d6e92e", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "7365faf1-cf9e-489c-904e-65aff0d6e92e", + "contained": [ + { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "requester": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "performer": [ + { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + } + ] + }, + { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Anthem" + }, + "beneficiary": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "payor": [ + { + "display": "Anthem" + } + ] + } + ], + "identifier": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "3602f834-1408-41d4-95b2-770fa35821a0" + }, + { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } + ], + "status": "active", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } + ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:57959813-8cd2-4e3c-8970-e4364b74980a" + }, + "billablePeriod": { + "start": "2018-08-11T23:50:42-04:00", + "end": "2019-08-11T23:50:42-04:00" + }, + "created": "2018-08-11T23:50:42-04:00", + "insurer": { + "display": "Anthem" + }, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "referral": { + "reference": "#referral" + }, + "claim": { + "reference": "urn:uuid:3602f834-1408-41d4-95b2-770fa35821a0" + }, + "outcome": "complete", + "careTeam": [ + { + "sequence": 1, + "provider": { + "reference": "urn:uuid:0000016d-3a85-4cca-0000-0000000081ce" + }, + "role": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } + ] + } + } + ], + "insurance": [ + { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Anthem" + } + } + ], + "item": [ + { + "sequence": 1, + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } + ], + "text": "General examination of patient (procedure)" + }, + "servicedPeriod": { + "start": "2018-08-11T23:35:42-04:00", + "end": "2018-08-11T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "encounter": [ + { + "reference": "urn:uuid:51d12755-88a9-4861-985f-4ec3f734bf63" + } + ] + }, + { + "sequence": 2, + "informationSequence": [ + 1 + ], + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } + ] + }, + "productOrService": { + "coding": [ + { + "system": "http://hl7.org/fhir/sid/cvx", + "code": "140", + "display": "Influenza, seasonal, injectable, preservative free" + } + ], + "text": "Influenza, seasonal, injectable, preservative free" + }, + "servicedPeriod": { + "start": "2018-08-11T23:35:42-04:00", + "end": "2018-08-11T23:50:42-04:00" + }, + "locationCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } + ] + }, + "net": { + "value": 140.52, + "currency": "USD" + }, + "adjudication": [ + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display": "Line Beneficiary Coinsurance Amount" + } + ] + }, + "amount": { + "value": 28.104000000000003, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display": "Line Provider Payment Amount" + } + ] + }, + "amount": { + "value": 112.41600000000001, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display": "Line Submitted Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display": "Line Allowed Charge Amount" + } + ] + }, + "amount": { + "value": 140.52, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display": "Line Beneficiary Part B Deductible Amount" + } + ] + }, + "amount": { + "value": 0, + "currency": "USD" + } + }, + { + "category": { + "coding": [ + { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display": "Line Processing Indicator Code" + } + ] + } + } + ] + } + ], + "total": [ + { + "category": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } + ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } + ], + "payment": { + "amount": { + "value": 112.41600000000001, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + } + ] +} diff --git a/backend/pkg/web/handler/unsafe.go b/backend/pkg/web/handler/unsafe.go index 5f589493..735805c0 100644 --- a/backend/pkg/web/handler/unsafe.go +++ b/backend/pkg/web/handler/unsafe.go @@ -3,6 +3,7 @@ package handler import ( "github.com/fastenhealth/fasten-sources/clients/factory" sourcePkg "github.com/fastenhealth/fasten-sources/pkg" + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/config" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/database" "github.com/gin-gonic/gin" @@ -17,9 +18,10 @@ These Endpoints are only available when Fasten is deployed with allow_unsafe_end */ func UnsafeRequestSource(c *gin.Context) { - logger := c.MustGet("LOGGER").(*logrus.Entry) - appConfig := c.MustGet("CONFIG").(config.Interface) - databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + logger := c.MustGet(pkg.ContextKeyTypeLogger).(*logrus.Entry) + appConfig := c.MustGet(pkg.ContextKeyTypeConfig).(config.Interface) + databaseRepo := c.MustGet(pkg.ContextKeyTypeDatabase).(database.DatabaseRepository) + //safety check incase this function is called in another way if !appConfig.GetBool("web.allow_unsafe_endpoints") { c.JSON(http.StatusServiceUnavailable, gin.H{"success": false}) @@ -79,3 +81,18 @@ func UnsafeRequestSource(c *gin.Context) { } c.JSON(http.StatusOK, gin.H{"success": true, "data": resp}) } + +func UnsafeResourceGraph(c *gin.Context) { + appConfig := c.MustGet(pkg.ContextKeyTypeConfig).(config.Interface) + //safety check incase this function is called in another way + if !appConfig.GetBool("web.allow_unsafe_endpoints") { + c.JSON(http.StatusServiceUnavailable, gin.H{"success": false}) + return + } + + //!!!!!!INSECURE!!!!!!S + //We're setting the username to a user provided value, this is insecure, but required for calling databaseRepo fns + c.Set(pkg.ContextKeyTypeAuthUsername, c.Param("username")) + + GetResourceFhirGraph(c) +} diff --git a/backend/pkg/web/middleware/config.go b/backend/pkg/web/middleware/config.go index 88d2343a..de63c976 100644 --- a/backend/pkg/web/middleware/config.go +++ b/backend/pkg/web/middleware/config.go @@ -1,13 +1,14 @@ package middleware import ( + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/config" "github.com/gin-gonic/gin" ) func ConfigMiddleware(appConfig config.Interface) gin.HandlerFunc { return func(c *gin.Context) { - c.Set("CONFIG", appConfig) + c.Set(pkg.ContextKeyTypeConfig, appConfig) c.Next() } } diff --git a/backend/pkg/web/middleware/database.go b/backend/pkg/web/middleware/database.go index 85b08052..e33ca05a 100644 --- a/backend/pkg/web/middleware/database.go +++ b/backend/pkg/web/middleware/database.go @@ -1,6 +1,7 @@ package middleware import ( + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/config" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/database" "github.com/gin-gonic/gin" @@ -16,7 +17,7 @@ func RepositoryMiddleware(appConfig config.Interface, globalLogger logrus.FieldL //TODO: determine where we can call defer deviceRepo.Close() return func(c *gin.Context) { - c.Set("REPOSITORY", deviceRepo) + c.Set(pkg.ContextKeyTypeDatabase, deviceRepo) c.Next() } } diff --git a/backend/pkg/web/middleware/logger.go b/backend/pkg/web/middleware/logger.go index 8540d5fa..6db73dcd 100644 --- a/backend/pkg/web/middleware/logger.go +++ b/backend/pkg/web/middleware/logger.go @@ -3,6 +3,7 @@ package middleware import ( "bytes" "fmt" + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg" "github.com/gin-gonic/gin" "github.com/sirupsen/logrus" "io" @@ -51,7 +52,7 @@ func LoggerMiddleware(logger *logrus.Entry) gin.HandlerFunc { path := c.Request.URL.Path blw := &responseBodyLogWriter{body: &bytes.Buffer{}, ResponseWriter: c.Writer} c.Writer = blw - c.Set("LOGGER", logger) + c.Set(pkg.ContextKeyTypeLogger, logger) start := time.Now() c.Next() stop := time.Since(start) diff --git a/backend/pkg/web/middleware/require_auth.go b/backend/pkg/web/middleware/require_auth.go index eb11d036..31b5250f 100644 --- a/backend/pkg/web/middleware/require_auth.go +++ b/backend/pkg/web/middleware/require_auth.go @@ -1,6 +1,7 @@ package middleware import ( + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/auth" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/config" "github.com/gin-gonic/gin" @@ -11,7 +12,7 @@ import ( func RequireAuth() gin.HandlerFunc { return func(c *gin.Context) { - appConfig := c.MustGet("CONFIG").(config.Interface) + appConfig := c.MustGet(pkg.ContextKeyTypeConfig).(config.Interface) authHeader := c.GetHeader("Authorization") authHeaderParts := strings.Split(authHeader, " ") @@ -38,8 +39,8 @@ func RequireAuth() gin.HandlerFunc { } //todo, is this shared between all sessions?? - c.Set("AUTH_TOKEN", tokenString) - c.Set("AUTH_USERNAME", claim.Subject) + c.Set(pkg.ContextKeyTypeAuthToken, tokenString) + c.Set(pkg.ContextKeyTypeAuthUsername, claim.Subject) c.Next() } diff --git a/backend/pkg/web/server.go b/backend/pkg/web/server.go index a4527127..1bdbb287 100644 --- a/backend/pkg/web/server.go +++ b/backend/pkg/web/server.go @@ -60,7 +60,7 @@ func (ae *AppEngine) Setup(logger *logrus.Entry) *gin.Engine { secure.GET("/resource/fhir", handler.ListResourceFhir) secure.GET("/resource/graph", handler.GetResourceFhirGraph) secure.GET("/resource/fhir/:sourceId/:resourceId", handler.GetResourceFhir) - secure.POST("/resource/association", handler.ReplaceResourceAssociation) + secure.POST("/resource/composition", handler.CreateResourceComposition) } if ae.Config.GetBool("web.allow_unsafe_endpoints") { @@ -80,6 +80,7 @@ func (ae *AppEngine) Setup(logger *logrus.Entry) *gin.Engine { { //http://localhost:9090/api/raw/test@test.com/436d7277-ad56-41ce-9823-44e353d1b3f6/Patient/smart-1288992 unsafe.GET("/:username/:sourceId/*path", handler.UnsafeRequestSource) + unsafe.GET("/:username/graph", handler.UnsafeResourceGraph) } } diff --git a/frontend/src/app/app-routing.module.ts b/frontend/src/app/app-routing.module.ts index 5d7b4f2e..14b1929c 100644 --- a/frontend/src/app/app-routing.module.ts +++ b/frontend/src/app/app-routing.module.ts @@ -24,6 +24,7 @@ const routes: Routes = [ { path: 'dashboard', component: DashboardComponent, canActivate: [ IsAuthenticatedAuthGuard] }, { path: 'source/:source_id', component: SourceDetailComponent, canActivate: [ IsAuthenticatedAuthGuard] }, { path: 'source/:source_id/resource/:resource_id', component: ResourceDetailComponent, canActivate: [ IsAuthenticatedAuthGuard] }, + { path: 'source/:source_id/resource/:resource_type/:resource_id', component: ResourceDetailComponent, canActivate: [ IsAuthenticatedAuthGuard] }, { path: 'sources', component: MedicalSourcesComponent, canActivate: [ IsAuthenticatedAuthGuard] }, { path: 'sources/callback/:source_type', component: MedicalSourcesComponent, canActivate: [ IsAuthenticatedAuthGuard] }, diff --git a/frontend/src/app/components/report-labs-observation/report-labs-observation.component.ts b/frontend/src/app/components/report-labs-observation/report-labs-observation.component.ts index c8f0eda8..c5ce945c 100644 --- a/frontend/src/app/components/report-labs-observation/report-labs-observation.component.ts +++ b/frontend/src/app/components/report-labs-observation/report-labs-observation.component.ts @@ -160,6 +160,10 @@ export class ReportLabsObservationComponent implements OnInit { let referenceRanges = [] + //sort observations + this.observations = this.observations.sort((a, b) => a.sort_date > b.sort_date ? -1 : a.sort_date < b.sort_date ? 1 : 0) + + for(let observation of this.observations){ //get label this.barChartLabels.push( diff --git a/frontend/src/app/components/report-medical-history-condition/report-medical-history-condition.component.html b/frontend/src/app/components/report-medical-history-condition/report-medical-history-condition.component.html index 4f23e7fe..6b5aa315 100644 --- a/frontend/src/app/components/report-medical-history-condition/report-medical-history-condition.component.html +++ b/frontend/src/app/components/report-medical-history-condition/report-medical-history-condition.component.html @@ -1,12 +1,12 @@
-
+
- {{condition | fhirPath: "Condition.code.text.first()":"Condition.code.coding.display.first()"}} + {{conditionDisplayModel?.sort_title ? conditionDisplayModel?.sort_title : (conditionGroup | fhirPath: "Condition.code.text.first()":"Condition.code.coding.display.first()")}}
- {{condition | fhirPath: "Condition.onsetPeriod.start":"Condition.onsetDateTime" | date }} - {{condition | fhirPath: "Condition.onsetPeriod.end" | date}} + {{conditionGroup | fhirPath: "Condition.onsetPeriod.start":"Condition.onsetDateTime" | date }} - {{conditionGroup | fhirPath: "Condition.onsetPeriod.end" | date}}
@@ -14,29 +14,21 @@
- +
-
+

Involved in Care

- -
- {{careTeamEntry.value | fhirPath: "CareTeam.participant.member.display"}} -
-
- {{careTeamEntry.value | fhirPath: "CareTeam.participant.role.text"}} -
-
- - -
- {{practitionerEntry.value | fhirPath: "Practitioner.name.family"}}, {{practitionerEntry.value | fhirPath: "Practitioner.name.given"}} -
-
- {{practitionerEntry.value | fhirPath: "Practitioner.name.prefix"}} -
+ +
+ {{practitioner.displayName}} +
+
+ {{practitioner.role}} + +
@@ -48,12 +40,12 @@
- + show all
    -
  • Resource: {{resource.source_resource_type}}/{{resource.source_resource_id}}
  • +
  • {{resourceEntry.value.source_resource_type}} {{resourceEntry.value.sort_title ? '- '+resourceEntry.value.sort_title : '' }}
@@ -62,50 +54,53 @@
- + +
- {{encounter | fhirPath: "Encounter.period.start" | date}} + {{encounter.period_start | date}}
- {{encounter | fhirPath: "Encounter.location.first().location.display"}} + {{encounter.location_display }}
-
+
Medications:
    -
  • - {{medication | fhirPath: "MedicationRequest.medicationReference.display":"MedicationRequest.medicationCodeableConcept.text"}} +
  • + {{medication.display }} +
  • +
  • + {{medication.title}}
-
+
Procedures:
  • - {{procedure | fhirPath: "Procedure.code.text"}} + {{procedure.display}}
-
+
Tests and Examinations:
  • - {{diagnosticReport | fhirPath: "DiagnosticReport.code.text":"DiagnosticReport.code.coding.display"}} + {{diagnosticReport.title}}
- -
+
Device:
  • - {{device | fhirPath: "Device.code.text"}} + {{device.model}}
diff --git a/frontend/src/app/components/report-medical-history-condition/report-medical-history-condition.component.ts b/frontend/src/app/components/report-medical-history-condition/report-medical-history-condition.component.ts index e36d4e3f..30fe669f 100644 --- a/frontend/src/app/components/report-medical-history-condition/report-medical-history-condition.component.ts +++ b/frontend/src/app/components/report-medical-history-condition/report-medical-history-condition.component.ts @@ -1,52 +1,137 @@ import {Component, Input, OnInit} from '@angular/core'; import {ResourceFhir} from '../../models/fasten/resource_fhir'; +import {CareTeamModel} from '../../../lib/models/resources/care-team-model'; +import {PractitionerModel} from '../../../lib/models/resources/practitioner-model'; +import {EncounterModel} from '../../../lib/models/resources/encounter-model'; +import {fhirModelFactory} from '../../../lib/models/factory'; +import {fhirVersions, ResourceType} from '../../../lib/models/constants'; +import {MedicationModel} from '../../../lib/models/resources/medication-model'; +import {ProcedureModel} from '../../../lib/models/resources/procedure-model'; +import {DeviceModel} from '../../../lib/models/resources/device-model'; +import {DiagnosticReportModel} from '../../../lib/models/resources/diagnostic-report-model'; +import {FastenDisplayModel} from '../../../lib/models/fasten/fasten-display-model'; @Component({ selector: 'app-report-medical-history-condition', templateUrl: './report-medical-history-condition.component.html', styleUrls: ['./report-medical-history-condition.component.scss'] }) + export class ReportMedicalHistoryConditionComponent implements OnInit { - @Input() condition: ResourceFhir + /* + * conditionGroup is either a Condition or Composite object + * + * Condition + ├─ related_resources + │ ├─ Encounter1 + │ │ ├─ Location + │ ├─ Encounter2 + │ │ ├─ Observation + │ ├─ Observation + │ ├─ Location + * + * or + * Composite + ├─ related_resources + │ ├─ Condition2 + │ ├─ Condition + │ │ ├─ related_resources + │ │ │ ├─ Encounter1 + │ │ │ │ ├─ Location + │ │ │ ├─ Encounter2 + │ │ │ │ ├─ Observation + │ │ │ ├─ Observation + │ │ │ ├─ Location - careTeams: {[careTeamId: string]: ResourceFhir} = {} - practitioners: {[practitionerId: string]: ResourceFhir} = {} - encounters: {[encounterId: string]: ResourceFhir} = {} + * + * */ + @Input() conditionGroup: ResourceFhir + conditionDisplayModel: FastenDisplayModel + + //lookup table for all resources + resourcesLookup: {[name:string]: FastenDisplayModel} = {} + + involvedInCare: {displayName: string, role?: string, email?: string}[] = [] + encounters: EncounterModel[] = [] + // medications: {[encounterResourceId: string]: MedicationModel[]} = {} + // procedures: {[encounterResourceId: string]: ProcedureModel[]} = {} + // diagnosticReports: {[encounterResourceId: string]: DiagnosticReportModel[]} = {} + // device: {[encounterResourceId: string]: DeviceModel[]} = {} constructor() { } ngOnInit(): void { - for(let resource of this.condition.related_resources){ - this.recExtractResources(resource) - } + //add resources to the lookup table, ensure uniqueness. + this.conditionDisplayModel = this.recExtractResources(this.conditionGroup) - // console.log("EXTRACTED CARETEAM", this.careTeams) - // console.log("EXTRACTED practitioners", this.practitioners) - // console.log("EXTRACTED encounters", this.encounters) + + //loop though all resources, process display data + for(let resourceId in this.resourcesLookup){ + let resource = this.resourcesLookup[resourceId] + + switch(resource.source_resource_type){ + case ResourceType.CareTeam: + for(let participant of (resource as CareTeamModel).participants){ + this.involvedInCare.push({ + displayName: participant.display, + role: participant.role + }) + } + break + case ResourceType.Practitioner: + this.involvedInCare.push({ + displayName: `${(resource as PractitionerModel).name?.family }, ${(resource as PractitionerModel).name?.given}`, + role: `${(resource as PractitionerModel).name?.prefix || (resource as PractitionerModel).name?.suffix}` + }) + break + case ResourceType.Encounter: + this.encounters.push(resource as EncounterModel) + break + } + + } } - recExtractResources(resource: ResourceFhir){ - if(resource.source_resource_type == "CareTeam"){ - this.careTeams[this.genResourceId(resource)] = resource - } else if (resource.source_resource_type == "Practitioner"){ - this.practitioners[this.genResourceId(resource)] = resource - } else if (resource.source_resource_type == "Encounter"){ - this.encounters[this.genResourceId(resource)] = resource + /* + This function flattens all resources + */ + recExtractResources(resource: ResourceFhir): FastenDisplayModel{ + let resourceId = this.genResourceId(resource) + let resourceDisplayModel: FastenDisplayModel = this.resourcesLookup[resourceId] + + //ensure display model is populated + if(!resourceDisplayModel){ + try{ + resourceDisplayModel = fhirModelFactory(resource.source_resource_type as ResourceType, resource) + this.resourcesLookup[resourceId] = resourceDisplayModel + }catch(e){ + console.error(e) //failed to parse a model + return null + } + } + if(!resource.related_resources){ - return - } - for(let relatedResource of resource.related_resources){ - this.recExtractResources(relatedResource) + return resourceDisplayModel + } else { + for(let relatedResource of resource.related_resources){ + resourceDisplayModel.related_resources[relatedResource.source_resource_type] = resourceDisplayModel.related_resources[relatedResource.source_resource_type] || [] + + let relatedResourceDisplayModel = this.recExtractResources(relatedResource) + if(relatedResourceDisplayModel){ + resourceDisplayModel.related_resources[relatedResource.source_resource_type].push(relatedResourceDisplayModel) + } + } } + return resourceDisplayModel } genResourceId(relatedResource: ResourceFhir): string { - return `${relatedResource.source_id}/${relatedResource.source_resource_type}/${relatedResource.source_resource_id}` + return `/source/${relatedResource.source_id}/resource/${relatedResource.source_resource_type}/${relatedResource.source_resource_id}` } } diff --git a/frontend/src/app/components/report-medical-history-editor/report-medical-history-editor.component.html b/frontend/src/app/components/report-medical-history-editor/report-medical-history-editor.component.html index 7bf3082a..35d8ad9d 100644 --- a/frontend/src/app/components/report-medical-history-editor/report-medical-history-editor.component.html +++ b/frontend/src/app/components/report-medical-history-editor/report-medical-history-editor.component.html @@ -3,9 +3,53 @@
diff --git a/frontend/src/app/components/report-medical-history-editor/report-medical-history-editor.component.ts b/frontend/src/app/components/report-medical-history-editor/report-medical-history-editor.component.ts index c5207beb..fdb6c4a3 100644 --- a/frontend/src/app/components/report-medical-history-editor/report-medical-history-editor.component.ts +++ b/frontend/src/app/components/report-medical-history-editor/report-medical-history-editor.component.ts @@ -3,14 +3,16 @@ import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'; import {ResourceFhir} from '../../models/fasten/resource_fhir'; import {FastenApiService} from '../../services/fasten-api.service'; import * as fhirpath from 'fhirpath'; +import {ITreeOptions} from '@circlon/angular-tree-component'; class RelatedNode { name: string - resourceType: string - resourceId: string - sourceId: string - draggable: boolean + source_resource_type: string + source_resource_id: string + source_id: string children: RelatedNode[] + show_checkbox: boolean + resource: ResourceFhir } @Component({ @@ -21,9 +23,8 @@ class RelatedNode { export class ReportMedicalHistoryEditorComponent implements OnInit { @Input() conditions: ResourceFhir[] = [] - @Input() encounters: ResourceFhir[] = [] - - assignedEncounters: {[name: string]: ResourceFhir} = {} + resourceLookup: {[name: string]: ResourceFhir} = {} + compositionTitle: string = "" nodes = [ // { @@ -49,70 +50,62 @@ export class ReportMedicalHistoryEditorComponent implements OnInit { // ] // } ]; - options = { - allowDrag: (node) => {return node.data.draggable}, - allowDrop: (element, { parent, index }) => { - // return true / false based on element, to.parent, to.index. e.g. - return parent.data.resourceType == "Condition"; - }, - + options: ITreeOptions = { + allowDrag: false, + allowDrop: false, } + selectedResources:{ [id:string]: ResourceFhir} = {} constructor( public activeModal: NgbActiveModal, private fastenApi: FastenApiService, ) { } ngOnInit(): void { + console.log("ngOnInit STATUS", this.conditions) this.nodes = this.generateNodes(this.conditions) } - onResourceMoved($event) { + onResourceCheckboxClick($event, node:{data:RelatedNode}){ + let key = `${node.data.source_id}/${node.data.source_resource_type}/${node.data.source_resource_id}` + if($event.target.checked){ + this.selectedResources[key] = node.data.resource + if(!this.compositionTitle){ + this.compositionTitle = node.data.resource.sort_title + } + } else { + //delete this key (unselected) + delete this.selectedResources[key] + } + console.log("selected resources", this.selectedResources) + } - this.fastenApi.replaceResourceAssociation({ + onMergeResourcesClick() { - source_id: $event.to.parent.sourceId, - source_resource_type: $event.to.parent.resourceType, - source_resource_id: $event.to.parent.resourceId, + let resources: ResourceFhir[] = [] + for(let key in this.selectedResources){ + resources.push(this.selectedResources[key]) + } - new_related_source_id: $event.node.sourceId, - new_related_source_resource_type: $event.node.resourceType, - new_related_source_resource_id: $event.node.resourceId, - - - }).subscribe(results => { + this.fastenApi.createResourceComposition(this.compositionTitle, resources).subscribe(results => { console.log(results) - }) + this.activeModal.close() + },(err) => {}) } generateNodes(resouceFhirList: ResourceFhir[]): RelatedNode[] { let relatedNodes = resouceFhirList.map((resourceFhir) => { return this.recGenerateNode(resourceFhir) }) - - //create an unassigned encounters "condition" - if(this.encounters.length > 0){ - let unassignedCondition = { - name: "[Unassigned Encounters]", - resourceType: "Condition", - resourceId: "UNASSIGNED", - sourceId: "UNASSIGNED", - draggable: false, - children: [] - } - - for(let encounter of this.encounters){ - let encounterId = `${encounter.source_id}/${encounter.source_resource_type}/${encounter.source_resource_id}` - if(!this.assignedEncounters[encounterId]){ - this.assignedEncounters[encounterId] = encounter - unassignedCondition.children.push(this.recGenerateNode(encounter)) + for(let relatedNode of relatedNodes){ + if(relatedNode.source_id == 'UNASSIGNED' && relatedNode.source_resource_type == 'Condition' && relatedNode.source_resource_id == 'UNASSIGNED'){ + //this is a placeholder for the Unassigned resources. This resource cannot be merged, but all child resources can be, so lets set them to true + for(let unassignedEncounters of relatedNode.children){ + unassignedEncounters.show_checkbox = true } - } - - if(unassignedCondition.children.length > 0){ - //only add the unassigned condition block if the subchildren list is populated. - relatedNodes.push(unassignedCondition) + } else { + relatedNode.show_checkbox = true } } @@ -122,39 +115,48 @@ export class ReportMedicalHistoryEditorComponent implements OnInit { recGenerateNode(resourceFhir: ResourceFhir): RelatedNode { let relatedNode = { - sourceId: resourceFhir.source_id, - name: `[${resourceFhir.source_resource_type}/${resourceFhir.source_resource_id}]`, - resourceId: resourceFhir.source_resource_id, - resourceType: resourceFhir.source_resource_type, - draggable: resourceFhir.source_resource_type == "Encounter" || resourceFhir.source_resource_type == "Condition", + show_checkbox: false, + source_id: resourceFhir.source_id, + name: `[${resourceFhir.source_resource_type}/${resourceFhir.source_resource_id.length > 10 ? resourceFhir.source_resource_id.substring(0, 10)+ '...' : resourceFhir.source_resource_id}] `, + source_resource_id: resourceFhir.source_resource_id, + source_resource_type: resourceFhir.source_resource_type, children: [], + resource: resourceFhir } switch (resourceFhir.source_resource_type) { case "Condition": - relatedNode.name += ` ${fhirpath.evaluate(resourceFhir.resource_raw, "Condition.onsetPeriod.start")} ${fhirpath.evaluate(resourceFhir.resource_raw, "Condition.code.text.first()")}` + relatedNode.name += resourceFhir.sort_title || ` ${fhirpath.evaluate(resourceFhir.resource_raw, "Condition.onsetPeriod.start")} ${fhirpath.evaluate(resourceFhir.resource_raw, "Condition.code.text.first()")}` + if(resourceFhir.sort_date){ + relatedNode.name += ` - ${new Date(resourceFhir.sort_date).toLocaleDateString("en-US")}` + } break case "Encounter": - relatedNode.name += ` ${fhirpath.evaluate(resourceFhir.resource_raw, "Encounter.period.start")} ${fhirpath.evaluate(resourceFhir.resource_raw, "Encounter.location.first().location.display")}` + relatedNode.name += resourceFhir.sort_title ||` ${fhirpath.evaluate(resourceFhir.resource_raw, "Encounter.period.start")} ${fhirpath.evaluate(resourceFhir.resource_raw, "Encounter.location.first().location.display")}` + if(resourceFhir.sort_date){ + relatedNode.name += ` - ${new Date(resourceFhir.sort_date).toLocaleDateString("en-US")}` + } break case "CareTeam": - relatedNode.name += ` ${fhirpath.evaluate(resourceFhir.resource_raw, "CareTeam.participant.member.display")}` + relatedNode.name += resourceFhir.sort_title || ` ${fhirpath.evaluate(resourceFhir.resource_raw, "CareTeam.participant.member.display")}` break case "Location": - relatedNode.name += ` ${fhirpath.evaluate(resourceFhir.resource_raw, "Location.name")}` + relatedNode.name += resourceFhir.sort_title || ` ${fhirpath.evaluate(resourceFhir.resource_raw, "Location.name")}` break case "Organization": - relatedNode.name += ` ${fhirpath.evaluate(resourceFhir.resource_raw, "Organization.name")}` + relatedNode.name += resourceFhir.sort_title || ` ${fhirpath.evaluate(resourceFhir.resource_raw, "Organization.name")}` break case "Practitioner": - relatedNode.name += ` ${fhirpath.evaluate(resourceFhir.resource_raw, "Practitioner.name.family")}` + relatedNode.name += resourceFhir.sort_title || ` ${fhirpath.evaluate(resourceFhir.resource_raw, "Practitioner.name.family")}` break case "MedicationRequest": - relatedNode.name += ` ${fhirpath.evaluate(resourceFhir.resource_raw, "MedicationRequest.medicationReference.display")}` + relatedNode.name += resourceFhir.sort_title || ` ${fhirpath.evaluate(resourceFhir.resource_raw, "MedicationRequest.medicationReference.display")}` break + default: + relatedNode.name += resourceFhir.sort_title } - this.assignedEncounters[`${resourceFhir.source_id}/${resourceFhir.source_resource_type}/${resourceFhir.source_resource_id}`] = resourceFhir + this.resourceLookup[`${resourceFhir.source_id}/${resourceFhir.source_resource_type}/${resourceFhir.source_resource_id}`] = resourceFhir if(!resourceFhir.related_resources){ return relatedNode diff --git a/frontend/src/app/components/shared.module.ts b/frontend/src/app/components/shared.module.ts index f7215973..32711795 100644 --- a/frontend/src/app/components/shared.module.ts +++ b/frontend/src/app/components/shared.module.ts @@ -43,6 +43,7 @@ import { ReportMedicalHistoryConditionComponent } from './report-medical-history import { ReportLabsObservationComponent } from './report-labs-observation/report-labs-observation.component'; import { ChartsModule } from 'ng2-charts'; import { LoadingSpinnerComponent } from './loading-spinner/loading-spinner.component'; +import {FormsModule} from '@angular/forms'; @NgModule({ imports: [ @@ -50,6 +51,7 @@ import { LoadingSpinnerComponent } from './loading-spinner/loading-spinner.compo BrowserModule, NgxDatatableModule, NgbModule, + FormsModule, MomentModule, TreeModule, ChartsModule diff --git a/frontend/src/app/models/fasten/resource_fhir.ts b/frontend/src/app/models/fasten/resource_fhir.ts index afeb92a2..eb76a67c 100644 --- a/frontend/src/app/models/fasten/resource_fhir.ts +++ b/frontend/src/app/models/fasten/resource_fhir.ts @@ -8,6 +8,9 @@ export class ResourceFhir { resource_raw: IResourceRaw related_resources?: ResourceFhir[] = [] + sort_title: string = "" + sort_date: Date = null + constructor(object?: any) { return Object.assign(this, object) } diff --git a/frontend/src/app/pages/medical-history/medical-history.component.html b/frontend/src/app/pages/medical-history/medical-history.component.html index bffd9d56..310b3628 100644 --- a/frontend/src/app/pages/medical-history/medical-history.component.html +++ b/frontend/src/app/pages/medical-history/medical-history.component.html @@ -29,7 +29,7 @@
- + diff --git a/frontend/src/app/pages/medical-history/medical-history.component.ts b/frontend/src/app/pages/medical-history/medical-history.component.ts index a73f1fcd..589ffcf0 100644 --- a/frontend/src/app/pages/medical-history/medical-history.component.ts +++ b/frontend/src/app/pages/medical-history/medical-history.component.ts @@ -52,7 +52,7 @@ export class MedicalHistoryComponent implements OnInit { }, source_id: 'UNASSIGNED', source_resource_id: 'UNASSIGNED', - source_resource_type: 'UNASSIGNED', + source_resource_type: 'Condition', related_resources: this.unassigned_encounters } as any) } @@ -65,9 +65,10 @@ export class MedicalHistoryComponent implements OnInit { } openEditorRelated(): void { - const modalRef = this.modalService.open(ReportMedicalHistoryEditorComponent); + const modalRef = this.modalService.open(ReportMedicalHistoryEditorComponent, { + size: 'xl', + }); modalRef.componentInstance.conditions = this.conditions; - modalRef.componentInstance.encounters = this.unassigned_encounters; } diff --git a/frontend/src/app/pages/resource-detail/resource-detail.component.ts b/frontend/src/app/pages/resource-detail/resource-detail.component.ts index d75bb04e..1efad452 100644 --- a/frontend/src/app/pages/resource-detail/resource-detail.component.ts +++ b/frontend/src/app/pages/resource-detail/resource-detail.component.ts @@ -3,6 +3,7 @@ import {FastenApiService} from '../../services/fasten-api.service'; import {ActivatedRoute, Router} from '@angular/router'; import {ResourceFhir} from '../../models/fasten/resource_fhir'; import {fhirModelFactory} from '../../../lib/models/factory'; +import {ResourceType} from '../../../lib/models/constants'; @Component({ selector: 'app-resource-detail', @@ -29,7 +30,7 @@ export class ResourceDetailComponent implements OnInit { this.sourceName = "unknown" //TODO popualte this try{ - let parsed = fhirModelFactory(resourceFhir["source_resource_type"], resourceFhir["resource_raw"]) + let parsed = fhirModelFactory(resourceFhir["source_resource_type"] as ResourceType, resourceFhir) console.log("Successfully parsed model", parsed) } catch (e) { console.log("FAILED TO PARSE", resourceFhir) diff --git a/frontend/src/app/services/fasten-api.service.ts b/frontend/src/app/services/fasten-api.service.ts index 0ad4597c..563315c3 100644 --- a/frontend/src/app/services/fasten-api.service.ts +++ b/frontend/src/app/services/fasten-api.service.ts @@ -148,8 +148,12 @@ export class FastenApiService { ); } - replaceResourceAssociation(resourceAssociation: ResourceAssociation): Observable { - return this._httpClient.post(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/resource/association`, resourceAssociation) + //this method allows a user to manually group related FHIR resources together (conditions, encounters, etc). + createResourceComposition(title: string, resources: ResourceFhir[]){ + return this._httpClient.post(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/resource/composition`, { + "resources": resources, + "title": title, + }) .pipe( map((response: ResponseWrapper) => { console.log("RESPONSE", response) diff --git a/frontend/src/lib/models/constants.ts b/frontend/src/lib/models/constants.ts index 4008fc1f..4113094c 100644 --- a/frontend/src/lib/models/constants.ts +++ b/frontend/src/lib/models/constants.ts @@ -1,4 +1,37 @@ +export enum ResourceType { + AdverseEvent = "AdverseEvent", + AllergyIntolerance = "AllergyIntolerance", + Appointment = "Appointment", + Binary = "Binary", + CarePlan = "CarePlan", + CareTeam = "CareTeam", + Condition = "Condition", + Composition = "Composition", + Coverage = "Coverage", + Device = "Device", + DiagnosticReport = "DiagnosticReport", + DocumentReference = "DocumentReference", + Encounter = "Encounter", + Goal = "Goal", + Immunization = "Immunization", + Location = "Location", + Medication = "Medication", + MedicationDispense = "MedicationDispense", + MedicationRequest = "MedicationRequest", + Observation = "Observation", + Organization = "Organization", + Patient = "Patient", + Practitioner = "Practitioner", + PractitionerRole = "PractitionerRole", + Procedure = "Procedure", + Provenance = "Provenance", + RelatedPerson = "RelatedPerson", + ResearchStudy = "ResearchStudy", + ServiceRequest = "ServiceRequest", + Specimen = "Specimen", +} + export enum fhirVersions{ DSTU2 = "DSTU2", diff --git a/frontend/src/lib/models/factory.ts b/frontend/src/lib/models/factory.ts index f7d61ebe..a031eb83 100644 --- a/frontend/src/lib/models/factory.ts +++ b/frontend/src/lib/models/factory.ts @@ -1,4 +1,4 @@ -import {fhirVersions} from './constants'; +import {fhirVersions, ResourceType} from './constants'; import {AdverseEventModel} from './resources/adverse-event-model'; import {AllergyIntoleranceModel} from './resources/allergy-intolerance-model'; import {AppointmentModel} from './resources/appointment-model'; @@ -22,126 +22,144 @@ import {PractitionerRoleModel} from './resources/practitioner-role-model'; import {ProcedureModel} from './resources/procedure-model'; import {RelatedPersonModel} from './resources/related-person-model'; import {ResearchStudyModel} from './resources/research-study-model'; -import {BinaryModel} from './resources/binary-model'; +import {FastenOptions} from './fasten/fasten-options'; +import {FastenDisplayModel} from './fasten/fasten-display-model'; +import {MedicationRequestModel} from './resources/medication-request-model'; -export function fhirModelFactory(modelName: string, fhirResource: any, fhirVersion: fhirVersions = fhirVersions.R4):any { - switch (modelName) { - case "AdverseEvent": { - return new AdverseEventModel(fhirResource, fhirVersion) - } - case "AllergyIntolerance": { - return new AllergyIntoleranceModel(fhirResource, fhirVersion) - } - case "Appointment": { - return new AppointmentModel(fhirResource, fhirVersion) - } - case "Binary": { - return new BinaryModel(fhirResource, fhirVersion) - } - case "CarePlan": { - return new CarePlanModel(fhirResource, fhirVersion) - } - case "CareTeam": { - return new CareTeamModel(fhirResource, fhirVersion) - } - // case "Claim": { - // return new ClaimModel(fhirResource, fhirVersion) - // } - // case "ClaimResponse": { - // return new ClaimResponseModel(fhirResource, fhirVersion) - // } - case "Condition": { - return new ConditionModel(fhirResource, fhirVersion) - } - // case "Coverage": { - // return new CoverageModel(fhirResource, fhirVersion) - // } - case "Device": { - return new DeviceModel(fhirResource, fhirVersion) - } - case "DiagnosticReport": { - return new DiagnosticReportModel(fhirResource, fhirVersion) - } - case "DocumentReference": { - return new DocumentReferenceModel(fhirResource, fhirVersion) - } - case "Encounter": { - return new EncounterModel(fhirResource, fhirVersion) - } - // case "ExplanationOfBenefit": { - // return new ExplanationOfBenefitModel(fhirResource, fhirVersion) - // } - // case "FamilyMemberHistory": { - // return new FamilyMemberHistoryModel(fhirResource, fhirVersion) - // } - case "Goal": { - return new GoalModel(fhirResource, fhirVersion) - } - case "Immunization": { - return new ImmunizationModel(fhirResource, fhirVersion) - } - case "Location": { - return new LocationModel(fhirResource, fhirVersion) - } - case "Medication": { - return new MedicationModel(fhirResource, fhirVersion) - } - // case "MedicationAdministration": { - // return new MedicationAdministrationModel(fhirResource, fhirVersion) - // } - case "MedicationDispense": { - return new MedicationDispenseModel(fhirResource, fhirVersion) - } - // case "MedicationKnowledge": { - // return new MedicationKnowledgeModel(fhirResource, fhirVersion) - // } - // case "MedicationOrder": { - // return new MedicationOrderModel(fhirResource, fhirVersion) - // } - // case "MedicationRequest": { - // return new MedicationRequestModel(fhirResource, fhirVersion) - // } - // case "MedicationStatement": { - // return new MedicationStatementModel(fhirResource, fhirVersion) - // } - case "Observation": { - return new ObservationModel(fhirResource, fhirVersion) - } - case "Organization": { - return new OrganizationModel(fhirResource, fhirVersion) - } - case "Patient": { - return new PatientModel(fhirResource, fhirVersion) - } - case "Practitioner": { - return new PractitionerModel(fhirResource, fhirVersion) - } - case "PractitionerRole": { - return new PractitionerRoleModel(fhirResource, fhirVersion) - } - case "Procedure": { - return new ProcedureModel(fhirResource, fhirVersion) - } - // case "Questionnaire": { - // return new QuestionnaireModel(fhirResource, fhirVersion) - // } - // case "QuestionnaireResponse": { - // return new QuestionnaireResponseModel(fhirResource, fhirVersion) - // } - // case "ReferralRequest": { - // return new ReferralRequestModel(fhirResource, fhirVersion) - // } - case "RelatedPerson": { - return new RelatedPersonModel(fhirResource, fhirVersion) - } - case "ResearchStudy": { - return new ResearchStudyModel(fhirResource, fhirVersion) - } - // case "ResourceCategory": { - // return new ResourceCategoryModel(fhirResource, fhirVersion) - // } - default: { - throw new Error("Unknown resource data structure") - } - } +// import {BinaryModel} from './resources/binary-model'; + +export function fhirModelFactory(modelResourceType: ResourceType, fhirResourceWrapper: any, fhirVersion: fhirVersions = fhirVersions.R4, fastenOptions?: FastenOptions): FastenDisplayModel { + + let resourceModel: FastenDisplayModel + switch (modelResourceType) { + case "AdverseEvent": + resourceModel = new AdverseEventModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + case "AllergyIntolerance": + resourceModel = new AllergyIntoleranceModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + case "Appointment": + resourceModel = new AppointmentModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + + // case "Binary": { + // resourceModel = new BinaryModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + // } + case "CarePlan": + resourceModel = new CarePlanModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + case "CareTeam": + resourceModel = new CareTeamModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + // case "Claim": + // resourceModel = new ClaimModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + // break + // case "ClaimResponse": + // resourceModel = new ClaimResponseModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + // break + case "Condition": + resourceModel = new ConditionModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + case "Composition": + resourceModel = new ConditionModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + // case "Coverage": + // resourceModel = new CoverageModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + // break + case "Device": + resourceModel = new DeviceModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + case "DiagnosticReport": + resourceModel = new DiagnosticReportModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + case "DocumentReference": + resourceModel = new DocumentReferenceModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + case "Encounter": + resourceModel = new EncounterModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + // case "ExplanationOfBenefit": + // resourceModel = new ExplanationOfBenefitModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + // break + // case "FamilyMemberHistory": + // resourceModel = new FamilyMemberHistoryModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + //break + case "Goal": + resourceModel = new GoalModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + case "Immunization": + resourceModel = new ImmunizationModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + case "Location": + resourceModel = new LocationModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + case "Medication": + resourceModel = new MedicationModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + // case "MedicationAdministration": + // resourceModel = new MedicationAdministrationModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + // break + case "MedicationDispense": + resourceModel = new MedicationDispenseModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + // case "MedicationKnowledge": + // resourceModel = new MedicationKnowledgeModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + // break + // case "MedicationOrder": + // resourceModel = new MedicationOrderModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + // break + case "MedicationRequest": + resourceModel = new MedicationRequestModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + // case "MedicationStatement": + // resourceModel = new MedicationStatementModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + // break + case "Observation": + resourceModel = new ObservationModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + case "Organization": + resourceModel = new OrganizationModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + case "Patient": + resourceModel = new PatientModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + case "Practitioner": + resourceModel = new PractitionerModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + case "PractitionerRole": + resourceModel = new PractitionerRoleModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + case "Procedure": + resourceModel = new ProcedureModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + // case "Questionnaire": + // resourceModel = new QuestionnaireModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + // break + // case "QuestionnaireResponse": + // resourceModel = new QuestionnaireResponseModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + // break + // case "ReferralRequest": + // resourceModel = new ReferralRequestModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + // break + case "RelatedPerson": + resourceModel = new RelatedPersonModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + case "ResearchStudy": + resourceModel = new ResearchStudyModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + break + // case "ResourceCategory": + // resourceModel = new ResourceCategoryModel(fhirResourceWrapper.resource_raw, fhirVersion, fastenOptions) + // break + default: { + throw new Error("Ignoring Unknown resource data structure:" + modelResourceType) + } + } + + //transfer data from wrapper to the display model. + resourceModel.source_resource_id = fhirResourceWrapper.source_resource_id + resourceModel.source_id = fhirResourceWrapper.source_id + resourceModel.sort_title = fhirResourceWrapper.sort_title + resourceModel.sort_date = fhirResourceWrapper.sort_date + + return resourceModel } diff --git a/frontend/src/lib/models/fasten/fasten-display-model.spec.ts b/frontend/src/lib/models/fasten/fasten-display-model.spec.ts new file mode 100644 index 00000000..136de905 --- /dev/null +++ b/frontend/src/lib/models/fasten/fasten-display-model.spec.ts @@ -0,0 +1,7 @@ +import { FastenDisplayModel } from './fasten-display-model'; + +describe('FastenDisplayModel', () => { + it('should create an instance', () => { + expect(new FastenDisplayModel()).toBeTruthy(); + }); +}); diff --git a/frontend/src/lib/models/fasten/fasten-display-model.ts b/frontend/src/lib/models/fasten/fasten-display-model.ts new file mode 100644 index 00000000..78a95dae --- /dev/null +++ b/frontend/src/lib/models/fasten/fasten-display-model.ts @@ -0,0 +1,14 @@ +import {FastenOptions} from './fasten-options'; +import {ResourceType} from '../constants'; + +export class FastenDisplayModel { + source_resource_type: ResourceType | undefined + source_resource_id: string | undefined + source_id: string | undefined + sort_title: string | undefined + sort_date: Date | undefined + + related_resources: {[ modelResourceType: string]: FastenDisplayModel[]} = {} + + constructor(options?: FastenOptions) {} +} diff --git a/frontend/src/lib/models/fasten/fasten-options.spec.ts b/frontend/src/lib/models/fasten/fasten-options.spec.ts new file mode 100644 index 00000000..51890370 --- /dev/null +++ b/frontend/src/lib/models/fasten/fasten-options.spec.ts @@ -0,0 +1,7 @@ +import { FastenOptions } from './fasten-options'; + +describe('FastenOptions', () => { + it('should create an instance', () => { + expect(new FastenOptions()).toBeTruthy(); + }); +}); diff --git a/frontend/src/lib/models/fasten/fasten-options.ts b/frontend/src/lib/models/fasten/fasten-options.ts new file mode 100644 index 00000000..b476616c --- /dev/null +++ b/frontend/src/lib/models/fasten/fasten-options.ts @@ -0,0 +1,2 @@ +export class FastenOptions { +} diff --git a/frontend/src/lib/models/resources/adverse-event-model.spec.ts b/frontend/src/lib/models/resources/adverse-event-model.spec.ts index 031b3272..cac26751 100644 --- a/frontend/src/lib/models/resources/adverse-event-model.spec.ts +++ b/frontend/src/lib/models/resources/adverse-event-model.spec.ts @@ -20,7 +20,7 @@ describe('AdverseEventModel', () => { // expected.hasEventType = true expected.date = "2017-01-29T12:34:56+00:00" expected.seriousness = new CodableConceptModel({ coding: [ Object({ system: 'http://terminology.hl7.org/CodeSystem/adverse-event-seriousness', code: 'Non-serious', display: 'Non-serious' }) ] }) - expected.hasSeriousness = true + expected.has_seriousness = true expected.actuality = 'actual' expected.event = new CodableConceptModel({ "coding": [ @@ -32,7 +32,7 @@ describe('AdverseEventModel', () => { ], "text": "This was a mild rash on the left forearm" }) - expected.hasEvent = true + expected.has_event = true expect(new AdverseEventModel(fixture)).toEqual(expected); }); diff --git a/frontend/src/lib/models/resources/adverse-event-model.ts b/frontend/src/lib/models/resources/adverse-event-model.ts index 0b4ec3b0..facf4182 100644 --- a/frontend/src/lib/models/resources/adverse-event-model.ts +++ b/frontend/src/lib/models/resources/adverse-event-model.ts @@ -1,21 +1,25 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {CodableConceptModel, hasValue} from '../datatypes/codable-concept-model'; import {ReferenceModel} from '../datatypes/reference-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; -export class AdverseEventModel { +export class AdverseEventModel extends FastenDisplayModel { subject: ReferenceModel | undefined description: string | undefined - eventType: string | undefined - hasEventType: boolean | undefined + event_type: string | undefined + has_event_type: boolean | undefined date: string | undefined seriousness: CodableConceptModel | undefined - hasSeriousness: boolean | undefined + has_seriousness: boolean | undefined actuality: string | undefined event: CodableConceptModel | undefined - hasEvent: boolean | undefined + has_event: boolean | undefined - constructor(fhirResource: any, fhirVersion?: fhirVersions) { + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.AdverseEvent this.resourceDTO(fhirResource, fhirVersion || fhirVersions.R4); } @@ -25,20 +29,20 @@ export class AdverseEventModel { this.date = _.get(fhirResource, 'date'); let seriousness = _.get(fhirResource, 'seriousness', []) this.seriousness = new CodableConceptModel(seriousness); - this.hasSeriousness = hasValue(seriousness); + this.has_seriousness = hasValue(seriousness); }; stu3DTO(fhirResource:any){ this.description = _.get(fhirResource, 'description'); - this.eventType = _.get(fhirResource, 'type', []); - this.hasEventType = hasValue(this.eventType); + this.event_type = _.get(fhirResource, 'type', []); + this.has_event_type = hasValue(this.event_type); }; r4DTO(fhirResource:any){ this.actuality = _.get(fhirResource, 'actuality'); let event = _.get(fhirResource, 'event', []) this.event = new CodableConceptModel(event); - this.hasEvent = hasValue(event); + this.has_event = hasValue(event); }; resourceDTO(fhirResource: any, fhirVersion: fhirVersions){ diff --git a/frontend/src/lib/models/resources/allergy-intolerance-model.spec.ts b/frontend/src/lib/models/resources/allergy-intolerance-model.spec.ts index d9a619c3..e16b8de0 100644 --- a/frontend/src/lib/models/resources/allergy-intolerance-model.spec.ts +++ b/frontend/src/lib/models/resources/allergy-intolerance-model.spec.ts @@ -13,8 +13,8 @@ describe('AllergyIntoleranceModel', () => { let expected = new AllergyIntoleranceModel({}) expected.title = 'Cashew nuts' expected.status = 'Confirmed' - expected.recordedDate = '2014-10-09T14:58:00+11:00' - expected.substanceCoding = [ + expected.recorded_date = '2014-10-09T14:58:00+11:00' + expected.substance_coding = [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "1160593", @@ -35,8 +35,8 @@ describe('AllergyIntoleranceModel', () => { let expected = new AllergyIntoleranceModel({}) expected.title = 'Penicillin G' expected.status = 'Unconfirmed' - expected.recordedDate = '2010-03-01' - expected.substanceCoding = [] + expected.recorded_date = '2010-03-01' + expected.substance_coding = [] // expected.asserter = { reference: 'Patient/example' } // expected.note = [{ text: 'The criticality is high becasue of the observed anaphylactic reaction when challenged with cashew extract.' }] // expected.type = '' @@ -51,8 +51,8 @@ describe('AllergyIntoleranceModel', () => { let expected = new AllergyIntoleranceModel({}) expected.title = 'No Known Allergy (situation)' expected.status = 'Confirmed' - expected.recordedDate = '2015-08-06T15:37:31-06:00' - expected.substanceCoding = [] + expected.recorded_date = '2015-08-06T15:37:31-06:00' + expected.substance_coding = [] // expected.asserter = { reference: 'Patient/example' } // expected.note = [{ text: 'The criticality is high becasue of the observed anaphylactic reaction when challenged with cashew extract.' }] // expected.type = 'allergy' @@ -69,8 +69,8 @@ describe('AllergyIntoleranceModel', () => { let expected = new AllergyIntoleranceModel({}) expected.title = "ALLERGENIC EXTRACT, PENICILLIN" expected.status = 'unconfirmed' - expected.recordedDate = "2010-03-01" - expected.substanceCoding = [ + expected.recorded_date = "2010-03-01" + expected.substance_coding = [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "314422", @@ -91,8 +91,8 @@ describe('AllergyIntoleranceModel', () => { let expected = new AllergyIntoleranceModel({}) expected.title = 'PENICILLINS' expected.status = 'confirmed' - expected.recordedDate = '2008-02-22T06:00:00.000Z' - expected.substanceCoding = [ + expected.recorded_date = '2008-02-22T06:00:00.000Z' + expected.substance_coding = [ { "system": 'http://hl7.org/fhir/ndfrt' , "code": 'N0000005840' , @@ -116,8 +116,8 @@ describe('AllergyIntoleranceModel', () => { let expected = new AllergyIntoleranceModel({}) expected.title = 'Cashew nuts' expected.status = 'confirmed' - expected.recordedDate = '2014-10-09T14:58:00+11:00' - expected.substanceCoding = [ + expected.recorded_date = '2014-10-09T14:58:00+11:00' + expected.substance_coding = [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "1160593", @@ -138,8 +138,8 @@ describe('AllergyIntoleranceModel', () => { let expected = new AllergyIntoleranceModel({}) expected.title = 'Fish - dietary (substance)' expected.status = 'confirmed' - expected.recordedDate = '2015-08-06T15:37:31-06:00' - expected.substanceCoding = [] + expected.recorded_date = '2015-08-06T15:37:31-06:00' + expected.substance_coding = [] // expected.asserter = {reference: 'Patient/example'} // expected.note = [] // expected.type = 'allergy' diff --git a/frontend/src/lib/models/resources/allergy-intolerance-model.ts b/frontend/src/lib/models/resources/allergy-intolerance-model.ts index b3fedbdb..4c76528a 100644 --- a/frontend/src/lib/models/resources/allergy-intolerance-model.ts +++ b/frontend/src/lib/models/resources/allergy-intolerance-model.ts @@ -1,14 +1,16 @@ import {CodingModel} from '../datatypes/coding-model'; import * as _ from "lodash"; -import {fhirVersions} from '../constants' +import {fhirVersions, ResourceType} from '../constants' import {ReferenceModel} from '../datatypes/reference-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; -export class AllergyIntoleranceModel { +export class AllergyIntoleranceModel extends FastenDisplayModel { title: string | undefined status: string | undefined - recordedDate: string | undefined - substanceCoding: CodingModel[] | undefined + recorded_date: string | undefined + substance_coding: CodingModel[] | undefined // reaction: string | undefined asserter: ReferenceModel | undefined note: { text: string }[] | undefined @@ -16,7 +18,9 @@ export class AllergyIntoleranceModel { category: string[] | undefined patient: ReferenceModel | undefined - constructor(fhirResource: any, fhirVersion?: fhirVersions) { + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.AllergyIntolerance this.resourceDTO(fhirResource, fhirVersion || fhirVersions.R4); } @@ -34,8 +38,8 @@ export class AllergyIntoleranceModel { _.get(fhirResource, 'substance.coding[0].display') || _.get(fhirResource, 'substance.text', ''); this.status = _.get(fhirResource, 'status', ''); - this.recordedDate = _.get(fhirResource, 'recordedDate'); - this.substanceCoding = _.get(fhirResource, 'substance.coding', []); + this.recorded_date = _.get(fhirResource, 'recordedDate'); + this.substance_coding = _.get(fhirResource, 'substance.coding', []); this.asserter = _.get(fhirResource, 'reporter'); this.note = [] this.category = _.get(fhirResource, 'category') ? [_.get(fhirResource, 'category')] : []; @@ -48,11 +52,11 @@ export class AllergyIntoleranceModel { stu3DTO(fhirResource: any) { this.title = _.get(fhirResource, 'code.coding.0.display'); this.status = _.get(fhirResource, 'verificationStatus'); - this.recordedDate = _.get(fhirResource, 'assertedDate'); + this.recorded_date = _.get(fhirResource, 'assertedDate'); let substanceCoding = _.get(fhirResource, 'reaction', []).filter((item: any) => _.get(item, 'substance.coding'), ); - this.substanceCoding = _.get(substanceCoding, '0.substance.coding', []); + this.substance_coding = _.get(substanceCoding, '0.substance.coding', []); this.note = _.get(fhirResource, 'note'); }; @@ -60,11 +64,11 @@ export class AllergyIntoleranceModel { r4DTO(fhirResource: any) { this.title = _.get(fhirResource, 'code.coding.0.display'); this.status = _.get(fhirResource, 'verificationStatus.coding[0].display'); - this.recordedDate = _.get(fhirResource, 'recordedDate'); + this.recorded_date = _.get(fhirResource, 'recordedDate'); let substanceCoding = _.get(fhirResource, 'reaction', []).filter((item: any) => _.get(item, 'substance.coding'), ); - this.substanceCoding = _.get(substanceCoding, '0.substance.coding', []); + this.substance_coding = _.get(substanceCoding, '0.substance.coding', []); this.note = _.get(fhirResource, 'note'); }; diff --git a/frontend/src/lib/models/resources/appointment-model.ts b/frontend/src/lib/models/resources/appointment-model.ts index 5a7f8d8d..c749f435 100644 --- a/frontend/src/lib/models/resources/appointment-model.ts +++ b/frontend/src/lib/models/resources/appointment-model.ts @@ -1,25 +1,30 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {CodableConceptModel, hasValue} from '../datatypes/codable-concept-model'; import {ReferenceModel} from '../datatypes/reference-model'; import {CodingModel} from '../datatypes/coding-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; + +export class AppointmentModel extends FastenDisplayModel { -export class AppointmentModel { description: string|undefined status: string|undefined start: string|undefined - typeCoding: string|undefined + type_coding: string|undefined comment: string|undefined participant: string|undefined - participantPatient: string|undefined - participantPractitioner: string|undefined - participantLocation: string|undefined - minutesDuration: string|undefined + participant_patient: string|undefined + participant_practitioner: string|undefined + participant_location: string|undefined + minutes_duration: string|undefined reason: string|undefined - cancelationReason: string|undefined - serviceCategory: string|undefined + cancelation_reason: string|undefined + service_category: string|undefined - constructor(fhirResource: any, fhirVersion?: fhirVersions) { + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.Appointment this.resourceDTO(fhirResource, fhirVersion || fhirVersions.R4); } @@ -28,7 +33,7 @@ export class AppointmentModel { this.description = _.get(fhirResource, 'description'); this.status = _.get(fhirResource, 'status'); this.start = _.get(fhirResource, 'start'); - this.typeCoding = _.get(fhirResource, 'type.coding'); + this.type_coding = _.get(fhirResource, 'type.coding'); this.comment = _.get(fhirResource, 'comment'); this.participant = _.get(fhirResource, 'participant'); // const { @@ -36,20 +41,20 @@ export class AppointmentModel { // participantPractitioner, // participantLocation, // } = prepareParticipantData(participant); - this.minutesDuration = _.get(fhirResource, 'minutesDuration'); + this.minutes_duration = _.get(fhirResource, 'minutesDuration'); this.reason = _.get(fhirResource, 'reason', []); }; stu3DTO(fhirResource:any) { - this.serviceCategory = _.get(fhirResource, 'serviceCategory', []); - this.typeCoding = _.get(fhirResource, 'appointmentType.coding'); + this.service_category = _.get(fhirResource, 'serviceCategory', []); + this.type_coding = _.get(fhirResource, 'appointmentType.coding'); }; r4DTO(fhirResource:any) { this.reason = _.get(fhirResource, 'reasonCode', []); - this.cancelationReason = _.get(fhirResource, 'cancelationReason', []); - this.serviceCategory = _.get(fhirResource, 'serviceCategory', []); - this.typeCoding = _.get(fhirResource, 'appointmentType.coding'); + this.cancelation_reason = _.get(fhirResource, 'cancelationReason', []); + this.service_category = _.get(fhirResource, 'serviceCategory', []); + this.type_coding = _.get(fhirResource, 'appointmentType.coding'); }; resourceDTO(fhirResource:any, fhirVersion:fhirVersions){ diff --git a/frontend/src/lib/models/resources/care-plan-model.spec.ts b/frontend/src/lib/models/resources/care-plan-model.spec.ts index 1c7ad91f..897e19f2 100644 --- a/frontend/src/lib/models/resources/care-plan-model.spec.ts +++ b/frontend/src/lib/models/resources/care-plan-model.spec.ts @@ -14,9 +14,9 @@ describe('CarePlanModel', () => { // expected.expiry = "completed" // expected.category = "completed" expected.goals = [ { reference: '#goal' } ] - expected.hasGoals = true + expected.has_goals = true expected.addresses = [ { reference: "Condition/f201", display: '?????' } ] - expected.hasAddresses = true + expected.has_addresses = true expected.activity = [ { title: '64915003', @@ -26,10 +26,10 @@ describe('CarePlanModel', () => { ] } ] - expected.hasActivity = true + expected.has_activity = true expected.subject = {"reference": "Patient/f001", display: 'P. van de Heuvel'} - expected.periodStart = "2011-06-26" - expected.periodEnd = "2011-06-27" + expected.period_start = "2011-06-26" + expected.period_end = "2011-06-27" // expected.basedOn // expected.title = 'Cashew nuts' @@ -58,19 +58,19 @@ describe('CarePlanModel', () => { // expected.expiry = "completed" // expected.category = "completed" expected.goals = [ { reference: '#goal' } ] - expected.hasGoals = true + expected.has_goals = true expected.addresses = [ { reference: '#p1', "display": "pregnancy" } ] - expected.hasAddresses = true + expected.has_addresses = true expected.activity = [ { title: undefined, hasCategories: false, categories: [ ] }, { title: 'First Antenatal encounter', hasCategories: true, categories: [ { system: 'http://example.org/mySystem', code: '1an' } ] }, { title: 'Follow-up Antenatal encounter', hasCategories: true, categories: [ { system: 'http://example.org/mySystem', code: 'an' } ] }, { title: 'Delivery', hasCategories: true, categories: [ { system: 'http://example.org/mySystem', code: 'del' } ] } ] - expected.hasActivity = true + expected.has_activity = true expected.subject = {display: 'Eve Everywoman', reference: "Patient/1"} - expected.periodStart = '2013-01-01' - expected.periodEnd = '2013-10-01' + expected.period_start = '2013-01-01' + expected.period_end = '2013-10-01' expect(new CarePlanModel(fixture)).toEqual(expected); }); @@ -82,20 +82,20 @@ describe('CarePlanModel', () => { // expected.expiry = "completed" expected.category = [{ text: 'Weight management plan' }] expected.goals = [ { reference: 'Goal/example' } ] - expected.hasGoals = true + expected.has_goals = true expected.addresses = [ { reference: '#p1', display: 'obesity' } ] - expected.hasAddresses = true + expected.has_addresses = true expected.activity = [ { title: '3141-9', hasCategories: true, categories: [ Object({ system: 'http://loinc.org', code: '3141-9', display: 'Weight Measured' }), Object({ system: 'http://snomed.info/sct', code: '27113001', display: 'Body weight' }) ] } ] - expected.hasActivity = true + expected.has_activity = true expected.description = 'Manage obesity and weight loss' expected.subject = {display: 'Peter James Chalmers', reference: 'Patient/example'} // expected.periodStart = '2013-01-01' - expected.periodEnd = '2017-06-01' + expected.period_end = '2017-06-01' expected.author = { reference: 'Practitioner/example', display: 'Dr Adam Careful' } expect(new CarePlanModel(fixture)).toEqual(expected); }); diff --git a/frontend/src/lib/models/resources/care-plan-model.ts b/frontend/src/lib/models/resources/care-plan-model.ts index 5c2f1d30..fc9adb47 100644 --- a/frontend/src/lib/models/resources/care-plan-model.ts +++ b/frontend/src/lib/models/resources/care-plan-model.ts @@ -1,29 +1,33 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {ReferenceModel} from '../datatypes/reference-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; -export class CarePlanModel { +export class CarePlanModel extends FastenDisplayModel { status: string | undefined expiry: string | undefined category: any[] | undefined - hasCategory: boolean | undefined + has_category: boolean | undefined goals: ReferenceModel[] | undefined - hasGoals: boolean | undefined + has_goals: boolean | undefined addresses: ReferenceModel[] | undefined - hasAddresses: boolean | undefined + has_addresses: boolean | undefined activity: any - hasActivity: boolean | undefined - basedOn: string | undefined - partOf: string | undefined + has_activity: boolean | undefined + based_on: string | undefined + part_of: string | undefined intent: string | undefined description: string | undefined subject: ReferenceModel | undefined - periodStart: string | undefined - periodEnd: string | undefined + period_start: string | undefined + period_end: string | undefined author: ReferenceModel | undefined - constructor(fhirResource: any, fhirVersion?: fhirVersions) { + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.CarePlan this.resourceDTO(fhirResource, fhirVersion || fhirVersions.R4); } @@ -31,22 +35,22 @@ export class CarePlanModel { this.status = _.get(fhirResource, 'status', ''); this.expiry = _.get(fhirResource, 'expiry'); this.category = _.get(fhirResource, 'category'); - this.hasCategory = Array.isArray(_.get(fhirResource, 'category.0.coding')); + this.has_category = Array.isArray(_.get(fhirResource, 'category.0.coding')); this.goals = _.get(fhirResource, 'goal'); - this.hasGoals = Array.isArray(this.goals); + this.has_goals = Array.isArray(this.goals); this.addresses = _.get(fhirResource, 'addresses') - this.hasAddresses = Array.isArray(this.addresses); + this.has_addresses = Array.isArray(this.addresses); this.description = _.get(fhirResource, 'description'); this.subject = _.get(fhirResource, 'subject'); - this.periodStart = _.get(fhirResource, 'period.start'); - this.periodEnd = _.get(fhirResource, 'period.end'); + this.period_start = _.get(fhirResource, 'period.start'); + this.period_end = _.get(fhirResource, 'period.end'); this.author = _.get(fhirResource, 'author'); }; dstu2DTO(fhirResource: any){ this.activity = _.get(fhirResource, 'activity'); - this.hasActivity = Array.isArray(this.activity); - this.activity = !this.hasActivity + this.has_activity = Array.isArray(this.activity); + this.activity = !this.has_activity ? this.activity : this.activity.map((item: any) => { const categories = _.get(item, 'detail.category.coding'); @@ -62,8 +66,8 @@ export class CarePlanModel { stu3DTO(fhirResource: any) { let activity = _.get(fhirResource, 'activity'); - this.hasActivity = Array.isArray(activity); - this.activity = !this.hasActivity + this.has_activity = Array.isArray(activity); + this.activity = !this.has_activity ? activity : activity.map((item: any) => { const categories = [ @@ -78,15 +82,15 @@ export class CarePlanModel { categories, }; }); - this.basedOn = _.get(fhirResource, 'basedOn', []); - this.partOf = _.get(fhirResource, 'partOf', []); + this.based_on = _.get(fhirResource, 'basedOn', []); + this.part_of = _.get(fhirResource, 'partOf', []); this.intent = _.get(fhirResource, 'intent', []); }; r4DTO(fhirResource: any) { this.activity = _.get(fhirResource, 'activity'); - this.hasActivity = Array.isArray(this.activity); - this.activity = !this.hasActivity + this.has_activity = Array.isArray(this.activity); + this.activity = !this.has_activity ? this.activity : this.activity.map((item: any) => { const categories = [ diff --git a/frontend/src/lib/models/resources/care-team-model.spec.ts b/frontend/src/lib/models/resources/care-team-model.spec.ts index 4e7acc5e..b3dce45d 100644 --- a/frontend/src/lib/models/resources/care-team-model.spec.ts +++ b/frontend/src/lib/models/resources/care-team-model.spec.ts @@ -15,7 +15,7 @@ describe('CareTeamModel', () => { expected.name = "Peter James Charlmers Care Plan for Inpatient Encounter" expected.status = "active" // expected.periodStart - expected.periodEnd = "2013-01-01" + expected.period_end = "2013-01-01" // expected.participants expected.category = [ { coding: [ @@ -30,7 +30,7 @@ describe('CareTeamModel', () => { expected.encounter = { "reference": "Encounter/example" } - expected.managingOrganization = { reference: 'Organization/f001' } + expected.managing_organization = { reference: 'Organization/f001' } expected.participants = [ { display: 'Peter James Chalmers', role: undefined, periodStart: undefined, periodEnd: undefined }, { display: 'Dorothy Dietition', role: undefined, periodStart: undefined, periodEnd: '2013-01-01' } diff --git a/frontend/src/lib/models/resources/care-team-model.ts b/frontend/src/lib/models/resources/care-team-model.ts index 42c1ad29..c07a3075 100644 --- a/frontend/src/lib/models/resources/care-team-model.ts +++ b/frontend/src/lib/models/resources/care-team-model.ts @@ -1,20 +1,25 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {ReferenceModel} from '../datatypes/reference-model'; import {CodableConceptModel} from '../datatypes/codable-concept-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; + +export class CareTeamModel extends FastenDisplayModel { -export class CareTeamModel { name: string | undefined status: string | undefined - periodStart: string | undefined - periodEnd: string | undefined + period_start: string | undefined + period_end: string | undefined participants: any[] | undefined category: CodableConceptModel[] | undefined subject: ReferenceModel | undefined encounter: ReferenceModel | undefined - managingOrganization: ReferenceModel | undefined + managing_organization: ReferenceModel | undefined - constructor(fhirResource: any, fhirVersion?: fhirVersions) { + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.CareTeam this.resourceDTO(fhirResource, fhirVersion || fhirVersions.R4) } @@ -22,17 +27,17 @@ export class CareTeamModel { // Default value for title - "Care team" this.name = _.get(fhirResource, 'name', 'Care team'); this.status = _.get(fhirResource, 'status'); - this.periodStart = _.get(fhirResource, 'period.start'); - this.periodEnd = _.get(fhirResource, 'period.end'); + this.period_start = _.get(fhirResource, 'period.start'); + this.period_end = _.get(fhirResource, 'period.end'); this.category = _.get(fhirResource, 'category'); this.subject = _.get(fhirResource, 'subject'); - this.managingOrganization = + this.managing_organization = _.get(fhirResource, 'managingOrganization[0]') || _.get(fhirResource, 'managingOrganization'); this.participants = _.get(fhirResource, 'participant', []).map((item: any) => { const display = _.get(item, 'member.display'); - const role = _.get(item, 'role.text') || _.get(item, 'role.coding.0.display'); + const role = _.get(item, 'role.text') || _.get(item, 'role[0].text') || _.get(item, 'role.coding.0.display'); const periodStart = _.get(item, 'period.start'); const periodEnd = _.get(item, 'period.end'); diff --git a/frontend/src/lib/models/resources/composition-model.spec.ts b/frontend/src/lib/models/resources/composition-model.spec.ts new file mode 100644 index 00000000..1c08ce83 --- /dev/null +++ b/frontend/src/lib/models/resources/composition-model.spec.ts @@ -0,0 +1,7 @@ +import { CompositionModel } from './composition-model'; + +describe('CompositionModel', () => { + it('should create an instance', () => { + expect(new CompositionModel()).toBeTruthy(); + }); +}); diff --git a/frontend/src/lib/models/resources/composition-model.ts b/frontend/src/lib/models/resources/composition-model.ts new file mode 100644 index 00000000..6203e777 --- /dev/null +++ b/frontend/src/lib/models/resources/composition-model.ts @@ -0,0 +1,22 @@ +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {ReferenceModel} from '../datatypes/reference-model'; +import {CodableConceptModel} from '../datatypes/codable-concept-model'; +import {fhirVersions, ResourceType} from '../constants'; +import {FastenOptions} from '../fasten/fasten-options'; +import * as _ from "lodash"; + +export class CompositionModel extends FastenDisplayModel { + + title: string | undefined + relates_to: string | undefined + + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.Composition + + this.title = _.get(fhirResource, 'title') + this.relates_to = _.get(fhirResource, 'relatesTo', []).map((relatesTo) => { + return relatesTo.target?.targetReference?.reference + }) + } +} diff --git a/frontend/src/lib/models/resources/condition-model.spec.ts b/frontend/src/lib/models/resources/condition-model.spec.ts index d9c82119..b0685ea5 100644 --- a/frontend/src/lib/models/resources/condition-model.spec.ts +++ b/frontend/src/lib/models/resources/condition-model.spec.ts @@ -11,12 +11,12 @@ describe('ConditionModel', () => { it('should parse example1.json', () => { let fixture = require("../../fixtures/r4/resources/condition/example1.json") let expected = new ConditionModel({}) - expected.codeText = 'Burn of ear' - expected.severityText = 'Severe' + expected.code_text = 'Burn of ear' + expected.severity_text = 'Severe' // expected.hasAsserter: boolean | undefined // expected.asserter: string | undefined - expected.hasBodySite = true - expected.bodySite = [new CodableConceptModel({ + expected.has_body_site = true + expected.body_site = [new CodableConceptModel({ "coding": [ { "system": "http://snomed.info/sct", @@ -26,22 +26,22 @@ describe('ConditionModel', () => { ], "text": "Left Ear" })] - expected.clinicalStatus = 'active' + expected.clinical_status = 'active' // expected.dateRecorded: string | undefined - expected.onsetDateTime = '2012-05-24' + expected.onset_datetime = '2012-05-24' expect(new ConditionModel(fixture)).toEqual(expected); }); it('should parse example2.json', () => { let fixture = require("../../fixtures/r4/resources/condition/example2.json") let expected = new ConditionModel({}) - expected.codeText = 'Asthma' - expected.severityText = 'Mild' + expected.code_text = 'Asthma' + expected.severity_text = 'Mild' // expected.hasAsserter: boolean | undefined // expected.asserter: string | undefined - expected.hasBodySite = false + expected.has_body_site = false // expected.bodySite - expected.clinicalStatus = 'active' + expected.clinical_status = 'active' // expected.dateRecorded: string | undefined // expected.onsetDateTime = '2012-05-24' @@ -50,15 +50,15 @@ describe('ConditionModel', () => { it('should parse example3.json', () => { let fixture = require("../../fixtures/r4/resources/condition/example3.json") let expected = new ConditionModel({}) - expected.codeText = 'Fever' - expected.severityText = 'Mild' - expected.hasAsserter = true + expected.code_text = 'Fever' + expected.severity_text = 'Mild' + expected.has_asserter = true expected.asserter = { reference: 'Practitioner/f201' } - expected.hasBodySite = true - expected.bodySite = [new CodableConceptModel({ text: '', coding: [ Object({ system: 'http://snomed.info/sct', code: '38266002', display: 'Entire body as a whole' }) ] })] - expected.clinicalStatus = 'resolved' - expected.dateRecorded = '2013-04-04' - expected.onsetDateTime = '2013-04-02' + expected.has_body_site = true + expected.body_site = [new CodableConceptModel({ text: '', coding: [ Object({ system: 'http://snomed.info/sct', code: '38266002', display: 'Entire body as a whole' }) ] })] + expected.clinical_status = 'resolved' + expected.date_recorded = '2013-04-04' + expected.onset_datetime = '2013-04-02' expect(new ConditionModel(fixture)).toEqual(expected); }); diff --git a/frontend/src/lib/models/resources/condition-model.ts b/frontend/src/lib/models/resources/condition-model.ts index 8c3cf675..edfa0668 100644 --- a/frontend/src/lib/models/resources/condition-model.ts +++ b/frontend/src/lib/models/resources/condition-model.ts @@ -1,54 +1,59 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {CodableConceptModel, hasValue} from '../datatypes/codable-concept-model'; import {ReferenceModel} from '../datatypes/reference-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; -export class ConditionModel { - codeText: string | undefined - severityText: string | undefined - hasAsserter: boolean | undefined +export class ConditionModel extends FastenDisplayModel { + + code_text: string | undefined + severity_text: string | undefined + has_asserter: boolean | undefined asserter: ReferenceModel | undefined - hasBodySite: boolean | undefined - bodySite: CodableConceptModel[] | undefined - clinicalStatus: string | undefined - dateRecorded: string | undefined - onsetDateTime: string | undefined + has_body_site: boolean | undefined + body_site: CodableConceptModel[] | undefined + clinical_status: string | undefined + date_recorded: string | undefined + onset_datetime: string | undefined - constructor(fhirResource: any, fhirVersion?: fhirVersions) { + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.Condition this.resourceDTO(fhirResource, fhirVersion || fhirVersions.R4); } commonDTO(fhirResource:any){ - this.codeText = + this.code_text = _.get(fhirResource, 'code.coding.0.display') || _.get(fhirResource, 'code.text') || _.get(fhirResource, 'code.coding.0.code'); - this.severityText = + this.severity_text = _.get(fhirResource, 'severity.coding.0.display') || _.get(fhirResource, 'severity.text'); - this.onsetDateTime = _.get(fhirResource, 'onsetDateTime'); - this.hasAsserter = _.has(fhirResource, 'asserter'); + this.onset_datetime = _.get(fhirResource, 'onsetDateTime'); + this.has_asserter = _.has(fhirResource, 'asserter'); this.asserter = _.get(fhirResource, 'asserter'); - this.hasBodySite = !!_.get(fhirResource, 'bodySite.0.coding.0.display'); + this.has_body_site = !!_.get(fhirResource, 'bodySite.0.coding.0.display'); let bodySite = _.get(fhirResource, 'bodySite') if(bodySite){ - this.bodySite = bodySite.map((body:any) => new CodableConceptModel(body)) + this.body_site = bodySite.map((body:any) => new CodableConceptModel(body)) } }; dstu2DTO(fhirResource:any){ - this.clinicalStatus = _.get(fhirResource, 'clinicalStatus'); - this.dateRecorded = _.get(fhirResource, 'dateRecorded'); + this.clinical_status = _.get(fhirResource, 'clinicalStatus'); + this.date_recorded = _.get(fhirResource, 'dateRecorded'); }; stu3DTO(fhirResource:any){ - this.clinicalStatus = _.get(fhirResource, 'clinicalStatus'); - this.dateRecorded = _.get(fhirResource, 'assertedDate'); + this.clinical_status = _.get(fhirResource, 'clinicalStatus'); + this.date_recorded = _.get(fhirResource, 'assertedDate'); }; r4DTO(fhirResource:any){ - this.clinicalStatus = _.get(fhirResource, 'clinicalStatus.coding.0.code'); - this.dateRecorded = _.get(fhirResource, 'recordedDate'); + this.clinical_status = _.get(fhirResource, 'clinicalStatus.coding.0.code'); + this.date_recorded = _.get(fhirResource, 'recordedDate'); }; resourceDTO(fhirResource:any, fhirVersion:fhirVersions){ diff --git a/frontend/src/lib/models/resources/device-model.ts b/frontend/src/lib/models/resources/device-model.ts index db821894..17f390f7 100644 --- a/frontend/src/lib/models/resources/device-model.ts +++ b/frontend/src/lib/models/resources/device-model.ts @@ -1,55 +1,60 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {CodableConceptModel, hasValue} from '../datatypes/codable-concept-model'; import {ReferenceModel} from '../datatypes/reference-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; + +export class DeviceModel extends FastenDisplayModel { -export class DeviceModel { model: string | undefined status: string | undefined - hasExpiry: boolean | undefined - getExpiry: string | undefined - getTypeCoding: string | undefined - hasTypeCoding: boolean | undefined - getUdi: string | undefined - udiCarrierAIDC: string | undefined - udiCarrierHRF: string | undefined + has_expiry: boolean | undefined + get_expiry: string | undefined + get_type_coding: string | undefined + has_type_coding: boolean | undefined + get_udi: string | undefined + udi_carrier_aidc: string | undefined + udi_carrier_hrf: string | undefined safety: string | undefined - hasSafety: boolean | undefined + has_safety: boolean | undefined - constructor(fhirResource: any, fhirVersion?: fhirVersions) { + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.Device this.resourceDTO(fhirResource, fhirVersion || fhirVersions.R4); } commonDTO(fhirResource:any){ - this.model = _.get(fhirResource, 'model', 'Device'); + this.model = _.get(fhirResource, 'model') || _.get(fhirResource,"code.text", 'Device'); this.status = _.get(fhirResource, 'status', ''); - this.getTypeCoding = _.get(fhirResource, 'type.coding'); - this.hasTypeCoding = Array.isArray(this.getTypeCoding); + this.get_type_coding = _.get(fhirResource, 'type.coding'); + this.has_type_coding = Array.isArray(this.get_type_coding); }; dstu2DTO(fhirResource:any){ - this.getUdi = _.get(fhirResource, 'udi'); - this.hasExpiry = _.has(fhirResource, 'expiry'); - this.getExpiry = _.get(fhirResource, 'expiry'); + this.get_udi = _.get(fhirResource, 'udi'); + this.has_expiry = _.has(fhirResource, 'expiry'); + this.get_expiry = _.get(fhirResource, 'expiry'); }; stu3DTO(fhirResource:any){ - this.getUdi = _.get(fhirResource, 'udi.name'); - this.hasExpiry = _.has(fhirResource, 'expirationDate'); - this.getExpiry = _.get(fhirResource, 'expirationDate'); + this.get_udi = _.get(fhirResource, 'udi.name'); + this.has_expiry = _.has(fhirResource, 'expirationDate'); + this.get_expiry = _.get(fhirResource, 'expirationDate'); this.safety = _.get(fhirResource, 'safety', []); - this.hasSafety = hasValue(this.safety); + this.has_safety = hasValue(this.safety); }; r4DTO(fhirResource:any){ - this.getUdi = _.get(fhirResource, 'udiCarrier.deviceIdentifier'); - this.hasExpiry = _.has(fhirResource, 'expirationDate'); - this.getExpiry = _.get(fhirResource, 'expirationDate'); - this.udiCarrierAIDC = _.get(fhirResource, 'udiCarrier.carrierAIDC'); - this.udiCarrierHRF = _.get(fhirResource, 'udiCarrier.carrierHRF'); + this.get_udi = _.get(fhirResource, 'udiCarrier.deviceIdentifier'); + this.has_expiry = _.has(fhirResource, 'expirationDate'); + this.get_expiry = _.get(fhirResource, 'expirationDate'); + this.udi_carrier_aidc = _.get(fhirResource, 'udiCarrier.carrierAIDC'); + this.udi_carrier_hrf = _.get(fhirResource, 'udiCarrier.carrierHRF'); this.safety = _.get(fhirResource, 'safety', []); - this.hasSafety = hasValue(this.safety); + this.has_safety = hasValue(this.safety); }; resourceDTO(fhirResource:any, fhirVersion:fhirVersions){ diff --git a/frontend/src/lib/models/resources/diagnostic-report-model.spec.ts b/frontend/src/lib/models/resources/diagnostic-report-model.spec.ts index 90953457..2e9e5160 100644 --- a/frontend/src/lib/models/resources/diagnostic-report-model.spec.ts +++ b/frontend/src/lib/models/resources/diagnostic-report-model.spec.ts @@ -16,12 +16,12 @@ describe('DiagnosticReportModel', () => { expected.title = 'Complete blood count (hemogram) panel - Blood by Automated count' expected.status = 'final' // expected.effectiveDateTime: string | undefined - expected.categoryCoding = [ + expected.category_coding = [ { system: 'http://snomed.info/sct', code: '252275004', display: 'Haematology test' }, { system: 'http://hl7.org/fhir/v2/0074', code: 'HM' } ] - expected.hasCategoryCoding = true - expected.hasPerformer = true + expected.has_category_coding = true + expected.has_performer = true expected.conclusion = 'Core lab' expected.performer = { reference: 'Organization/f001', display: 'Burgers University Medical Centre' } expected.issued = '2013-05-15T19:32:52+01:00' diff --git a/frontend/src/lib/models/resources/diagnostic-report-model.ts b/frontend/src/lib/models/resources/diagnostic-report-model.ts index e2818e08..a9ebbdc5 100644 --- a/frontend/src/lib/models/resources/diagnostic-report-model.ts +++ b/frontend/src/lib/models/resources/diagnostic-report-model.ts @@ -1,21 +1,26 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {CodableConceptModel, hasValue} from '../datatypes/codable-concept-model'; import {ReferenceModel} from '../datatypes/reference-model'; import {CodingModel} from '../datatypes/coding-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; + +export class DiagnosticReportModel extends FastenDisplayModel { -export class DiagnosticReportModel { title: string | undefined status: string | undefined - effectiveDateTime: string | undefined - categoryCoding: CodingModel[] | undefined - hasCategoryCoding: boolean | undefined - hasPerformer: boolean | undefined + effective_datetime: string | undefined + category_coding: CodingModel[] | undefined + has_category_coding: boolean | undefined + has_performer: boolean | undefined conclusion: string | undefined performer: ReferenceModel | undefined issued: string | undefined - constructor(fhirResource: any, fhirVersion?: fhirVersions) { + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.DiagnosticReport this.resourceDTO(fhirResource, fhirVersion || fhirVersions.R4); } @@ -25,19 +30,19 @@ export class DiagnosticReportModel { _.get(fhirResource, 'code.display') || _.get(fhirResource, 'code.coding.0.display', null); this.status = _.get(fhirResource, 'status', ''); - this.effectiveDateTime = _.get(fhirResource, 'effectiveDateTime'); - this.categoryCoding = _.get(fhirResource, 'category.coding'); - this.hasCategoryCoding = Array.isArray(this.categoryCoding); + this.effective_datetime = _.get(fhirResource, 'effectiveDateTime'); + this.category_coding = _.get(fhirResource, 'category.coding'); + this.has_category_coding = Array.isArray(this.category_coding); this.conclusion = _.get(fhirResource, 'conclusion'); this.issued = _.get(fhirResource, 'issued'); }; dstu2DTO(fhirResource:any){ - this.hasPerformer = _.has(fhirResource, 'performer'); + this.has_performer = _.has(fhirResource, 'performer'); this.performer = _.get(fhirResource, 'performer'); }; stu3DTO(fhirResource:any){ - this.hasPerformer = _.has(fhirResource, 'performer.0.actor.display'); + this.has_performer = _.has(fhirResource, 'performer.0.actor.display'); this.performer = _.get(fhirResource, 'performer.0.actor'); }; @@ -46,9 +51,9 @@ export class DiagnosticReportModel { if (!this.performer) { this.performer = _.get(fhirResource, 'performer.0'); } - this.hasPerformer = !!this.performer; - this.categoryCoding = _.get(fhirResource, 'category.coding'); - this.hasCategoryCoding = Array.isArray(this.categoryCoding); + this.has_performer = !!this.performer; + this.category_coding = _.get(fhirResource, 'category.coding'); + this.has_category_coding = Array.isArray(this.category_coding); }; resourceDTO(fhirResource:any, fhirVersion: fhirVersions){ diff --git a/frontend/src/lib/models/resources/document-reference-model.spec.ts b/frontend/src/lib/models/resources/document-reference-model.spec.ts index 34884e73..efc2a451 100644 --- a/frontend/src/lib/models/resources/document-reference-model.spec.ts +++ b/frontend/src/lib/models/resources/document-reference-model.spec.ts @@ -15,10 +15,10 @@ describe('DocumentReferenceModel', () => { expected.description = 'Physical' expected.status = 'current' // expected.docStatus: string | undefined - expected.typeCoding = { system: 'http://loinc.org', code: '34108-1', display: 'Outpatient Note' } + expected.type_coding = { system: 'http://loinc.org', code: '34108-1', display: 'Outpatient Note' } // expected.classCoding: string | undefined - expected.createdAt = '2005-12-24T09:43:41+11:00' - expected.securityLabelCoding = { system: 'http://terminology.hl7.org/CodeSystem/v3-Confidentiality', code: 'V', display: 'very restricted' } + expected.created_at = '2005-12-24T09:43:41+11:00' + expected.security_label_coding = { system: 'http://terminology.hl7.org/CodeSystem/v3-Confidentiality', code: 'V', display: 'very restricted' } expected.context = { eventCoding: { system: 'http://ihe.net/xds/connectathon/eventCodes', code: 'T-D8200', display: 'Arm' }, facilityTypeCoding: { system: 'http://www.ihe.net/xds/connectathon/healthcareFacilityTypeCodes', code: 'Outpatient', display: 'Outpatient' }, diff --git a/frontend/src/lib/models/resources/document-reference-model.ts b/frontend/src/lib/models/resources/document-reference-model.ts index 9b53b0d3..579ae1c3 100644 --- a/frontend/src/lib/models/resources/document-reference-model.ts +++ b/frontend/src/lib/models/resources/document-reference-model.ts @@ -1,17 +1,20 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {CodableConceptModel, hasValue} from '../datatypes/codable-concept-model'; import {ReferenceModel} from '../datatypes/reference-model'; import {CodingModel} from '../datatypes/coding-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; + +export class DocumentReferenceModel extends FastenDisplayModel { -export class DocumentReferenceModel { description: string | undefined status: string | undefined - docStatus: string | undefined - typeCoding: CodingModel | undefined - classCoding: CodingModel | undefined - createdAt: string | undefined - securityLabelCoding: CodingModel | undefined + doc_status: string | undefined + type_coding: CodingModel | undefined + class_coding: CodingModel | undefined + created_at: string | undefined + security_label_coding: CodingModel | undefined content: { url: string isUrlBinaryResourceReference: boolean @@ -26,7 +29,9 @@ export class DocumentReferenceModel { periodEnd: string } | undefined - constructor(fhirResource: any, fhirVersion?: fhirVersions) { + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.DocumentReference this.resourceDTO(fhirResource, fhirVersion || fhirVersions.R4); } @@ -34,10 +39,10 @@ export class DocumentReferenceModel { commonDTO(fhirResource:any){ this.description = _.get(fhirResource, 'description'); this.status = _.get(fhirResource, 'status'); - this.typeCoding = _.get(fhirResource, 'type.coding[0]'); - this.classCoding = _.get(fhirResource, 'class.coding[0]'); - this.createdAt = _.get(fhirResource, 'created'); - this.securityLabelCoding = _.get(fhirResource, 'securityLabel[0].coding[0]'); + this.type_coding = _.get(fhirResource, 'type.coding[0]'); + this.class_coding = _.get(fhirResource, 'class.coding[0]'); + this.created_at = _.get(fhirResource, 'created'); + this.security_label_coding = _.get(fhirResource, 'securityLabel[0].coding[0]'); const eventCoding = _.get(fhirResource, 'context.event[0].coding[0]'); const facilityTypeCoding = _.get( fhirResource, @@ -59,18 +64,18 @@ export class DocumentReferenceModel { }; dstu2DTO(fhirResource:any) { - this.docStatus = + this.doc_status = _.get(fhirResource, 'docStatus.coding[0].display') || _.get(fhirResource, 'docStatus.coding[0].code'); }; stu3DTO(fhirResource:any){ - this.docStatus = _.get(fhirResource, 'docStatus'); + this.doc_status = _.get(fhirResource, 'docStatus'); }; r4DTO(fhirResource:any){ - this.classCoding = _.get(fhirResource, 'category.coding[0]'); - this.createdAt = _.get(fhirResource, 'date'); + this.class_coding = _.get(fhirResource, 'category.coding[0]'); + this.created_at = _.get(fhirResource, 'date'); }; contentDTO(fhirResource: any, fhirVersion: fhirVersions){ diff --git a/frontend/src/lib/models/resources/encounter-model.spec.ts b/frontend/src/lib/models/resources/encounter-model.spec.ts index fdda6f36..a1680ebe 100644 --- a/frontend/src/lib/models/resources/encounter-model.spec.ts +++ b/frontend/src/lib/models/resources/encounter-model.spec.ts @@ -15,8 +15,8 @@ describe('EncounterModel', () => { // hasParticipant: boolean | undefined // locationDisplay: string | undefined // encounterType: string | undefined - expected.resourceClass = 'inpatient encounter' - expected.resourceStatus = 'in-progress' + expected.resource_class = 'inpatient encounter' + expected.resource_status = 'in-progress' // participant expect(new EncounterModel(fixture)).toEqual(expected); @@ -25,13 +25,13 @@ describe('EncounterModel', () => { it('should parse example2.json', () => { let fixture = require("../../fixtures/r4/resources/encounter/example2.json") let expected = new EncounterModel({}) - expected.periodEnd = '2015-01-17T16:30:00+10:00' - expected.periodStart = '2015-01-17T16:00:00+10:00' - expected.hasParticipant = true - expected.locationDisplay = 'Client\'s home' + expected.period_end = '2015-01-17T16:30:00+10:00' + expected.period_start = '2015-01-17T16:00:00+10:00' + expected.has_participant = true + expected.location_display = 'Client\'s home' // encounterType: string | undefined - expected.resourceClass = 'home health' - expected.resourceStatus = 'finished' + expected.resource_class = 'home health' + expected.resource_status = 'finished' expected.participant = [ { display: undefined, @@ -49,11 +49,11 @@ describe('EncounterModel', () => { let expected = new EncounterModel({}) // expected.periodEnd = '2015-01-17T16:30:00+10:00' // expected.periodStart = '2015-01-17T16:00:00+10:00' - expected.hasParticipant = true - expected.locationDisplay = 'Encounter' - expected.encounterType = [ { coding: [ Object({ system: 'http://snomed.info/sct', code: '11429006', display: 'Consultation' }) ] } ] - expected.resourceClass = 'ambulatory' - expected.resourceStatus = 'finished' + expected.has_participant = true + expected.location_display = 'Encounter' + expected.encounter_type = [ { coding: [ Object({ system: 'http://snomed.info/sct', code: '11429006', display: 'Consultation' }) ] } ] + expected.resource_class = 'ambulatory' + expected.resource_status = 'finished' expected.participant = [ { display: undefined, reference: Object({ reference: 'Practitioner/f201' }), text: undefined, periodStart: undefined } ] diff --git a/frontend/src/lib/models/resources/encounter-model.ts b/frontend/src/lib/models/resources/encounter-model.ts index 19dfd4ce..52fc1a03 100644 --- a/frontend/src/lib/models/resources/encounter-model.ts +++ b/frontend/src/lib/models/resources/encounter-model.ts @@ -1,17 +1,20 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {CodableConceptModel, hasValue} from '../datatypes/codable-concept-model'; import {ReferenceModel} from '../datatypes/reference-model'; import {CodingModel} from '../datatypes/coding-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; -export class EncounterModel { - periodEnd: string | undefined - periodStart: string | undefined - hasParticipant: boolean | undefined - locationDisplay: string | undefined - encounterType: CodableConceptModel[] | undefined - resourceClass: string | undefined - resourceStatus: string | undefined +export class EncounterModel extends FastenDisplayModel { + + period_end: string | undefined + period_start: string | undefined + has_participant: boolean | undefined + location_display: string | undefined + encounter_type: CodableConceptModel[] | undefined + resource_class: string | undefined + resource_status: string | undefined participant: { display?: string, reference: ReferenceModel, @@ -19,25 +22,27 @@ export class EncounterModel { periodStart?:string }[] | undefined - constructor(fhirResource: any, fhirVersion?: fhirVersions) { + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.Encounter this.resourceDTO(fhirResource, fhirVersion || fhirVersions.R4); } commonDTO(fhirResource:any){ - this.resourceStatus = _.get(fhirResource, 'status'); - this.locationDisplay = _.get( + this.resource_status = _.get(fhirResource, 'status'); + this.location_display = _.get( fhirResource, 'location[0].location.display', 'Encounter', ); - this.encounterType = _.get(fhirResource, 'type'); - this.hasParticipant = _.has(fhirResource, 'participant'); + this.encounter_type = _.get(fhirResource, 'type'); + this.has_participant = _.has(fhirResource, 'participant'); }; dstu2DTO(fhirResource:any){ - this.periodEnd = _.get(fhirResource, 'period.end'); - this.periodStart = _.get(fhirResource, 'period.start'); - this.resourceClass = _.get(fhirResource, 'class'); + this.period_end = _.get(fhirResource, 'period.end'); + this.period_start = _.get(fhirResource, 'period.start'); + this.resource_class = _.get(fhirResource, 'class'); this.participant = _.get(fhirResource, 'participant', []).map((item: any) => { let periodStart = _.get(item, 'period.start'); periodStart = new Date(periodStart).toLocaleString(); @@ -52,11 +57,11 @@ export class EncounterModel { }; stu3DTO(fhirResource:any){ - this.periodEnd = _.get(fhirResource, 'period.end'); - this.periodStart = _.get(fhirResource, 'period.start'); + this.period_end = _.get(fhirResource, 'period.end'); + this.period_start = _.get(fhirResource, 'period.start'); - this.resourceClass = _.get(fhirResource, 'class.display'); + this.resource_class = _.get(fhirResource, 'class.display'); this.participant = _.get(fhirResource, 'participant', []).map((item: any) => { let periodStart = _.get(item, 'period.start'); const reference = _.get(item, 'individual', {}); @@ -70,10 +75,10 @@ export class EncounterModel { }; r4DTO(fhirResource:any){ - this.periodEnd = _.get(fhirResource, 'period.end'); - this.periodStart = _.get(fhirResource, 'period.start'); + this.period_end = _.get(fhirResource, 'period.end'); + this.period_start = _.get(fhirResource, 'period.start'); - this.resourceClass = _.get(fhirResource, 'class.display'); + this.resource_class = _.get(fhirResource, 'class.display'); this.participant = _.get(fhirResource, 'participant', []).map((item: any) => { let periodStart = _.get(item, 'period.start'); const reference = _.get(item, 'individual', {}); diff --git a/frontend/src/lib/models/resources/goal-model.spec.ts b/frontend/src/lib/models/resources/goal-model.spec.ts index cf376f54..98fef47b 100644 --- a/frontend/src/lib/models/resources/goal-model.spec.ts +++ b/frontend/src/lib/models/resources/goal-model.spec.ts @@ -15,23 +15,23 @@ describe('GoalModel', () => { // expected.title: string | undefined expected.status = 'on-hold' - expected.hasStatus = true - expected.startDate = '2015-04-05' - expected.hasCategory = true + expected.has_status = true + expected.start_date = '2015-04-05' + expected.has_category = true expected.category = [ new CodableConceptModel({ coding: [ Object({ system: 'http://terminology.hl7.org/CodeSystem/goal-category', code: 'dietary' }) ] }) ] // expected.hasUdi: boolean | undefined // expected.udi: string | undefined expected.addresses = [{ display: 'obesity condition' }] - expected.hasAddresses = true + expected.has_addresses = true // expected.author: string | undefined expected.description = 'Target weight is 160 to 180 lbs.' // expected.outcomeReference: string | undefined // expected.achievementStatus: string | undefined expected.priority = { system: 'http://terminology.hl7.org/CodeSystem/goal-priority', code: 'high-priority', display: 'High Priority' } expected.subject = { reference: 'Patient/example', display: 'Peter James Chalmers' } - expected.statusDate = '2016-02-14' + expected.status_date = '2016-02-14' expect(new GoalModel(fixture)).toEqual(expected); }); @@ -42,17 +42,17 @@ describe('GoalModel', () => { // expected.title: string | undefined expected.status = 'completed' - expected.hasStatus = true - expected.startDate = '2015-04-05' - expected.hasCategory = false + expected.has_status = true + expected.start_date = '2015-04-05' + expected.has_category = false // expected.hasUdi: boolean | undefined // expected.udi: string | undefined // expected.addresses = [{ display: 'obesity condition' }] - expected.hasAddresses = false + expected.has_addresses = false // expected.author: string | undefined expected.description = 'Stop smoking' // expected.outcomeReference: string | undefined - expected.achievementStatus = { system: 'http://terminology.hl7.org/CodeSystem/goal-achievement', code: 'achieved', display: 'Achieved' } + expected.achievement_status = { system: 'http://terminology.hl7.org/CodeSystem/goal-achievement', code: 'achieved', display: 'Achieved' } // expected.priority = { system: 'http://terminology.hl7.org/CodeSystem/goal-priority', code: 'high-priority', display: 'High Priority' } expected.subject = { reference: 'Patient/example', display: 'Peter James Chalmers' } // expected.statusDate = '2016-02-14' diff --git a/frontend/src/lib/models/resources/goal-model.ts b/frontend/src/lib/models/resources/goal-model.ts index 0889dec9..84f281d0 100644 --- a/frontend/src/lib/models/resources/goal-model.ts +++ b/frontend/src/lib/models/resources/goal-model.ts @@ -1,51 +1,55 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {CodableConceptModel, hasValue} from '../datatypes/codable-concept-model'; import {ReferenceModel} from '../datatypes/reference-model'; import {CodingModel} from '../datatypes/coding-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; -export class GoalModel { +export class GoalModel extends FastenDisplayModel { title: string | undefined status: string | undefined - hasStatus: boolean | undefined - startDate: string | undefined - hasCategory: boolean | undefined + has_status: boolean | undefined + start_date: string | undefined + has_category: boolean | undefined category: CodableConceptModel[] | undefined - hasUdi: boolean | undefined + has_udi: boolean | undefined udi: string | undefined addresses: any[] | undefined - hasAddresses: boolean | undefined + has_addresses: boolean | undefined author: string | undefined description: string | undefined - outcomeReference: string | undefined - achievementStatus: CodingModel | undefined + outcome_reference: string | undefined + achievement_status: CodingModel | undefined priority: CodingModel | undefined subject: ReferenceModel | undefined - statusDate: string | undefined + status_date: string | undefined - constructor(fhirResource: any, fhirVersion?: fhirVersions) { + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.Goal this.resourceDTO(fhirResource, fhirVersion || fhirVersions.R4); } commonDTO(fhirResource: any){ this.title = _.get(fhirResource, 'note[0].text', 'Goal'); this.status = _.get(fhirResource, 'status', ''); - this.hasStatus = _.has(fhirResource, 'status'); - this.startDate = _.get(fhirResource, 'startDate'); + this.has_status = _.has(fhirResource, 'status'); + this.start_date = _.get(fhirResource, 'startDate'); let category = _.get(fhirResource, 'category'); if(category){ this.category = category.map((cat:any) => new CodableConceptModel(cat)) } - this.hasCategory = Array.isArray(this.category); - this.hasUdi = _.has(fhirResource, 'udi'); + this.has_category = Array.isArray(this.category); + this.has_udi = _.has(fhirResource, 'udi'); this.udi = _.get(fhirResource, 'udi'); this.addresses = _.get(fhirResource, 'addresses'); - this.hasAddresses = Array.isArray(this.addresses); + this.has_addresses = Array.isArray(this.addresses); this.author = _.get(fhirResource, 'author'); this.priority = _.get(fhirResource, 'priority.coding[0]'); this.subject = _.get(fhirResource, 'subject'); - this.statusDate = _.get(fhirResource, 'statusDate'); + this.status_date = _.get(fhirResource, 'statusDate'); }; dstu2DTO(fhirResource:any){ this.description = _.get(fhirResource, 'description'); @@ -53,13 +57,13 @@ export class GoalModel { stu3DTO(fhirResource:any){ this.description = _.get(fhirResource, 'description.text', null); this.title = _.get(fhirResource, 'statusReason'); - this.outcomeReference = _.get(fhirResource, 'outcomeReference'); + this.outcome_reference = _.get(fhirResource, 'outcomeReference'); }; r4DTO(fhirResource:any){ this.description = _.get(fhirResource, 'description.text', null); this.status = _.get(fhirResource, 'lifecycleStatus', ''); - this.hasStatus = _.has(fhirResource, 'lifecycleStatus'); - this.achievementStatus = _.get(fhirResource, 'achievementStatus.coding[0]'); + this.has_status = _.has(fhirResource, 'lifecycleStatus'); + this.achievement_status = _.get(fhirResource, 'achievementStatus.coding[0]'); }; resourceDTO(fhirResource: any, fhirVersion:fhirVersions){ diff --git a/frontend/src/lib/models/resources/immunization-model.spec.ts b/frontend/src/lib/models/resources/immunization-model.spec.ts index 128ff5b4..44e0afa7 100644 --- a/frontend/src/lib/models/resources/immunization-model.spec.ts +++ b/frontend/src/lib/models/resources/immunization-model.spec.ts @@ -12,20 +12,20 @@ describe('ImmunizationModel', () => { expected.title = 'Fluvax (Influenza)' expected.status = 'completed' - expected.providedDate = '2013-01-10' + expected.provided_date = '2013-01-10' // manufacturerText: string | undefined - expected.hasLotNumber = true - expected.lotNumber = 'AAJN11K' - expected.lotNumberExpirationDate = '2015-02-15' - expected.hasDoseQuantity = true - expected.doseQuantity = { value: 5, system: 'http://unitsofmeasure.org', code: 'mg' } + expected.has_lot_number = true + expected.lot_number = 'AAJN11K' + expected.lot_number_expiration_date = '2015-02-15' + expected.has_dose_quantity = true + expected.dose_quantity = { value: 5, system: 'http://unitsofmeasure.org', code: 'mg' } // requester: string | undefined // reported: string | undefined // performer: string | undefined expected.route = [ { system: 'http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration', code: 'IM', display: 'Injection, intramuscular' }] - expected.hasRoute = true + expected.has_route = true expected.site = [{ system: 'http://terminology.hl7.org/CodeSystem/v3-ActSite', code: 'LA', display: 'left arm' } ] - expected.hasSite = true + expected.has_site = true expected.patient = { reference: 'Patient/example' } expected.note = [ { text: 'Notes on adminstration of vaccine' } ] diff --git a/frontend/src/lib/models/resources/immunization-model.ts b/frontend/src/lib/models/resources/immunization-model.ts index 4c39877a..f35d59ff 100644 --- a/frontend/src/lib/models/resources/immunization-model.ts +++ b/frontend/src/lib/models/resources/immunization-model.ts @@ -1,31 +1,35 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {CodableConceptModel, hasValue} from '../datatypes/codable-concept-model'; import {ReferenceModel} from '../datatypes/reference-model'; import {CodingModel} from '../datatypes/coding-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; -export class ImmunizationModel { +export class ImmunizationModel extends FastenDisplayModel { title: string | undefined status: string | undefined - providedDate: string | undefined - manufacturerText: string | undefined - hasLotNumber: boolean | undefined - lotNumber: string | undefined - lotNumberExpirationDate: string | undefined - hasDoseQuantity: boolean | undefined - doseQuantity: CodingModel | undefined + provided_date: string | undefined + manufacturer_text: string | undefined + has_lot_number: boolean | undefined + lot_number: string | undefined + lot_number_expiration_date: string | undefined + has_dose_quantity: boolean | undefined + dose_quantity: CodingModel | undefined requester: string | undefined reported: string | undefined performer: string | undefined route: CodingModel[] | undefined - hasRoute: boolean | undefined + has_route: boolean | undefined site: CodingModel[] | undefined - hasSite: boolean | undefined + has_site: boolean | undefined patient: ReferenceModel | undefined note: any[] | undefined - constructor(fhirResource: any, fhirVersion?: fhirVersions) { + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.Immunization this.resourceDTO(fhirResource, fhirVersion || fhirVersions.R4); } @@ -35,19 +39,19 @@ export class ImmunizationModel { _.get(fhirResource, 'vaccineCode.text') || _.get(fhirResource, 'vaccineCode.coding[0].display', 'Immunization'); this.status = _.get(fhirResource, 'status', null); - this.providedDate = _.get(fhirResource, 'date', null); + this.provided_date = _.get(fhirResource, 'date', null); this.reported = _.get(fhirResource, 'reported') && ' - self reported'; - this.manufacturerText = _.get(fhirResource, 'manufacturer.display'); - this.hasLotNumber = _.has(fhirResource, 'lotNumber'); - this.lotNumber = _.get(fhirResource, 'lotNumber'); - this.lotNumberExpirationDate = _.get(fhirResource, 'expirationDate'); - this.hasDoseQuantity = _.has(fhirResource, 'doseQuantity'); - this.doseQuantity = _.get(fhirResource, 'doseQuantity'); + this.manufacturer_text = _.get(fhirResource, 'manufacturer.display'); + this.has_lot_number = _.has(fhirResource, 'lotNumber'); + this.lot_number = _.get(fhirResource, 'lotNumber'); + this.lot_number_expiration_date = _.get(fhirResource, 'expirationDate'); + this.has_dose_quantity = _.has(fhirResource, 'doseQuantity'); + this.dose_quantity = _.get(fhirResource, 'doseQuantity'); this.requester = _.get(fhirResource, 'requester'); this.route = _.get(fhirResource, 'route.coding'); - this.hasRoute = Array.isArray(this.route); + this.has_route = Array.isArray(this.route); this.site = _.get(fhirResource, 'site.coding'); - this.hasSite = Array.isArray(this.site); + this.has_site = Array.isArray(this.site); this.patient = _.get(fhirResource, 'patient'); this.note = _.get(fhirResource, 'note'); }; @@ -60,7 +64,7 @@ export class ImmunizationModel { r4DTO(fhirResource:any){ this.performer = _.get(fhirResource, 'performer.actor'); - this.providedDate = + this.provided_date = _.get(fhirResource, 'occurrenceDateTime') || _.get(fhirResource, 'occurrenceString'); }; diff --git a/frontend/src/lib/models/resources/location-model.spec.ts b/frontend/src/lib/models/resources/location-model.spec.ts index 9c3720b3..e52b9a55 100644 --- a/frontend/src/lib/models/resources/location-model.spec.ts +++ b/frontend/src/lib/models/resources/location-model.spec.ts @@ -17,7 +17,7 @@ describe('LocationModel', () => { expectedLocation.status = 'active' expectedLocation.description = 'Second floor of the Old South Wing, formerly in use by Psychiatry' expectedLocation.mode = "instance" - expectedLocation.managingOrganization = {"reference": "Organization/f001"} + expectedLocation.managing_organization = {"reference": "Organization/f001"} expectedLocation.address = new AddressModel({ city: "Den Burg", line: ['Galapagosweg 91, Building A'], @@ -31,7 +31,7 @@ describe('LocationModel', () => { {system: 'url', value: 'http://sampleorg.com/southwing', use: 'work'} ] expectedLocation.type = [] - expectedLocation.physicalType = new CodableConceptModel({ + expectedLocation.physical_type = new CodableConceptModel({ text: '', coding: [ { @@ -52,7 +52,7 @@ describe('LocationModel', () => { expectedLocation.status = 'active' expectedLocation.description = "Ambulance provided by Burgers University Medical Center" expectedLocation.mode = "kind" - expectedLocation.managingOrganization = {"reference": "Organization/f001"} + expectedLocation.managing_organization = {"reference": "Organization/f001"} expectedLocation.telecom = [ {system: 'phone', value: '2329', use: 'mobile'} ] @@ -66,7 +66,7 @@ describe('LocationModel', () => { } ] })] - expectedLocation.physicalType = new CodableConceptModel({ + expectedLocation.physical_type = new CodableConceptModel({ text: '', coding: [ { @@ -90,7 +90,7 @@ describe('LocationModel', () => { expectedLocation.status = 'active' expectedLocation.description = "Second floor of the Old South Wing, formerly in use by Psychiatry" expectedLocation.mode = "instance" - expectedLocation.managingOrganization = {"reference": "Organization/f001"} + expectedLocation.managing_organization = {"reference": "Organization/f001"} expectedLocation.telecom = [ { "system": "phone", @@ -121,7 +121,7 @@ describe('LocationModel', () => { "postalCode": "9105 PZ", "country": "NLD" }) - expectedLocation.physicalType = new CodableConceptModel({ + expectedLocation.physical_type = new CodableConceptModel({ text: '', coding: [ { diff --git a/frontend/src/lib/models/resources/location-model.ts b/frontend/src/lib/models/resources/location-model.ts index 9e732ee5..2fb338e3 100644 --- a/frontend/src/lib/models/resources/location-model.ts +++ b/frontend/src/lib/models/resources/location-model.ts @@ -3,20 +3,25 @@ import {AddressModel} from '../datatypes/address-model'; import {TelecomModel} from '../datatypes/telecom-model'; import {CodableConceptModel} from '../datatypes/codable-concept-model'; import {ReferenceModel} from '../datatypes/reference-model'; -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; + +export class LocationModel extends FastenDisplayModel { -export class LocationModel { name: string status: string description: string address: AddressModel telecom: TelecomModel[] type: CodableConceptModel[] - physicalType: CodableConceptModel + physical_type: CodableConceptModel mode: string - managingOrganization: ReferenceModel + managing_organization: ReferenceModel - constructor(fhirResource: any, fhirVersion?: fhirVersions) { + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.Location this.name = _.get(fhirResource, 'name'); this.status = _.get(fhirResource, 'status'); @@ -24,9 +29,9 @@ export class LocationModel { this.address = new AddressModel(_.get(fhirResource, 'address')); this.telecom = _.get(fhirResource, 'telecom'); this.type = (_.get(fhirResource, 'type') || []).map((_type: any) => new CodableConceptModel(_type)); - this.physicalType = new CodableConceptModel(_.get(fhirResource, 'physicalType')); + this.physical_type = new CodableConceptModel(_.get(fhirResource, 'physicalType')); this.mode = _.get(fhirResource, 'mode'); - this.managingOrganization = _.get(fhirResource, 'managingOrganization'); + this.managing_organization = _.get(fhirResource, 'managingOrganization'); } } diff --git a/frontend/src/lib/models/resources/medication-dispense-model.ts b/frontend/src/lib/models/resources/medication-dispense-model.ts index a8833487..3fa1569f 100644 --- a/frontend/src/lib/models/resources/medication-dispense-model.ts +++ b/frontend/src/lib/models/resources/medication-dispense-model.ts @@ -1,26 +1,31 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {CodableConceptModel, hasValue} from '../datatypes/codable-concept-model'; import {ReferenceModel} from '../datatypes/reference-model'; import {CodingModel} from '../datatypes/coding-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; -export class MedicationDispenseModel { - medicationTitle: string|undefined - medicationCoding: string|undefined - typeCoding: string|undefined - hasDosageInstruction: boolean|undefined - dosageInstruction: any[] | undefined - dosageInstructionData: any[]|undefined - whenPrepared: string|undefined +export class MedicationDispenseModel extends FastenDisplayModel { - constructor(fhirResource: any, fhirVersion?: fhirVersions) { + medication_title: string|undefined + medication_coding: string|undefined + type_coding: string|undefined + has_dosage_instruction: boolean|undefined + dosage_instruction: any[] | undefined + dosage_instruction_data: any[]|undefined + when_prepared: string|undefined + + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.MedicationDispense this.resourceDTO(fhirResource, fhirVersion || fhirVersions.R4); } commonDTO(fhirResource:any){ - this.typeCoding = _.get(fhirResource, 'type.coding.0'); - this.whenPrepared = _.get(fhirResource, 'whenPrepared'); + this.type_coding = _.get(fhirResource, 'type.coding.0'); + this.when_prepared = _.get(fhirResource, 'whenPrepared'); }; dstu2DTO(fhirResource:any){ @@ -46,10 +51,10 @@ export class MedicationDispenseModel { }); }; - this.medicationTitle = _.get(fhirResource, 'medicationReference.display'); - this.dosageInstruction = _.get(fhirResource, 'dosageInstruction', []); - this.hasDosageInstruction = Array.isArray(this.dosageInstruction) && this.dosageInstruction.length > 0; - this.dosageInstructionData = prepareDosageInstructionData(this.dosageInstruction || []); + this.medication_title = _.get(fhirResource, 'medicationReference.display'); + this.dosage_instruction = _.get(fhirResource, 'dosageInstruction', []); + this.has_dosage_instruction = Array.isArray(this.dosage_instruction) && this.dosage_instruction.length > 0; + this.dosage_instruction_data = prepareDosageInstructionData(this.dosage_instruction || []); }; stu3DTO(fhirResource:any){ @@ -74,14 +79,14 @@ export class MedicationDispenseModel { return data; }); }; - this.medicationTitle = + this.medication_title = _.get(fhirResource, 'medicationReference.display') || _.get(fhirResource, 'contained[0].code.coding[0].display'); - this.medicationCoding = _.get(fhirResource, 'contained[0].code.coding[0]'); - this.dosageInstruction = _.get(fhirResource, 'dosageInstruction', []); - this.hasDosageInstruction = - Array.isArray(this.dosageInstruction) && this.dosageInstruction.length > 0; - this.dosageInstructionData = prepareDosageInstructionData(this.dosageInstruction); + this.medication_coding = _.get(fhirResource, 'contained[0].code.coding[0]'); + this.dosage_instruction = _.get(fhirResource, 'dosageInstruction', []); + this.has_dosage_instruction = + Array.isArray(this.dosage_instruction) && this.dosage_instruction.length > 0; + this.dosage_instruction_data = prepareDosageInstructionData(this.dosage_instruction); }; r4DTO(fhirResource:any){ @@ -106,14 +111,14 @@ export class MedicationDispenseModel { return data; }); }; - this.medicationTitle = + this.medication_title = _.get(fhirResource, 'medicationReference.display') || _.get(fhirResource, 'contained[0].code.coding[0].display'); - this.medicationCoding = _.get(fhirResource, 'contained[0].code.coding[0]'); - this.dosageInstruction = _.get(fhirResource, 'dosageInstruction', []); - this.hasDosageInstruction = - Array.isArray(this.dosageInstruction) && this.dosageInstruction.length > 0; - this.dosageInstructionData = prepareDosageInstructionData(this.dosageInstruction); + this.medication_coding = _.get(fhirResource, 'contained[0].code.coding[0]'); + this.dosage_instruction = _.get(fhirResource, 'dosageInstruction', []); + this.has_dosage_instruction = + Array.isArray(this.dosage_instruction) && this.dosage_instruction.length > 0; + this.dosage_instruction_data = prepareDosageInstructionData(this.dosage_instruction); }; resourceDTO(fhirResource:any, fhirVersion: fhirVersions){ diff --git a/frontend/src/lib/models/resources/medication-model.ts b/frontend/src/lib/models/resources/medication-model.ts index c07c2f97..ec1156f5 100644 --- a/frontend/src/lib/models/resources/medication-model.ts +++ b/frontend/src/lib/models/resources/medication-model.ts @@ -1,25 +1,30 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {CodableConceptModel, hasValue} from '../datatypes/codable-concept-model'; import {ReferenceModel} from '../datatypes/reference-model'; import {CodingModel} from '../datatypes/coding-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; + +export class MedicationModel extends FastenDisplayModel { -export class MedicationModel { title: CodingModel|undefined - isBrand: string|undefined + is_brand: string|undefined manufacturer: string|undefined - hasProductForm:boolean|undefined - productForm: string|undefined - productIngredient: string|undefined - hasProductIngredient: boolean|undefined - hasProduct: boolean|undefined - packageCoding: string|undefined - hasPackageCoding: boolean|undefined - hasImages: boolean|undefined + has_product_form:boolean|undefined + product_form: string|undefined + product_ingredient: string|undefined + has_product_ingredient: boolean|undefined + has_product: boolean|undefined + package_coding: string|undefined + has_package_coding: boolean|undefined + has_images: boolean|undefined images: string|undefined status: string|undefined - constructor(fhirResource: any, fhirVersion?: fhirVersions) { + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.Medication this.resourceDTO(fhirResource, fhirVersion || fhirVersions.R4); } @@ -32,46 +37,46 @@ export class MedicationModel { }; dstu2DTO(fhirResource:any){ - this.productForm = _.get(fhirResource, 'product.form.coding', []); - this.hasProductForm = Array.isArray(this.productForm) && this.productForm.length > 0; - this.productIngredient = _.get(fhirResource, 'product.ingredient', []); - this.hasProductIngredient = - Array.isArray(this.productIngredient) && this.productIngredient.length > 0; - this.hasProduct = this.hasProductForm || this.hasProductIngredient; - this.packageCoding = _.get(fhirResource, 'package.container.coding', []); - this.hasPackageCoding = - Array.isArray(this.packageCoding) && this.packageCoding.length > 0; - this.isBrand = _.get(fhirResource, 'isBrand'); + this.product_form = _.get(fhirResource, 'product.form.coding', []); + this.has_product_form = Array.isArray(this.product_form) && this.product_form.length > 0; + this.product_ingredient = _.get(fhirResource, 'product.ingredient', []); + this.has_product_ingredient = + Array.isArray(this.product_ingredient) && this.product_ingredient.length > 0; + this.has_product = this.has_product_form || this.has_product_ingredient; + this.package_coding = _.get(fhirResource, 'package.container.coding', []); + this.has_package_coding = + Array.isArray(this.package_coding) && this.package_coding.length > 0; + this.is_brand = _.get(fhirResource, 'isBrand'); }; stu3DTO(fhirResource:any){ - this.productForm = _.get(fhirResource, 'form.coding', []); - this.hasProductForm = Array.isArray(this.productForm) && this.productForm.length > 0; - this.productIngredient = _.get(fhirResource, 'ingredient', []); - this.hasProductIngredient = Array.isArray(this.productIngredient) && this.productIngredient.length > 0; - this. hasProduct = this.hasProductForm || this.hasProductIngredient; - this. packageCoding = _.get(fhirResource, 'package.container.coding', []); - this. hasPackageCoding = - Array.isArray(this.packageCoding) && this.packageCoding.length > 0; + this.product_form = _.get(fhirResource, 'form.coding', []); + this.has_product_form = Array.isArray(this.product_form) && this.product_form.length > 0; + this.product_ingredient = _.get(fhirResource, 'ingredient', []); + this.has_product_ingredient = Array.isArray(this.product_ingredient) && this.product_ingredient.length > 0; + this. has_product = this.has_product_form || this.has_product_ingredient; + this. package_coding = _.get(fhirResource, 'package.container.coding', []); + this. has_package_coding = + Array.isArray(this.package_coding) && this.package_coding.length > 0; this. images = _.get(fhirResource, 'image', []); - this. hasImages = true; + this. has_images = true; if ( !Array.isArray(this.images) || this.images.filter(item => !!item.url).length === 0 ) { - this.hasImages = false; + this.has_images = false; } - this. isBrand = _.get(fhirResource, 'isBrand'); + this. is_brand = _.get(fhirResource, 'isBrand'); }; r4DTO(fhirResource:any){ - this.productForm = _.get(fhirResource, 'form.coding', []); - this.hasProductForm = Array.isArray(this.productForm) && this.productForm.length > 0; - this.productIngredient = _.get(fhirResource, 'ingredient', []); - this.hasProductIngredient = - Array.isArray(this.productIngredient) && this.productIngredient.length > 0; + this.product_form = _.get(fhirResource, 'form.coding', []); + this.has_product_form = Array.isArray(this.product_form) && this.product_form.length > 0; + this.product_ingredient = _.get(fhirResource, 'ingredient', []); + this.has_product_ingredient = + Array.isArray(this.product_ingredient) && this.product_ingredient.length > 0; this.status = _.get(fhirResource, 'status'); - this.hasProduct = this.hasProductForm || this.hasProductIngredient; + this.has_product = this.has_product_form || this.has_product_ingredient; }; resourceDTO(fhirResource:any, fhirVersion: fhirVersions){ diff --git a/frontend/src/lib/models/resources/medication-request-model.spec.ts b/frontend/src/lib/models/resources/medication-request-model.spec.ts new file mode 100644 index 00000000..91fae927 --- /dev/null +++ b/frontend/src/lib/models/resources/medication-request-model.spec.ts @@ -0,0 +1,7 @@ +import { MedicationRequestModel } from './medication-request-model'; + +describe('MedicationRequestModel', () => { + it('should create an instance', () => { + expect(new MedicationRequestModel()).toBeTruthy(); + }); +}); diff --git a/frontend/src/lib/models/resources/medication-request-model.ts b/frontend/src/lib/models/resources/medication-request-model.ts new file mode 100644 index 00000000..099e3275 --- /dev/null +++ b/frontend/src/lib/models/resources/medication-request-model.ts @@ -0,0 +1,40 @@ +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {CodingModel} from '../datatypes/coding-model'; +import {fhirVersions, ResourceType} from '../constants'; +import {FastenOptions} from '../fasten/fasten-options'; +import * as _ from "lodash"; +import {ReferenceModel} from '../datatypes/reference-model'; + +export class MedicationRequestModel extends FastenDisplayModel { + + display: string|undefined + medication_reference: ReferenceModel|undefined + medication_codeable_concept: CodingModel|undefined + reason_code: string|undefined + dosage_instruction: string|undefined + has_dosage_instruction: boolean|undefined + requester: string|undefined + created: string|undefined + intent: string|undefined + + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.MedicationRequest + + this.medication_reference = _.get(fhirResource, 'medicationReference'); + this.medication_codeable_concept = _.get( + fhirResource, + 'medicationCodeableConcept.coding.0', + ); + this.reason_code = _.get(fhirResource, 'reasonCode'); + this.dosage_instruction = _.get(fhirResource, 'dosageInstruction'); + this.has_dosage_instruction = + Array.isArray(this.dosage_instruction) && this.dosage_instruction.length > 0; + this.requester = + _.get(fhirResource, 'requester.agent') || _.get(fhirResource, 'requester'); + this.created = _.get(fhirResource, 'authoredOn'); + this.intent = _.get(fhirResource, 'intent'); + + this.display = _.get(fhirResource, 'medicationCodeableConcept.text') || this.medication_codeable_concept?.display || _.get(fhirResource, 'medicationCodeableConcept.text') || this.medication_reference?.display + } +} diff --git a/frontend/src/lib/models/resources/observation-model.ts b/frontend/src/lib/models/resources/observation-model.ts index 0b9ea399..6157f223 100644 --- a/frontend/src/lib/models/resources/observation-model.ts +++ b/frontend/src/lib/models/resources/observation-model.ts @@ -1,47 +1,51 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {CodableConceptModel, hasValue} from '../datatypes/codable-concept-model'; import {ReferenceModel} from '../datatypes/reference-model'; import {CodingModel} from '../datatypes/coding-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; -export class ObservationModel { +export class ObservationModel extends FastenDisplayModel { - effectiveDate: string - codeCodingDisplay: string - codeText: string - valueQuantityValue: string - valueQuantityUnit: string + effective_date: string + code_coding_display: string + code_text: string + value_quantity_value: string + value_quantity_unit: string status: string - valueCodeableConceptText: string - valueCodeableConceptCodingDisplay: string - valueCodeableConceptCoding: string - valueQuantityValueNumber: string + value_codeable_concept_text: string + value_codeable_concept_coding_display: string + value_codeable_concept_coding: string + value_quantity_value_number: string subject: string - constructor(fhirResource: any, fhirVersion?: fhirVersions) { - this.effectiveDate = _.get(fhirResource, 'effectiveDateTime'); - this.codeCodingDisplay = _.get(fhirResource, 'code.coding.0.display'); - this.codeText = _.get(fhirResource, 'code.text', ''); - this.valueQuantityValue = _.get(fhirResource, 'valueQuantity.value', ''); + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.Observation + this.effective_date = _.get(fhirResource, 'effectiveDateTime'); + this.code_coding_display = _.get(fhirResource, 'code.coding.0.display'); + this.code_text = _.get(fhirResource, 'code.text', ''); + this.value_quantity_value = _.get(fhirResource, 'valueQuantity.value', ''); // const issued = _.get(fhirResource, 'issued', ''); - this.valueQuantityUnit = _.get(fhirResource, 'valueQuantity.unit', ''); + this.value_quantity_unit = _.get(fhirResource, 'valueQuantity.unit', ''); this.status = _.get(fhirResource, 'status', ''); - this.valueCodeableConceptText = _.get( + this.value_codeable_concept_text = _.get( fhirResource, 'valueCodeableConcept.text', ); - this.valueCodeableConceptCodingDisplay = _.get( + this.value_codeable_concept_coding_display = _.get( fhirResource, 'valueCodeableConcept.coding[0].display', ); - this.valueCodeableConceptCoding = _.get( + this.value_codeable_concept_coding = _.get( fhirResource, 'valueCodeableConcept.coding', [], ); - this.valueQuantityValueNumber = this.valueQuantityValue; + this.value_quantity_value_number = this.value_quantity_value; this.subject = _.get(fhirResource, 'subject'); } diff --git a/frontend/src/lib/models/resources/organization-model.ts b/frontend/src/lib/models/resources/organization-model.ts index f9942837..2ba3233c 100644 --- a/frontend/src/lib/models/resources/organization-model.ts +++ b/frontend/src/lib/models/resources/organization-model.ts @@ -1,17 +1,22 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {CodableConceptModel, hasValue} from '../datatypes/codable-concept-model'; import {ReferenceModel} from '../datatypes/reference-model'; import {CodingModel} from '../datatypes/coding-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; + +export class OrganizationModel extends FastenDisplayModel { -export class OrganizationModel { identifier: string|undefined name: string|undefined addresses: string|undefined telecom: string|undefined - typeCodings: any[]|undefined + type_codings: any[]|undefined - constructor(fhirResource: any, fhirVersion?: fhirVersions) { + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.Organization this.resourceDTO(fhirResource, fhirVersion || fhirVersions.R4); } @@ -23,11 +28,11 @@ export class OrganizationModel { this.telecom = _.get(fhirResource, 'telecom'); }; dstu2DTO(fhirResource:any){ - this.typeCodings = _.get(fhirResource, 'type.coding'); + this.type_codings = _.get(fhirResource, 'type.coding'); }; stu3DTO(fhirResource:any){ let typeCodings = _.get(fhirResource, 'type', []).map((type: { coding: any; }) => type.coding); - this.typeCodings = _.flatten(typeCodings) + this.type_codings = _.flatten(typeCodings) }; resourceDTO(fhirResource:any, fhirVersion:fhirVersions){ diff --git a/frontend/src/lib/models/resources/patient-model.ts b/frontend/src/lib/models/resources/patient-model.ts index dba8e9cc..dc0b934e 100644 --- a/frontend/src/lib/models/resources/patient-model.ts +++ b/frontend/src/lib/models/resources/patient-model.ts @@ -1,46 +1,52 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {CodableConceptModel, hasValue} from '../datatypes/codable-concept-model'; import {ReferenceModel} from '../datatypes/reference-model'; import {CodingModel} from '../datatypes/coding-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; + +export class PatientModel extends FastenDisplayModel { -export class PatientModel { id: string|undefined - patientName: string|undefined - patientBirthDate: string|undefined - patientGender: string|undefined - patientContact: string|undefined - patientAddress: string|undefined - patientPhones: string|undefined - communicationLanguage: string|undefined - hasCommunicationLanguage: boolean|undefined - hasPatientPhones: boolean|undefined + patient_name: string|undefined + patient_birthdate: string|undefined + patient_gender: string|undefined + patient_contact: string|undefined + patient_address: string|undefined + patient_phones: string|undefined + communication_language: string|undefined + has_communication_language: boolean|undefined + has_patient_phones: boolean|undefined active: string|undefined - activeStatus: string|undefined - isDeceased: boolean|undefined - deceasedDate: string|undefined + active_status: string|undefined + is_deceased: boolean|undefined + deceased_date: string|undefined + + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.Patient - constructor(fhirResource: any, fhirVersion?: fhirVersions) { this.id = this.getId(fhirResource); - this.patientName = this.getNames(fhirResource); - this.patientBirthDate = this.getBirthDate(fhirResource); - this.patientGender = this.getGender(fhirResource); - this.patientContact = _.get(fhirResource, 'contact[0]'); - this.patientAddress = _.get(fhirResource, 'address[0]'); - this.patientPhones = _.get(fhirResource, 'telecom', []).filter( + this.patient_name = this.getNames(fhirResource); + this.patient_birthdate = this.getBirthDate(fhirResource); + this.patient_gender = this.getGender(fhirResource); + this.patient_contact = _.get(fhirResource, 'contact[0]'); + this.patient_address = _.get(fhirResource, 'address[0]'); + this.patient_phones = _.get(fhirResource, 'telecom', []).filter( (telecom: any) => telecom.system === 'phone', ); let communicationLanguage = _.get(fhirResource, 'communication', []) .filter((item: any) => Boolean(_.get(item, 'language.coding', null))) .map((item: any) => item.language.coding); - this.communicationLanguage = _.get(communicationLanguage, '0', []); - this.hasCommunicationLanguage = !_.isEmpty(communicationLanguage); - this.hasPatientPhones = !_.isEmpty(this.patientPhones); + this.communication_language = _.get(communicationLanguage, '0', []); + this.has_communication_language = !_.isEmpty(communicationLanguage); + this.has_patient_phones = !_.isEmpty(this.patient_phones); this.active = _.get(fhirResource, 'active', false); - this.activeStatus = this.active ? 'active' : 'inactive'; + this.active_status = this.active ? 'active' : 'inactive'; let deceasedBoolean = _.get(fhirResource, 'deceasedBoolean', false); - this.deceasedDate = _.get(fhirResource, 'deceasedDateTime'); - this.isDeceased = deceasedBoolean || this.deceasedDate; + this.deceased_date = _.get(fhirResource, 'deceasedDateTime'); + this.is_deceased = deceasedBoolean || this.deceased_date; } getId(fhirResource: any) { diff --git a/frontend/src/lib/models/resources/practitioner-model.ts b/frontend/src/lib/models/resources/practitioner-model.ts index 373859d5..d35b44af 100644 --- a/frontend/src/lib/models/resources/practitioner-model.ts +++ b/frontend/src/lib/models/resources/practitioner-model.ts @@ -1,24 +1,29 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {CodableConceptModel, hasValue} from '../datatypes/codable-concept-model'; import {ReferenceModel} from '../datatypes/reference-model'; import {CodingModel} from '../datatypes/coding-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; + +export class PractitionerModel extends FastenDisplayModel { -export class PractitionerModel { identifier: string|undefined - name: string|undefined + name: any|undefined gender: string|undefined status: string|undefined - isContactData: boolean|undefined + is_contact_data: boolean|undefined contactData: { name: string, relationship: string }|undefined telecom: string|undefined address: string|undefined - birthDate: string|undefined + birthdate: string|undefined - constructor(fhirResource: any, fhirVersion?: fhirVersions) { + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.Practitioner this.resourceDTO(fhirResource, fhirVersion || fhirVersions.R4); } @@ -28,8 +33,8 @@ export class PractitionerModel { this.identifier = _.get(fhirResource, 'identifier', ''); this.gender = _.get(fhirResource, 'gender', ''); this.status = _.get(fhirResource, 'active') === true ? 'active' : ''; - this.isContactData = _.has(fhirResource, 'contact[0]'); - this.birthDate = _.get(fhirResource, 'birthDate'); + this.is_contact_data = _.has(fhirResource, 'contact[0]'); + this.birthdate = _.get(fhirResource, 'birthDate'); this.contactData = { name: _.get(fhirResource, 'contact[0].name'), relationship: _.get(fhirResource, 'contact[0].relationship[0].text'), diff --git a/frontend/src/lib/models/resources/practitioner-role-model.ts b/frontend/src/lib/models/resources/practitioner-role-model.ts index c85d6642..09670572 100644 --- a/frontend/src/lib/models/resources/practitioner-role-model.ts +++ b/frontend/src/lib/models/resources/practitioner-role-model.ts @@ -1,17 +1,23 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {CodableConceptModel, hasValue} from '../datatypes/codable-concept-model'; import {ReferenceModel} from '../datatypes/reference-model'; import {CodingModel} from '../datatypes/coding-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; + +export class PractitionerRoleModel extends FastenDisplayModel { -export class PractitionerRoleModel { codes: string|undefined status: string|undefined specialties: string|undefined organization: string|undefined practitioner: string|undefined - constructor(fhirResource: any, fhirVersion?: fhirVersions) { + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.PractitionerRole + this.resourceDTO(fhirResource, fhirVersion || fhirVersions.R4); } diff --git a/frontend/src/lib/models/resources/procedure-model.ts b/frontend/src/lib/models/resources/procedure-model.ts index 5c9a2791..8b84e0e4 100644 --- a/frontend/src/lib/models/resources/procedure-model.ts +++ b/frontend/src/lib/models/resources/procedure-model.ts @@ -1,48 +1,54 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {CodableConceptModel, hasValue} from '../datatypes/codable-concept-model'; import {ReferenceModel} from '../datatypes/reference-model'; import {CodingModel} from '../datatypes/coding-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; + +export class ProcedureModel extends FastenDisplayModel { -export class ProcedureModel { display: string|undefined; status: string|undefined; - hasPerformedDateTime: boolean|undefined; - performedDateTime: string|undefined; - performedPeriodStart: string|undefined; - performedPeriodEnd: string|undefined; - hasPerformedPeriod: boolean|undefined; - hasCoding: boolean|undefined; + has_performed_datetime: boolean|undefined; + performed_datetime: string|undefined; + performed_period_start: string|undefined; + performed_period_end: string|undefined; + has_performed_period: boolean|undefined; + has_coding: boolean|undefined; coding: string|undefined; category: string|undefined; - locationReference: string|undefined; - hasPerformerData: boolean|undefined; + location_reference: string|undefined; + has_performer_data: boolean|undefined; performer: string|undefined; - hasReasonCode: boolean|undefined; - reasonCode: string|undefined; - hasNote: boolean|undefined; + has_reason_code: boolean|undefined; + reason_code: string|undefined; + has_note: boolean|undefined; note: string|undefined; outcome: string|undefined; - constructor(fhirResource: any, fhirVersion?: fhirVersions) { + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.Procedure + this.display = _.get(fhirResource, 'code.coding[0].display') || _.get(fhirResource, 'code.text'); this.status = _.get(fhirResource, 'status', ''); - this.hasPerformedDateTime = _.has(fhirResource, 'performedDateTime'); - this.performedDateTime = _.get(fhirResource, 'performedDateTime'); - this.performedPeriodStart = _.get(fhirResource, 'performedPeriod.start'); - this.performedPeriodEnd = _.get(fhirResource, 'performedPeriod.end'); - this.hasPerformedPeriod = !!(this.performedPeriodStart || this.performedPeriodEnd); - this.hasCoding = _.has(fhirResource, 'code.coding'); + this.has_performed_datetime = _.has(fhirResource, 'performedDateTime'); + this.performed_datetime = _.get(fhirResource, 'performedDateTime'); + this.performed_period_start = _.get(fhirResource, 'performedPeriod.start'); + this.performed_period_end = _.get(fhirResource, 'performedPeriod.end'); + this.has_performed_period = !!(this.performed_period_start || this.performed_period_end); + this.has_coding = _.has(fhirResource, 'code.coding'); this.coding = _.get(fhirResource, 'code.coding', []); this.category = _.get(fhirResource, 'category.coding[0]'); - this.locationReference = _.get(fhirResource, 'location'); - this.hasPerformerData = _.has(fhirResource, 'performer.0.actor.display'); + this.location_reference = _.get(fhirResource, 'location'); + this.has_performer_data = _.has(fhirResource, 'performer.0.actor.display'); this.performer = _.get(fhirResource, 'performer', []); - this.hasReasonCode = _.has(fhirResource, 'reasonCode'); - this.reasonCode = _.get(fhirResource, 'reasonCode', []); - this.hasNote = _.has(fhirResource, 'note'); + this.has_reason_code = _.has(fhirResource, 'reasonCode'); + this.reason_code = _.get(fhirResource, 'reasonCode', []); + this.has_note = _.has(fhirResource, 'note'); this.note = _.get(fhirResource, 'note', []); this.outcome = _.get(fhirResource, 'outcome'); diff --git a/frontend/src/lib/models/resources/related-person-model.ts b/frontend/src/lib/models/resources/related-person-model.ts index 1e9fa5a9..7ce03f89 100644 --- a/frontend/src/lib/models/resources/related-person-model.ts +++ b/frontend/src/lib/models/resources/related-person-model.ts @@ -1,28 +1,34 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {CodableConceptModel, hasValue} from '../datatypes/codable-concept-model'; import {ReferenceModel} from '../datatypes/reference-model'; import {CodingModel} from '../datatypes/coding-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; + +export class RelatedPersonModel extends FastenDisplayModel { -export class RelatedPersonModel { patient: string|undefined name: string|undefined - birthDate: string|undefined + birthdate: string|undefined gender: string|undefined address: string|undefined - relatedPersonTelecom: string|undefined + related_person_telecom: string|undefined + + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.RelatedPerson - constructor(fhirResource: any, fhirVersion?: fhirVersions) { this.resourceDTO(fhirResource, fhirVersion || fhirVersions.R4); } commonDTO(fhirResource:any){ this.patient = _.get(fhirResource, 'patient'); - this.birthDate = _.get(fhirResource, 'birthDate'); + this.birthdate = _.get(fhirResource, 'birthDate'); this.gender = _.get(fhirResource, 'gender'); this.address = _.get(fhirResource, 'address[0]'); - this.relatedPersonTelecom = _.get(fhirResource, 'telecom', []).filter( + this.related_person_telecom = _.get(fhirResource, 'telecom', []).filter( (telecom: any) => telecom.system === 'phone', ); }; diff --git a/frontend/src/lib/models/resources/research-study-model.ts b/frontend/src/lib/models/resources/research-study-model.ts index 0d384126..23746e13 100644 --- a/frontend/src/lib/models/resources/research-study-model.ts +++ b/frontend/src/lib/models/resources/research-study-model.ts @@ -1,30 +1,36 @@ -import {fhirVersions} from '../constants'; +import {fhirVersions, ResourceType} from '../constants'; import * as _ from "lodash"; import {CodableConceptModel, hasValue} from '../datatypes/codable-concept-model'; import {ReferenceModel} from '../datatypes/reference-model'; import {CodingModel} from '../datatypes/coding-model'; +import {FastenDisplayModel} from '../fasten/fasten-display-model'; +import {FastenOptions} from '../fasten/fasten-options'; + +export class ResearchStudyModel extends FastenDisplayModel { -export class ResearchStudyModel { title:string|undefined status:string|undefined - categoryCoding:string|undefined - focusCoding:string|undefined - protocolReference:string|undefined - partOfReference:string|undefined + category_coding:string|undefined + focus_coding:string|undefined + protocol_reference:string|undefined + part_of_reference:string|undefined contacts:string|undefined - keywordConcepts:string|undefined + keyword_concepts:string|undefined period:string|undefined - enrollmentReferences:string|undefined - sponsorReference:string|undefined - principalInvestigatorReference:string|undefined - siteReferences:string|undefined + enrollment_references:string|undefined + sponsor_reference:string|undefined + principal_investigator_reference:string|undefined + site_references:string|undefined comments:string|undefined description:string|undefined arms:string|undefined location:string|undefined - primaryPurposeType:string|undefined + primary_purpose_type:string|undefined + + constructor(fhirResource: any, fhirVersion?: fhirVersions, fastenOptions?: FastenOptions) { + super(fastenOptions) + this.source_resource_type = ResourceType.ResearchStudy - constructor(fhirResource: any, fhirVersion?: fhirVersions) { this.resourceDTO(fhirResource, fhirVersion || fhirVersions.R4); } @@ -32,24 +38,24 @@ export class ResearchStudyModel { commonDTO(fhirResource:any) { this.title = _.get(fhirResource, 'title', 'Research Study'); this.status = _.get(fhirResource, 'status'); - this.categoryCoding = _.get(fhirResource, 'category[0].coding[0]'); - this.focusCoding = _.get(fhirResource, 'focus[0].coding[0]'); - this.protocolReference = _.get(fhirResource, 'protocol'); - this.partOfReference = _.get(fhirResource, 'partOf'); + this.category_coding = _.get(fhirResource, 'category[0].coding[0]'); + this.focus_coding = _.get(fhirResource, 'focus[0].coding[0]'); + this.protocol_reference = _.get(fhirResource, 'protocol'); + this.part_of_reference = _.get(fhirResource, 'partOf'); this.contacts = _.get(fhirResource, 'contact', []).map((contact: any) => { const name = _.get(contact, 'name'); const telecoms = _.get(contact, 'telecom'); return { name, telecoms }; }); - this.keywordConcepts = _.get(fhirResource, 'keyword', []); + this.keyword_concepts = _.get(fhirResource, 'keyword', []); this.period = _.get(fhirResource, 'period', {}); - this.enrollmentReferences = _.get(fhirResource, 'enrollment', []); - this.sponsorReference = _.get(fhirResource, 'sponsor'); - this.principalInvestigatorReference = _.get( + this.enrollment_references = _.get(fhirResource, 'enrollment', []); + this.sponsor_reference = _.get(fhirResource, 'sponsor'); + this.principal_investigator_reference = _.get( fhirResource, 'principalInvestigator', ); - this.siteReferences = _.get(fhirResource, 'site', []); + this.site_references = _.get(fhirResource, 'site', []); this.comments = _.get(fhirResource, 'note', []); this.description = _.get(fhirResource, 'description'); this.arms = _.get(fhirResource, 'arm', []).map((arm: any) => { @@ -62,7 +68,7 @@ export class ResearchStudyModel { r4DTO(fhirResource:any) { this.location = _.get(fhirResource, 'location'); - this.primaryPurposeType = _.get(fhirResource, 'primaryPurposeType'); + this.primary_purpose_type = _.get(fhirResource, 'primaryPurposeType'); }; diff --git a/go.mod b/go.mod index 126b9968..ace8ed7c 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/analogj/go-util v0.0.0-20210417161720-39b497cca03b github.com/dominikbraun/graph v0.15.0 - github.com/fastenhealth/fasten-sources v0.0.11 + github.com/fastenhealth/fasten-sources v0.0.14 github.com/gin-gonic/gin v1.8.1 github.com/glebarez/sqlite v1.5.0 github.com/golang-jwt/jwt/v4 v4.4.2 @@ -17,6 +17,7 @@ require ( github.com/urfave/cli/v2 v2.11.2 golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 + golang.org/x/net v0.2.0 gorm.io/datatypes v1.0.7 gorm.io/gorm v1.24.1 ) @@ -62,7 +63,6 @@ require ( github.com/subosito/gotenv v1.3.0 // indirect github.com/ugorji/go/codec v1.2.7 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect - golang.org/x/net v0.2.0 // indirect golang.org/x/oauth2 v0.2.0 // indirect golang.org/x/sys v0.2.0 // indirect golang.org/x/term v0.2.0 // indirect diff --git a/go.sum b/go.sum index de926ae5..55e79945 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fastenhealth/fasten-sources v0.0.11 h1:GuU/fEs7yMtFY+Pe0j9z4XzJQtEZ3Yx3pDNqzsAWnOk= -github.com/fastenhealth/fasten-sources v0.0.11/go.mod h1:NBh0n2OBwJC10CHqkIx4WYQcDBRywJU4TAR8rSfR2Ts= +github.com/fastenhealth/fasten-sources v0.0.14 h1:+SGn/gzhC9MU2OzZy8hn9giiuOs6lJgIKPReY8STe5U= +github.com/fastenhealth/fasten-sources v0.0.14/go.mod h1:NBh0n2OBwJC10CHqkIx4WYQcDBRywJU4TAR8rSfR2Ts= github.com/fastenhealth/gofhir-models v0.0.4 h1:Q//StwNXGfK+WAS2DckGBHAP1R4cHMRZEF/sLGgmR04= github.com/fastenhealth/gofhir-models v0.0.4/go.mod h1:xB8ikGxu3bUq2b1JYV+CZpHqBaLXpOizFR0eFBCunis= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=