From e360369706450fdb9af921abef784a4ccdf49979 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Fri, 2 Dec 2022 19:40:58 -0800 Subject: [PATCH] begin restoring Sqlite functionality. (#11) --- CONTRIBUTING.md | 12 +- TODO.md | 5 + backend/pkg/auth/jwt_utils.go | 60 + backend/pkg/auth/user_registered_claims.go | 9 + backend/pkg/config/config.go | 6 +- backend/pkg/database/couchdb_repository.go | 122 - backend/pkg/database/interface.go | 22 +- backend/pkg/database/mock/mock_database.go | 2 +- backend/pkg/database/sqlite_repository.go | 442 + backend/pkg/models/base.go | 50 + backend/pkg/models/resource_fhir.go | 17 + backend/pkg/models/source_credential.go | 109 + backend/pkg/models/source_summary.go | 7 + backend/pkg/models/summary.go | 7 + backend/pkg/models/user.go | 21 +- backend/pkg/web/handler/auth.go | 49 +- backend/pkg/web/handler/couchdb_proxy.go | 40 - backend/pkg/web/handler/resource_fhir.go | 51 + backend/pkg/web/handler/source.go | 263 + backend/pkg/web/handler/summary.go | 21 + backend/pkg/web/middleware/require_auth.go | 47 + backend/pkg/web/server.go | 28 +- config.yaml | 2 +- frontend/angular.json | 6 +- frontend/src/app/app-routing.module.ts | 17 +- frontend/src/app/app.component.ts | 3 +- frontend/src/app/app.module.ts | 10 +- .../encryption-enabled.auth-guard.ts | 19 - .../app/components/header/header.component.ts | 1 - .../list-fallback-resource.component.html | 2 +- .../list-fallback-resource.component.ts | 3 +- .../list-generic-resource.component.ts | 7 +- .../resource-list/resource-list.component.ts | 21 +- .../src/app/models/fasten/resource_fhir.ts | 48 + .../models/fasten/source-summary.ts | 4 +- frontend/src/app/models/fasten/source.ts | 18 + .../src/{lib => app}/models/fasten/summary.ts | 4 +- .../src/{lib => app}/models/fasten/user.ts | 1 + .../lighthouse/lighthouse-source-metadata.ts | 0 .../app/models/queue/source-sync-message.ts | 2 +- .../auth-signin/auth-signin.component.ts | 10 +- .../auth-signup/auth-signup.component.ts | 3 +- .../pages/dashboard/dashboard.component.html | 2 +- .../pages/dashboard/dashboard.component.ts | 15 +- .../encryption-manager.component.html | 151 - .../encryption-manager.component.spec.ts | 26 - .../encryption-manager.component.ts | 198 - .../medical-history.component.html | 124 + .../medical-history.component.scss} | 0 .../medical-history.component.spec.ts | 23 + .../medical-history.component.ts | 15 + .../medical-sources.component.html | 2 +- .../medical-sources.component.ts | 132 +- .../patient-profile.component.html | 191 + .../patient-profile.component.scss | 0 .../patient-profile.component.spec.ts | 23 + .../patient-profile.component.ts | 15 + .../app/pages/patient/patient.component.html | 186 - .../app/pages/patient/patient.component.ts | 11 - .../resource-detail.component.ts | 26 +- .../source-detail.component.html | 2 +- .../source-detail/source-detail.component.ts | 12 +- .../app/services/auth-interceptor.service.ts | 72 +- frontend/src/app/services/auth.service.ts | 46 +- ...ice.spec.ts => fasten-api.service.spec.ts} | 8 +- .../src/app/services/fasten-api.service.ts | 131 + .../src/app/services/fasten-db.service.ts | 147 - .../src/app/services/lighthouse.service.ts | 2 +- .../src/app/workers/queue.service.spec.ts | 19 - frontend/src/app/workers/queue.service.ts | 45 - .../src/app/workers/source-sync.worker.ts | 71 - frontend/src/lib/conduit/factory.ts | 84 - frontend/src/lib/conduit/fhir/aetna_client.ts | 25 - .../lib/conduit/fhir/base/base_client.spec.ts | 75 - .../src/lib/conduit/fhir/base/base_client.ts | 153 - .../fhir/base/fhir401_r4_client.spec.ts | 119 - .../conduit/fhir/base/fhir401_r4_client.ts | 594 - .../fixtures/BaseClient_GetFhirVersion.json | 1990 -- .../base/fixtures/BaseClient_GetRequest.json | 159 - ...HIR401Client_ExtractResourceReference.json | 41 - .../fixtures/FHIR401Client_ProcessBundle.json | 16695 ---------------- .../src/lib/conduit/fhir/bluebutton_client.ts | 26 - frontend/src/lib/conduit/fhir/cigna_client.ts | 11 - .../fhir/platforms/careevolution_client.ts | 13 - .../conduit/fhir/platforms/cerner_client.ts | 41 - .../lib/conduit/fhir/platforms/epic_client.ts | 39 - .../lib/conduit/fhir/sandbox/athena_client.ts | 23 - .../conduit/fhir/sandbox/healthit_client.ts | 39 - .../lib/conduit/fhir/sandbox/logica_client.ts | 11 - frontend/src/lib/conduit/interface.ts | 58 - frontend/src/lib/database/constants.ts | 4 - frontend/src/lib/database/interface.ts | 49 - frontend/src/lib/database/plugins/crypto.ts | 159 - frontend/src/lib/database/plugins/upsert.ts | 101 - .../lib/database/pouchdb_repository.spec.ts | 101 - .../src/lib/database/pouchdb_repository.ts | 465 - .../src/lib/models/client/client-config.ts | 6 - .../src/lib/models/database/resource_fhir.ts | 36 - frontend/src/lib/models/database/source.ts | 32 - .../src/lib/models/database/source_types.ts | 50 - .../src/lib/models/fasten/upsert-summary.ts | 8 - .../models/lighthouse/authorize-claim.spec.ts | 7 - .../lib/models/lighthouse/authorize-claim.ts | 12 - frontend/src/lib/utils/base64.ts | 8 +- frontend/tsconfig.worker.json | 18 - go.mod | 41 +- go.sum | 278 +- 107 files changed, 2235 insertions(+), 22602 deletions(-) create mode 100644 TODO.md create mode 100644 backend/pkg/auth/jwt_utils.go create mode 100644 backend/pkg/auth/user_registered_claims.go delete mode 100644 backend/pkg/database/couchdb_repository.go create mode 100644 backend/pkg/database/sqlite_repository.go create mode 100644 backend/pkg/models/base.go create mode 100644 backend/pkg/models/resource_fhir.go create mode 100644 backend/pkg/models/source_credential.go create mode 100644 backend/pkg/models/source_summary.go create mode 100644 backend/pkg/models/summary.go delete mode 100644 backend/pkg/web/handler/couchdb_proxy.go create mode 100644 backend/pkg/web/handler/resource_fhir.go create mode 100644 backend/pkg/web/handler/source.go create mode 100644 backend/pkg/web/handler/summary.go create mode 100644 backend/pkg/web/middleware/require_auth.go delete mode 100644 frontend/src/app/auth-guards/encryption-enabled.auth-guard.ts create mode 100644 frontend/src/app/models/fasten/resource_fhir.ts rename frontend/src/{lib => app}/models/fasten/source-summary.ts (68%) create mode 100644 frontend/src/app/models/fasten/source.ts rename frontend/src/{lib => app}/models/fasten/summary.ts (63%) rename frontend/src/{lib => app}/models/fasten/user.ts (81%) rename frontend/src/{lib => app}/models/lighthouse/lighthouse-source-metadata.ts (100%) delete mode 100644 frontend/src/app/pages/encryption-manager/encryption-manager.component.html delete mode 100644 frontend/src/app/pages/encryption-manager/encryption-manager.component.spec.ts delete mode 100644 frontend/src/app/pages/encryption-manager/encryption-manager.component.ts create mode 100644 frontend/src/app/pages/medical-history/medical-history.component.html rename frontend/src/app/pages/{encryption-manager/encryption-manager.component.scss => medical-history/medical-history.component.scss} (100%) create mode 100644 frontend/src/app/pages/medical-history/medical-history.component.spec.ts create mode 100644 frontend/src/app/pages/medical-history/medical-history.component.ts create mode 100644 frontend/src/app/pages/patient-profile/patient-profile.component.html create mode 100644 frontend/src/app/pages/patient-profile/patient-profile.component.scss create mode 100644 frontend/src/app/pages/patient-profile/patient-profile.component.spec.ts create mode 100644 frontend/src/app/pages/patient-profile/patient-profile.component.ts delete mode 100644 frontend/src/app/pages/patient/patient.component.html delete mode 100644 frontend/src/app/pages/patient/patient.component.ts rename frontend/src/app/services/{fasten-db.service.spec.ts => fasten-api.service.spec.ts} (64%) create mode 100644 frontend/src/app/services/fasten-api.service.ts delete mode 100644 frontend/src/app/services/fasten-db.service.ts delete mode 100644 frontend/src/app/workers/queue.service.spec.ts delete mode 100644 frontend/src/app/workers/queue.service.ts delete mode 100644 frontend/src/app/workers/source-sync.worker.ts delete mode 100644 frontend/src/lib/conduit/factory.ts delete mode 100644 frontend/src/lib/conduit/fhir/aetna_client.ts delete mode 100644 frontend/src/lib/conduit/fhir/base/base_client.spec.ts delete mode 100644 frontend/src/lib/conduit/fhir/base/base_client.ts delete mode 100644 frontend/src/lib/conduit/fhir/base/fhir401_r4_client.spec.ts delete mode 100644 frontend/src/lib/conduit/fhir/base/fhir401_r4_client.ts delete mode 100644 frontend/src/lib/conduit/fhir/base/fixtures/BaseClient_GetFhirVersion.json delete mode 100644 frontend/src/lib/conduit/fhir/base/fixtures/BaseClient_GetRequest.json delete mode 100644 frontend/src/lib/conduit/fhir/base/fixtures/FHIR401Client_ExtractResourceReference.json delete mode 100644 frontend/src/lib/conduit/fhir/base/fixtures/FHIR401Client_ProcessBundle.json delete mode 100644 frontend/src/lib/conduit/fhir/bluebutton_client.ts delete mode 100644 frontend/src/lib/conduit/fhir/cigna_client.ts delete mode 100644 frontend/src/lib/conduit/fhir/platforms/careevolution_client.ts delete mode 100644 frontend/src/lib/conduit/fhir/platforms/cerner_client.ts delete mode 100644 frontend/src/lib/conduit/fhir/platforms/epic_client.ts delete mode 100644 frontend/src/lib/conduit/fhir/sandbox/athena_client.ts delete mode 100644 frontend/src/lib/conduit/fhir/sandbox/healthit_client.ts delete mode 100644 frontend/src/lib/conduit/fhir/sandbox/logica_client.ts delete mode 100644 frontend/src/lib/conduit/interface.ts delete mode 100644 frontend/src/lib/database/constants.ts delete mode 100644 frontend/src/lib/database/interface.ts delete mode 100644 frontend/src/lib/database/plugins/crypto.ts delete mode 100644 frontend/src/lib/database/plugins/upsert.ts delete mode 100644 frontend/src/lib/database/pouchdb_repository.spec.ts delete mode 100644 frontend/src/lib/database/pouchdb_repository.ts delete mode 100644 frontend/src/lib/models/client/client-config.ts delete mode 100644 frontend/src/lib/models/database/resource_fhir.ts delete mode 100644 frontend/src/lib/models/database/source.ts delete mode 100644 frontend/src/lib/models/database/source_types.ts delete mode 100644 frontend/src/lib/models/fasten/upsert-summary.ts delete mode 100644 frontend/src/lib/models/lighthouse/authorize-claim.spec.ts delete mode 100644 frontend/src/lib/models/lighthouse/authorize-claim.ts delete mode 100644 frontend/tsconfig.worker.json diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7f342df8..67edae76 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,7 +13,6 @@ Fasten is made up of a handful of different components. Here's a summary of the **Backend** - Go `v1.18.3` -- CouchDB `v3.2` **Misc** - Docker `v20.10.17` @@ -65,6 +64,8 @@ web: src: frontend: path: ./dist +database: + location: 'fasten.db' log: file: '' #absolute or relative paths allowed, eg. web.log level: INFO @@ -79,10 +80,6 @@ cd frontend npm run dist -- -c sandbox # In terminal #2, run the following -docker build -t fasten-couchdb -f docker/couchdb/Dockerfile . -docker run --rm -it -p 5984:5984 -v `pwd`/.couchdb/data:/opt/couchdb/data -v `pwd`/.couchdb/config:/opt/couchdb/etc/local.d fasten-couchdb - -# In terminal #3, run the following go mod vendor go run backend/cmd/fasten/fasten.go start --config ./config.dev.yaml --debug @@ -95,13 +92,8 @@ Now you can open a browser to `http://localhost:9090` to see the Fasten UI. The following URL's and credentials may be helpful as you're developing - http://localhost:9090/web/dashboard - WebUI -- http://localhost:9090/database - CouchDB API proxy -- http://localhost:5984/_utils/ - CouchDB admin UI ### Credentials -- Couchdb: - - username: `admin` - - password: `mysecretpassword` - WebUI: - username: `testuser` - password: `testuser` diff --git a/TODO.md b/TODO.md new file mode 100644 index 00000000..87eb65aa --- /dev/null +++ b/TODO.md @@ -0,0 +1,5 @@ + +- [x] pagination +- [x] references/links +- [x] manual sync +- fix sources where refresh token is missing (panics) diff --git a/backend/pkg/auth/jwt_utils.go b/backend/pkg/auth/jwt_utils.go new file mode 100644 index 00000000..9e05f2e9 --- /dev/null +++ b/backend/pkg/auth/jwt_utils.go @@ -0,0 +1,60 @@ +package auth + +import ( + "errors" + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/models" + "github.com/golang-jwt/jwt/v4" + "log" + "time" +) + +func JwtGenerateFastenTokenFromUser(user models.User, issuerSigningKey string) (string, error) { + log.Printf("ISSUER KEY: " + issuerSigningKey) + userClaims := UserRegisteredClaims{ + FullName: user.FullName, + UserId: user.ID.String(), + RegisteredClaims: jwt.RegisteredClaims{ + // In JWT, the expiry time is expressed as unix milliseconds + ExpiresAt: jwt.NewNumericDate(time.Now().Add(1 * time.Hour)), + IssuedAt: jwt.NewNumericDate(time.Now()), + Issuer: "docker-fastenhealth", + Subject: user.Username, + }, + } + + //FASTEN_JWT_ISSUER_KEY + token := jwt.NewWithClaims(jwt.SigningMethodHS256, userClaims) + //token.Header["kid"] = "docker" + tokenString, err := token.SignedString([]byte(issuerSigningKey)) + + if err != nil { + return "", err + } + return tokenString, nil +} + +func JwtValidateFastenToken(encryptionKey string, signedToken string) (*UserRegisteredClaims, error) { + token, err := jwt.ParseWithClaims( + signedToken, + &UserRegisteredClaims{}, + func(token *jwt.Token) (interface{}, error) { + if jwt.SigningMethodHS256 != token.Method { + return nil, errors.New("Invalid signing algorithm") + } + return []byte(encryptionKey), nil + }, + ) + if err != nil { + return nil, err + } + claims, ok := token.Claims.(*UserRegisteredClaims) + if !ok { + err = errors.New("couldn't parse claims") + return nil, err + } + if claims.ExpiresAt.Unix() < time.Now().Local().Unix() { + err = errors.New("token expired") + return nil, err + } + return claims, nil +} diff --git a/backend/pkg/auth/user_registered_claims.go b/backend/pkg/auth/user_registered_claims.go new file mode 100644 index 00000000..36578a62 --- /dev/null +++ b/backend/pkg/auth/user_registered_claims.go @@ -0,0 +1,9 @@ +package auth + +import "github.com/golang-jwt/jwt/v4" + +type UserRegisteredClaims struct { + FullName string `json:"full_name"` + UserId string `json:"user_id"` + jwt.RegisteredClaims +} diff --git a/backend/pkg/config/config.go b/backend/pkg/config/config.go index 975bc749..5a270ae7 100644 --- a/backend/pkg/config/config.go +++ b/backend/pkg/config/config.go @@ -26,11 +26,7 @@ func (c *configuration) Init() error { c.SetDefault("web.listen.basepath", "") c.SetDefault("web.src.frontend.path", "/opt/fasten/web") - c.SetDefault("couchdb.scheme", "http") - c.SetDefault("couchdb.host", "localhost") - c.SetDefault("couchdb.port", "5984") - c.SetDefault("couchdb.admin.username", "admin") - c.SetDefault("couchdb.admin.password", "mysecretpassword") + c.SetDefault("database.location", "/opt/fasten/db/fasten.db") //TODO: should be /opt/fasten/fasten.db c.SetDefault("jwt.issuer.key", "thisismysupersecuressessionsecretlength") diff --git a/backend/pkg/database/couchdb_repository.go b/backend/pkg/database/couchdb_repository.go deleted file mode 100644 index 674d5c47..00000000 --- a/backend/pkg/database/couchdb_repository.go +++ /dev/null @@ -1,122 +0,0 @@ -package database - -import ( - "context" - "fmt" - "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/config" - "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/models" - "github.com/go-kivik/couchdb/v3" - _ "github.com/go-kivik/couchdb/v3" // The CouchDB driver - "github.com/go-kivik/kivik/v3" - "github.com/sirupsen/logrus" - "log" -) - -func NewRepository(appConfig config.Interface, globalLogger logrus.FieldLogger) (DatabaseRepository, error) { - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Couchdb setup - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - couchdbUrl := fmt.Sprintf("%s://%s:%s", appConfig.GetString("couchdb.scheme"), appConfig.GetString("couchdb.host"), appConfig.GetString("couchdb.port")) - - globalLogger.Infof("Trying to connect to couchdb: %s\n", couchdbUrl) - - database, err := kivik.New("couch", couchdbUrl) - if err != nil { - return nil, fmt.Errorf("Failed to connect to database! - %v", err) - } - - err = database.Authenticate(context.Background(), - couchdb.BasicAuth( - appConfig.GetString("couchdb.admin.username"), - appConfig.GetString("couchdb.admin.password")), - ) - - if err != nil { - return nil, fmt.Errorf("Failed to authenticate to database! - %v", err) - } - globalLogger.Infof("Successfully connected to couchdb: %s\n", couchdbUrl) - - deviceRepo := couchdbRepository{ - appConfig: appConfig, - logger: globalLogger, - client: database, - } - return &deviceRepo, nil -} - -type couchdbRepository struct { - appConfig config.Interface - logger logrus.FieldLogger - - client *kivik.Client -} - -type couchDbUser struct { - ID string `json:"_id"` - Name string `json:"name"` - Type string `json:"type"` - Roles []string `json:"roles"` - Password string `json:"password"` - - FullName string `json:"full_name"` -} - -func (cr *couchdbRepository) CreateUser(ctx context.Context, user *models.User) error { - - newUser := &couchDbUser{ - ID: fmt.Sprintf("%s%s", kivik.UserPrefix, user.Username), - Name: user.Username, - Type: "user", - Roles: []string{}, - Password: user.Password, - - FullName: user.FullName, - } - db := cr.client.DB(ctx, "_users") - _, err := db.Put(ctx, newUser.ID, newUser) - if err != nil { - return err - } - - //TODO: we should create an index for this database now - //db.CreateIndex(ctx, ) - return err -} - -func (cr *couchdbRepository) VerifyUser(ctx context.Context, user *models.User) error { - - couchdbUrl := fmt.Sprintf("%s://%s:%s", cr.appConfig.GetString("couchdb.scheme"), cr.appConfig.GetString("couchdb.host"), cr.appConfig.GetString("couchdb.port")) - - userDatabase, err := kivik.New("couch", couchdbUrl) - if err != nil { - return fmt.Errorf("Failed to connect to database! - %v", err) - } - - err = userDatabase.Authenticate(context.Background(), - couchdb.BasicAuth(user.Username, user.Password), - ) - session, err := userDatabase.Session(context.Background()) - if err != nil { - return err - } - log.Printf("SESSION INFO: %v", session) - //TODO: return session info - - //lookup the user in the user database using admin creds - adminDb := cr.client.DB(ctx, "_users") - userRow := adminDb.Get(ctx, kivik.UserPrefix+session.Name) - userDoc := map[string]interface{}{} - err = userRow.ScanDoc(&userDoc) - if err != nil { - return err - } - - if userFullName, hasUserFullName := userDoc["full_name"]; hasUserFullName { - user.FullName = userFullName.(string) - } - return nil -} - -func (cr *couchdbRepository) Close() error { - return nil -} diff --git a/backend/pkg/database/interface.go b/backend/pkg/database/interface.go index 6c288122..b99504ab 100644 --- a/backend/pkg/database/interface.go +++ b/backend/pkg/database/interface.go @@ -2,6 +2,7 @@ package database import ( "context" + sourcePkg "github.com/fastenhealth/fasten-sources/clients/models" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/models" ) @@ -10,5 +11,24 @@ type DatabaseRepository interface { Close() error CreateUser(context.Context, *models.User) error - VerifyUser(context.Context, *models.User) error + + GetUserByEmail(context.Context, string) (*models.User, error) + GetCurrentUser(context.Context) *models.User + + GetSummary(ctx context.Context) (*models.Summary, error) + + GetResourceBySourceType(context.Context, string, string) (*models.ResourceFhir, error) + GetResourceBySourceId(context.Context, string, string) (*models.ResourceFhir, error) + ListResources(context.Context, models.ListResourceQueryOptions) ([]models.ResourceFhir, error) + GetPatientForSources(ctx context.Context) ([]models.ResourceFhir, error) + //UpsertProfile(context.Context, *models.Profile) error + //UpsertOrganziation(context.Context, *models.Organization) error + + CreateSource(context.Context, *models.SourceCredential) error + GetSource(context.Context, string) (*models.SourceCredential, error) + GetSourceSummary(context.Context, string) (*models.SourceSummary, error) + GetSources(context.Context) ([]models.SourceCredential, error) + + //used by Client + UpsertRawResource(ctx context.Context, sourceCredentials sourcePkg.SourceCredential, rawResource sourcePkg.RawResourceFhir) (bool, error) } diff --git a/backend/pkg/database/mock/mock_database.go b/backend/pkg/database/mock/mock_database.go index e6c760b3..b3b921fb 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. -// Source: interface.go +// SourceCredential: interface.go // Package mock_database is a generated GoMock package. package mock_database diff --git a/backend/pkg/database/sqlite_repository.go b/backend/pkg/database/sqlite_repository.go new file mode 100644 index 00000000..296abb31 --- /dev/null +++ b/backend/pkg/database/sqlite_repository.go @@ -0,0 +1,442 @@ +package database + +import ( + "context" + "encoding/json" + "fmt" + sourceModel "github.com/fastenhealth/fasten-sources/clients/models" + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/config" + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/models" + "github.com/gin-gonic/gin" + "github.com/glebarez/sqlite" + "github.com/google/uuid" + "github.com/sirupsen/logrus" + "gorm.io/datatypes" + "gorm.io/gorm" + "net/url" + "strings" +) + +func NewRepository(appConfig config.Interface, globalLogger logrus.FieldLogger) (DatabaseRepository, error) { + //backgroundContext := context.Background() + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Gorm/SQLite setup + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + globalLogger.Infof("Trying to connect to sqlite db: %s\n", appConfig.GetString("database.location")) + + // When a transaction cannot lock the database, because it is already locked by another one, + // SQLite by default throws an error: database is locked. This behavior is usually not appropriate when + // concurrent access is needed, typically when multiple processes write to the same database. + // PRAGMA busy_timeout lets you set a timeout or a handler for these events. When setting a timeout, + // SQLite will try the transaction multiple times within this timeout. + // fixes #341 + // https://rsqlite.r-dbi.org/reference/sqlitesetbusyhandler + // retrying for 30000 milliseconds, 30seconds - this would be unreasonable for a distributed multi-tenant application, + // but should be fine for local usage. + pragmaStr := sqlitePragmaString(map[string]string{ + "busy_timeout": "30000", + "foreign_keys": "ON", + }) + database, err := gorm.Open(sqlite.Open(appConfig.GetString("database.location")+pragmaStr), &gorm.Config{ + //TODO: figure out how to log database queries again. + //Logger: logger + DisableForeignKeyConstraintWhenMigrating: true, + }) + + if strings.ToUpper(appConfig.GetString("log.level")) == "DEBUG" { + database = database.Debug() //set debug globally + } + + if err != nil { + return nil, fmt.Errorf("Failed to connect to database! - %v", err) + } + globalLogger.Infof("Successfully connected to fasten sqlite db: %s\n", appConfig.GetString("database.location")) + + //TODO: automigrate for now + err = database.AutoMigrate( + &models.User{}, + &models.SourceCredential{}, + &models.ResourceFhir{}, + ) + if err != nil { + return nil, fmt.Errorf("Failed to automigrate! - %v", err) + } + + // create/update admin user + adminUser := models.User{} + err = database.FirstOrCreate(&adminUser, models.User{Username: "admin"}).Error + if err != nil { + return nil, fmt.Errorf("Failed to create admin user! - %v", err) + } + + deviceRepo := sqliteRepository{ + appConfig: appConfig, + logger: globalLogger, + gormClient: database, + } + return &deviceRepo, nil +} + +type sqliteRepository struct { + appConfig config.Interface + logger logrus.FieldLogger + + gormClient *gorm.DB +} + +func (sr *sqliteRepository) Close() error { + return nil +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// User +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +func (sr *sqliteRepository) CreateUser(ctx context.Context, user *models.User) error { + if err := user.HashPassword(user.Password); err != nil { + return err + } + record := sr.gormClient.Create(user) + if record.Error != nil { + return record.Error + } + return nil +} +func (sr *sqliteRepository) GetUserByEmail(ctx context.Context, username string) (*models.User, error) { + var foundUser models.User + result := sr.gormClient.Where(models.User{Username: username}).First(&foundUser) + return &foundUser, result.Error +} + +func (sr *sqliteRepository) GetCurrentUser(ctx context.Context) *models.User { + ginCtx := ctx.(*gin.Context) + var currentUser models.User + sr.gormClient.First(¤tUser, models.User{Username: ginCtx.MustGet("AUTH_USERNAME").(string)}) + + return ¤tUser +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// User +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +func (sr *sqliteRepository) GetSummary(ctx context.Context) (*models.Summary, error) { + + // we want a count of all resources for this user by type + var resourceCountResults []map[string]interface{} + + //group by resource type and return counts + // SELECT source_resource_type as resource_type, COUNT(*) as count FROM resource_fhirs WHERE source_id = "53c1e930-63af-46c9-b760-8e83cbc1abd9" GROUP BY source_resource_type; + result := sr.gormClient.WithContext(ctx). + Model(models.ResourceFhir{}). + Select("source_id, source_resource_type as resource_type, count(*) as count"). + Group("source_resource_type"). + Where(models.OriginBase{ + UserID: sr.GetCurrentUser(ctx).ID, + }). + Scan(&resourceCountResults) + if result.Error != nil { + return nil, result.Error + } + + // we want a list of all sources (when they were last updated) + sources, err := sr.GetSources(ctx) + if err != nil { + return nil, err + } + + // we want the main Patient for each source + patients, err := sr.GetPatientForSources(ctx) + if err != nil { + return nil, err + } + + if resourceCountResults == nil { + resourceCountResults = []map[string]interface{}{} + } + summary := &models.Summary{ + Sources: sources, + ResourceTypeCounts: resourceCountResults, + Patients: patients, + } + + return summary, nil +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Resource +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +func (sr *sqliteRepository) UpsertRawResource(ctx context.Context, sourceCredential sourceModel.SourceCredential, rawResource sourceModel.RawResourceFhir) (bool, error) { + + source := sourceCredential.(models.SourceCredential) + + wrappedResourceModel := &models.ResourceFhir{ + OriginBase: models.OriginBase{ + ModelBase: models.ModelBase{}, + UserID: source.UserID, + SourceID: source.ID, + SourceResourceID: rawResource.SourceResourceID, + SourceResourceType: rawResource.SourceResourceType, + }, + ResourceRaw: datatypes.JSON(rawResource.ResourceRaw), + } + + sr.logger.Infof("insert/update (%v) %v", rawResource.SourceResourceType, rawResource.SourceResourceID) + + createResult := sr.gormClient.WithContext(ctx).Where(models.OriginBase{ + SourceID: wrappedResourceModel.GetSourceID(), + SourceResourceID: wrappedResourceModel.GetSourceResourceID(), + SourceResourceType: wrappedResourceModel.GetSourceResourceType(), //TODO: and UpdatedAt > old UpdatedAt + }).FirstOrCreate(wrappedResourceModel) + + if createResult.Error != nil { + return false, createResult.Error + } 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) { + updateResult := createResult.Updates(wrappedResourceModel) + return updateResult.RowsAffected > 0, updateResult.Error + } else { + return false, nil + } + + } else { + //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) { + + queryParam := models.ResourceFhir{ + OriginBase: models.OriginBase{ + UserID: sr.GetCurrentUser(ctx).ID, + }, + } + + if len(queryOptions.SourceResourceType) > 0 { + queryParam.OriginBase.SourceResourceType = queryOptions.SourceResourceType + } + + if len(queryOptions.SourceID) > 0 { + sourceUUID, err := uuid.Parse(queryOptions.SourceID) + if err != nil { + return nil, err + } + + queryParam.OriginBase.SourceID = sourceUUID + } + + manifestJson, _ := json.MarshalIndent(queryParam, "", " ") + sr.logger.Infof("THE QUERY OBJECT===========> %v", string(manifestJson)) + + var wrappedResourceModels []models.ResourceFhir + results := sr.gormClient.WithContext(ctx). + Where(queryParam). + Find(&wrappedResourceModels) + + return wrappedResourceModels, results.Error +} + +func (sr *sqliteRepository) GetResourceBySourceType(ctx context.Context, sourceResourceType string, sourceResourceId string) (*models.ResourceFhir, error) { + queryParam := models.ResourceFhir{ + OriginBase: models.OriginBase{ + UserID: sr.GetCurrentUser(ctx).ID, + SourceResourceType: sourceResourceType, + SourceResourceID: sourceResourceId, + }, + } + + var wrappedResourceModel models.ResourceFhir + results := sr.gormClient.WithContext(ctx). + Where(queryParam). + First(&wrappedResourceModel) + + return &wrappedResourceModel, results.Error +} + +func (sr *sqliteRepository) GetResourceBySourceId(ctx context.Context, sourceId string, sourceResourceId string) (*models.ResourceFhir, error) { + sourceIdUUID, err := uuid.Parse(sourceId) + if err != nil { + return nil, err + } + + queryParam := models.ResourceFhir{ + OriginBase: models.OriginBase{ + UserID: sr.GetCurrentUser(ctx).ID, + SourceID: sourceIdUUID, + SourceResourceID: sourceResourceId, + }, + } + + var wrappedResourceModel models.ResourceFhir + results := sr.gormClient.WithContext(ctx). + Where(queryParam). + First(&wrappedResourceModel) + + return &wrappedResourceModel, results.Error +} + +// Get the patient for each source (for the current user) +func (sr *sqliteRepository) GetPatientForSources(ctx context.Context) ([]models.ResourceFhir, error) { + + //SELECT * FROM resource_fhirs WHERE user_id = "" and source_resource_type = "Patient" GROUP BY source_id + + //var sourceCred models.SourceCredential + //results := sr.gormClient.WithContext(ctx). + // Where(models.SourceCredential{UserID: sr.GetCurrentUser(ctx).ID, ModelBase: models.ModelBase{ID: sourceUUID}}). + // First(&sourceCred) + + var wrappedResourceModels []models.ResourceFhir + results := sr.gormClient.WithContext(ctx). + Model(models.ResourceFhir{}). + Group("source_id"). + Where(models.OriginBase{ + UserID: sr.GetCurrentUser(ctx).ID, + SourceResourceType: "Patient", + }). + Find(&wrappedResourceModels) + + return wrappedResourceModels, results.Error +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// SourceCredential +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +func (sr *sqliteRepository) CreateSource(ctx context.Context, sourceCreds *models.SourceCredential) error { + sourceCreds.UserID = sr.GetCurrentUser(ctx).ID + + //Assign will **always** update the source credential in the DB with data passed into this function. + return sr.gormClient.WithContext(ctx). + Where(models.SourceCredential{ + UserID: sourceCreds.UserID, + SourceType: sourceCreds.SourceType, + Patient: sourceCreds.Patient}). + Assign(*sourceCreds).FirstOrCreate(sourceCreds).Error +} + +func (sr *sqliteRepository) GetSource(ctx context.Context, sourceId string) (*models.SourceCredential, error) { + sourceUUID, err := uuid.Parse(sourceId) + if err != nil { + return nil, err + } + + var sourceCred models.SourceCredential + results := sr.gormClient.WithContext(ctx). + Where(models.SourceCredential{UserID: sr.GetCurrentUser(ctx).ID, ModelBase: models.ModelBase{ID: sourceUUID}}). + First(&sourceCred) + + return &sourceCred, results.Error +} + +func (sr *sqliteRepository) GetSourceSummary(ctx context.Context, sourceId string) (*models.SourceSummary, error) { + sourceUUID, err := uuid.Parse(sourceId) + if err != nil { + return nil, err + } + + sourceSummary := &models.SourceSummary{} + + source, err := sr.GetSource(ctx, sourceId) + if err != nil { + return nil, err + } + sourceSummary.Source = source + + //group by resource type and return counts + // SELECT source_resource_type as resource_type, COUNT(*) as count FROM resource_fhirs WHERE source_id = "53c1e930-63af-46c9-b760-8e83cbc1abd9" GROUP BY source_resource_type; + + var resourceTypeCounts []map[string]interface{} + + result := sr.gormClient.WithContext(ctx). + Model(models.ResourceFhir{}). + Select("source_id, source_resource_type as resource_type, count(*) as count"). + Group("source_resource_type"). + Where(models.OriginBase{ + UserID: sr.GetCurrentUser(ctx).ID, + SourceID: sourceUUID, + }). + Scan(&resourceTypeCounts) + + if result.Error != nil { + return nil, result.Error + } + + sourceSummary.ResourceTypeCounts = resourceTypeCounts + + //set patient + var wrappedPatientResourceModel models.ResourceFhir + results := sr.gormClient.WithContext(ctx). + Where(models.OriginBase{ + UserID: sr.GetCurrentUser(ctx).ID, + SourceResourceType: "Patient", + SourceID: sourceUUID, + }). + First(&wrappedPatientResourceModel) + + if results.Error != nil { + return nil, result.Error + } + sourceSummary.Patient = &wrappedPatientResourceModel + + return sourceSummary, nil +} + +func (sr *sqliteRepository) GetSources(ctx context.Context) ([]models.SourceCredential, error) { + + var sourceCreds []models.SourceCredential + results := sr.gormClient.WithContext(ctx). + Where(models.SourceCredential{UserID: sr.GetCurrentUser(ctx).ID}). + Find(&sourceCreds) + + return sourceCreds, results.Error +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Utilities +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +func sqlitePragmaString(pragmas map[string]string) string { + q := url.Values{} + for key, val := range pragmas { + q.Add("_pragma", key+"="+val) + } + + queryStr := q.Encode() + if len(queryStr) > 0 { + return "?" + queryStr + } + return "" +} diff --git a/backend/pkg/models/base.go b/backend/pkg/models/base.go new file mode 100644 index 00000000..d7465c60 --- /dev/null +++ b/backend/pkg/models/base.go @@ -0,0 +1,50 @@ +package models + +import ( + "github.com/google/uuid" + "gorm.io/gorm" + "time" +) + +type ModelBase struct { + ID uuid.UUID `json:"id" gorm:"type:uuid;primary_key;"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + DeletedAt *time.Time `json:"deleted_at,omitempty" gorm:"index"` +} + +//https://medium.com/@the.hasham.ali/how-to-use-uuid-key-type-with-gorm-cc00d4ec7100 + +func (base *ModelBase) BeforeCreate(tx *gorm.DB) error { + base.ID = uuid.New() + return nil +} + +type OriginBase struct { + ModelBase + User *User `json:"user,omitempty" gorm:"-"` + UserID uuid.UUID `json:"user_id"` + + Source *SourceCredential `json:"source,omitempty" gorm:"-"` + SourceID uuid.UUID `json:"source_id" gorm:"not null;index:,unique,composite:source_resource_id"` + + SourceResourceType string `json:"source_resource_type" gorm:"not null;index:,unique,composite:source_resource_id"` + SourceResourceID string `json:"source_resource_id" gorm:"not null;index:,unique,composite:source_resource_id"` +} + +func (o OriginBase) GetSourceID() uuid.UUID { + return o.SourceID +} + +func (o OriginBase) GetSourceResourceType() string { + return o.SourceResourceType +} +func (o OriginBase) GetSourceResourceID() string { + return o.SourceResourceID +} + +type OriginBaser interface { + GetSourceID() uuid.UUID + GetSourceResourceType() string + GetSourceResourceID() string +} diff --git a/backend/pkg/models/resource_fhir.go b/backend/pkg/models/resource_fhir.go new file mode 100644 index 00000000..02ba3936 --- /dev/null +++ b/backend/pkg/models/resource_fhir.go @@ -0,0 +1,17 @@ +package models + +import ( + "gorm.io/datatypes" +) + +type ResourceFhir struct { + OriginBase + + //embedded data + ResourceRaw datatypes.JSON `json:"resource_raw" gorm:"resource_raw"` +} + +type ListResourceQueryOptions struct { + SourceID string + SourceResourceType string +} diff --git a/backend/pkg/models/source_credential.go b/backend/pkg/models/source_credential.go new file mode 100644 index 00000000..e675c10d --- /dev/null +++ b/backend/pkg/models/source_credential.go @@ -0,0 +1,109 @@ +package models + +import ( + "github.com/fastenhealth/fasten-sources/pkg" + "github.com/google/uuid" +) + +// SourceCredential Data/Medical Provider Credentials +// similar to LighthouseSourceDefinition from fasten-source +type SourceCredential struct { + ModelBase + User User `json:"user,omitempty"` + UserID uuid.UUID `json:"user_id" gorm:"uniqueIndex:idx_user_source_patient"` + SourceType pkg.SourceType `json:"source_type" gorm:"uniqueIndex:idx_user_source_patient"` + Patient string `json:"patient" gorm:"uniqueIndex:idx_user_source_patient"` + + //oauth endpoints + AuthorizationEndpoint string `json:"authorization_endpoint"` + TokenEndpoint string `json:"token_endpoint"` + IntrospectionEndpoint string `json:"introspection_endpoint"` + + Scopes []string `json:"scopes_supported" gorm:"type:text;serializer:json"` + Issuer string `json:"issuer"` + GrantTypesSupported []string `json:"grant_types_supported" gorm:"type:text;serializer:json"` + ResponseType []string `json:"response_types_supported" gorm:"type:text;serializer:json"` + ResponseModesSupported []string `json:"response_modes_supported" gorm:"type:text;serializer:json"` + Audience string `json:"aud"` //optional - required for some providers + CodeChallengeMethodsSupported []string `json:"code_challenge_methods_supported" gorm:"type:text;serializer:json"` + + //Fasten custom configuration + UserInfoEndpoint string `json:"userinfo_endpoint"` //optional - supported by some providers, not others. + ApiEndpointBaseUrl string `json:"api_endpoint_base_url"` //api endpoint we'll communicate with after authentication + ClientId string `json:"client_id"` + RedirectUri string `json:"redirect_uri"` //lighthouse url the provider will redirect to (registered with App) + + Confidential bool `json:"confidential"` //if enabled, requires client_secret to authenticate with provider (PKCE) + CORSRelayRequired bool `json:"cors_relay_required"` //if true, requires CORS proxy/relay, as provider does not return proper response to CORS preflight + //SecretKeyPrefix string `json:"-"` //the secret key prefix to use, if empty (default) will use the sourceType value + + // auth/credential data + AccessToken string `json:"access_token"` + RefreshToken string `json:"refresh_token"` + IdToken string `json:"id_token"` + ExpiresAt int64 `json:"expires_at"` + CodeChallenge string `json:"code_challenge"` + CodeVerifier string `json:"code_verifier"` +} + +func (s SourceCredential) GetSourceType() pkg.SourceType { + return s.SourceType +} + +func (s SourceCredential) GetClientId() string { + return s.ClientId +} + +func (s SourceCredential) GetPatientId() string { + return s.Patient +} + +func (s SourceCredential) GetOauthAuthorizationEndpoint() string { + return s.AuthorizationEndpoint +} + +func (s SourceCredential) GetOauthTokenEndpoint() string { + return s.TokenEndpoint +} + +func (s SourceCredential) GetApiEndpointBaseUrl() string { + return s.ApiEndpointBaseUrl +} + +func (s SourceCredential) GetRefreshToken() string { + return s.RefreshToken +} + +func (s SourceCredential) GetAccessToken() string { + return s.AccessToken +} + +func (s SourceCredential) GetExpiresAt() int64 { + return s.ExpiresAt +} + +func (s SourceCredential) RefreshTokens(accessToken string, refreshToken string, expiresAt int64) { + if accessToken != s.AccessToken { + // update the "source" credential with new data (which will need to be sent + s.AccessToken = accessToken + s.ExpiresAt = expiresAt + // Don't overwrite `RefreshToken` with an empty value + // if this was a token refreshing request. + if refreshToken != "" { + s.RefreshToken = refreshToken + } + } +} + +/* +serverUrl: connectData.message.api_endpoint_base_url, +clientId: connectData.message.client_id, +redirectUri: connectData.message.redirect_uri, +tokenUri: `${connectData.message.oauth_endpoint_base_url}/token`, +scope: connectData.message.scopes.join(' '), +tokenResponse: payload, +expiresAt: getAccessTokenExpiration(payload, new BrowserAdapter()), +codeChallenge: codeChallenge, +codeVerifier: codeVerifier + +*/ diff --git a/backend/pkg/models/source_summary.go b/backend/pkg/models/source_summary.go new file mode 100644 index 00000000..8ad0f2dd --- /dev/null +++ b/backend/pkg/models/source_summary.go @@ -0,0 +1,7 @@ +package models + +type SourceSummary struct { + Source *SourceCredential `json:"source,omitempty"` + ResourceTypeCounts []map[string]interface{} `json:"resource_type_counts,omitempty"` + Patient *ResourceFhir `json:"patient"` +} diff --git a/backend/pkg/models/summary.go b/backend/pkg/models/summary.go new file mode 100644 index 00000000..c9b0d4a1 --- /dev/null +++ b/backend/pkg/models/summary.go @@ -0,0 +1,7 @@ +package models + +type Summary struct { + Sources []SourceCredential `json:"sources"` + Patients []ResourceFhir `json:"patients"` + ResourceTypeCounts []map[string]interface{} `json:"resource_type_counts"` +} diff --git a/backend/pkg/models/user.go b/backend/pkg/models/user.go index 5b92bdec..d9d4ca4f 100644 --- a/backend/pkg/models/user.go +++ b/backend/pkg/models/user.go @@ -1,7 +1,26 @@ package models +import "golang.org/x/crypto/bcrypt" + type User struct { + ModelBase FullName string `json:"full_name"` - Username string `json:"username"` + Username string `json:"username" gorm:"unique"` Password string `json:"password"` } + +func (user *User) HashPassword(password string) error { + bytes, err := bcrypt.GenerateFromPassword([]byte(password), 14) + if err != nil { + return err + } + user.Password = string(bytes) + return nil +} +func (user *User) CheckPassword(providedPassword string) error { + err := bcrypt.CompareHashAndPassword([]byte(user.Password), []byte(providedPassword)) + if err != nil { + return err + } + return nil +} diff --git a/backend/pkg/web/handler/auth.go b/backend/pkg/web/handler/auth.go index 01568196..52e2f2f3 100644 --- a/backend/pkg/web/handler/auth.go +++ b/backend/pkg/web/handler/auth.go @@ -1,14 +1,13 @@ package handler import ( + "fmt" + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/auth" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/config" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/database" "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/models" "github.com/gin-gonic/gin" - jwt "github.com/golang-jwt/jwt/v4" - "log" "net/http" - "time" ) func AuthSignup(c *gin.Context) { @@ -27,7 +26,7 @@ func AuthSignup(c *gin.Context) { } //TODO: we can derive the encryption key and the hash'ed user from the responseData sub. For now the Sub will be the user id prepended with hello. - userFastenToken, err := jwtGenerateFastenTokenFromUser(user, appConfig.GetString("jwt.issuer.key")) + userFastenToken, err := auth.JwtGenerateFastenTokenFromUser(user, appConfig.GetString("jwt.issuer.key")) c.JSON(http.StatusOK, gin.H{"success": true, "data": userFastenToken}) } @@ -41,43 +40,21 @@ func AuthSignin(c *gin.Context) { c.JSON(http.StatusInternalServerError, gin.H{"success": false, "error": err.Error()}) return } - err := databaseRepo.VerifyUser(c, &user) + + foundUser, err := databaseRepo.GetUserByEmail(c, user.Username) + if err != nil || foundUser == nil { + c.JSON(http.StatusInternalServerError, gin.H{"success": false, "error": fmt.Sprintf("could not find user: %s", user.Username)}) + return + } + + err = foundUser.CheckPassword(user.Password) if err != nil { - c.JSON(http.StatusInternalServerError, gin.H{"success": false, "error": err.Error()}) + c.JSON(http.StatusUnauthorized, gin.H{"success": false, "error": fmt.Sprintf("username or password does not match: %s", user.Username)}) return } //TODO: we can derive the encryption key and the hash'ed user from the responseData sub. For now the Sub will be the user id prepended with hello. - userFastenToken, err := jwtGenerateFastenTokenFromUser(user, appConfig.GetString("jwt.issuer.key")) + userFastenToken, err := auth.JwtGenerateFastenTokenFromUser(user, appConfig.GetString("jwt.issuer.key")) c.JSON(http.StatusOK, gin.H{"success": true, "data": userFastenToken}) } - -type UserRegisteredClaims struct { - FullName string `json:"full_name"` - jwt.RegisteredClaims -} - -func jwtGenerateFastenTokenFromUser(user models.User, issuerSigningKey string) (string, error) { - log.Printf("ISSUER KEY: " + issuerSigningKey) - userClaims := UserRegisteredClaims{ - FullName: user.FullName, - RegisteredClaims: jwt.RegisteredClaims{ - // In JWT, the expiry time is expressed as unix milliseconds - ExpiresAt: jwt.NewNumericDate(time.Now().Add(1 * time.Hour)), - IssuedAt: jwt.NewNumericDate(time.Now()), - Issuer: "docker-fastenhealth", - Subject: user.Username, - }, - } - - //FASTEN_JWT_ISSUER_KEY - token := jwt.NewWithClaims(jwt.SigningMethodHS256, userClaims) - //token.Header["kid"] = "docker" - tokenString, err := token.SignedString([]byte(issuerSigningKey)) - - if err != nil { - return "", err - } - return tokenString, nil -} diff --git a/backend/pkg/web/handler/couchdb_proxy.go b/backend/pkg/web/handler/couchdb_proxy.go deleted file mode 100644 index d61b13dd..00000000 --- a/backend/pkg/web/handler/couchdb_proxy.go +++ /dev/null @@ -1,40 +0,0 @@ -package handler - -import ( - "fmt" - "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/config" - "github.com/gin-gonic/gin" - "log" - "net/http" - "net/http/httputil" - "net/url" - "strings" -) - -func CouchDBProxy(c *gin.Context) { - appConfig := c.MustGet("CONFIG").(config.Interface) - - couchdbUrl := fmt.Sprintf("%s://%s:%s", appConfig.GetString("couchdb.scheme"), appConfig.GetString("couchdb.host"), appConfig.GetString("couchdb.port")) - remote, err := url.Parse(couchdbUrl) - if err != nil { - panic(err) - } - - proxy := httputil.NewSingleHostReverseProxy(remote) - //Define the director func - //This is a good place to log, for example - proxy.Director = func(req *http.Request) { - req.Header = c.Request.Header - req.Header.Add("X-Forwarded-Host", req.Host) - req.Header.Add("X-Origin-Host", remote.Host) - req.Host = remote.Host - req.URL.Scheme = remote.Scheme - req.URL.Host = remote.Host - log.Printf(c.Param("proxyPath")) - req.URL.Path = strings.TrimPrefix(c.Param("proxyPath"), "/database") - - //todo: throw an error if not a user DB. - } - - proxy.ServeHTTP(c.Writer, c.Request) -} diff --git a/backend/pkg/web/handler/resource_fhir.go b/backend/pkg/web/handler/resource_fhir.go new file mode 100644 index 00000000..73d50b9e --- /dev/null +++ b/backend/pkg/web/handler/resource_fhir.go @@ -0,0 +1,51 @@ +package handler + +import ( + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/database" + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/models" + "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "net/http" + "strings" +) + +func ListResourceFhir(c *gin.Context) { + logger := c.MustGet("LOGGER").(*logrus.Entry) + databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + + listResourceQueryOptions := models.ListResourceQueryOptions{} + if len(c.Query("sourceResourceType")) > 0 { + listResourceQueryOptions.SourceResourceType = c.Query("sourceResourceType") + } + if len(c.Query("sourceID")) > 0 { + listResourceQueryOptions.SourceID = c.Query("sourceID") + } + + wrappedResourceModels, err := databaseRepo.ListResources(c, listResourceQueryOptions) + + if err != nil { + logger.Errorln("An error occurred while retrieving resources", err) + c.JSON(http.StatusInternalServerError, gin.H{"success": false}) + return + } + + c.JSON(http.StatusOK, gin.H{"success": true, "data": wrappedResourceModels}) +} + +//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) + + resourceId := strings.Trim(c.Param("resourceId"), "/") + sourceId := strings.Trim(c.Param("sourceId"), "/") + wrappedResourceModel, err := databaseRepo.GetResourceBySourceId(c, sourceId, resourceId) + + if err != nil { + logger.Errorln("An error occurred while retrieving resource", err) + c.JSON(http.StatusInternalServerError, gin.H{"success": false}) + return + } + + c.JSON(http.StatusOK, gin.H{"success": true, "data": wrappedResourceModel}) +} diff --git a/backend/pkg/web/handler/source.go b/backend/pkg/web/handler/source.go new file mode 100644 index 00000000..5624bddc --- /dev/null +++ b/backend/pkg/web/handler/source.go @@ -0,0 +1,263 @@ +package handler + +import ( + "fmt" + "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/database" + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/models" + "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + +func CreateSource(c *gin.Context) { + logger := c.MustGet("LOGGER").(*logrus.Entry) + databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + + sourceCred := models.SourceCredential{} + if err := c.ShouldBindJSON(&sourceCred); err != nil { + logger.Errorln("An error occurred while parsing posted source credential", err) + c.JSON(http.StatusBadRequest, gin.H{"success": false}) + return + } + + logger.Infof("Parsed Create SourceCredential Credentials Payload: %v", sourceCred) + + err := databaseRepo.CreateSource(c, &sourceCred) + if err != nil { + logger.Errorln("An error occurred while storing source credential", err) + c.JSON(http.StatusInternalServerError, gin.H{"success": false}) + return + } + + // after creating the source, we should do a bulk import + summary, err := syncSourceResources(c, logger, databaseRepo, sourceCred) + if err != nil { + c.JSON(http.StatusInternalServerError, gin.H{"success": false}) + return + } + + c.JSON(http.StatusOK, gin.H{"success": true, "source": sourceCred, "data": summary}) +} + +func SourceSync(c *gin.Context) { + logger := c.MustGet("LOGGER").(*logrus.Entry) + databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + + logger.Infof("Get SourceCredential Credentials: %v", c.Param("sourceId")) + + sourceCred, err := databaseRepo.GetSource(c, c.Param("sourceId")) + if err != nil { + logger.Errorln("An error occurred while retrieving source credential", err) + c.JSON(http.StatusInternalServerError, gin.H{"success": false}) + return + } + + // after creating the source, we should do a bulk import + summary, err := syncSourceResources(c, logger, databaseRepo, *sourceCred) + if err != nil { + c.JSON(http.StatusInternalServerError, gin.H{"success": false}) + return + } + c.JSON(http.StatusOK, gin.H{"success": true, "source": sourceCred, "data": summary}) +} + +func CreateManualSource(c *gin.Context) { + logger := c.MustGet("LOGGER").(*logrus.Entry) + databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + + // single file + file, err := c.FormFile("file") + if err != nil { + c.JSON(http.StatusInternalServerError, gin.H{"success": false, "error": "could not extract file from form"}) + return + } + fmt.Printf("Uploaded filename: %s", file.Filename) + + // create a temporary file to store this uploaded file + bundleFile, err := ioutil.TempFile("", file.Filename) + if err != nil { + c.JSON(http.StatusInternalServerError, gin.H{"success": false, "error": "could not create temp file"}) + return + } + + // Upload the file to specific bundleFile. + err = c.SaveUploadedFile(file, bundleFile.Name()) + if err != nil { + c.JSON(http.StatusInternalServerError, gin.H{"success": false, "error": "could not save temp file"}) + return + } + + // We cannot save the "SourceCredential" object yet, as we do not know the patientID + + // create a "manual" client, which we can use to parse the + manualSourceCredential := models.SourceCredential{ + SourceType: sourcePkg.SourceTypeManual, + } + tempSourceClient, _, err := factory.GetSourceClient(sourcePkg.GetFastenEnv(), sourcePkg.SourceTypeManual, c, logger, manualSourceCredential) + if err != nil { + logger.Errorln("An error occurred while initializing hub client using manual source without credentials", err) + c.JSON(http.StatusInternalServerError, gin.H{"success": false}) + return + } + + patientId, bundleType, err := tempSourceClient.ExtractPatientId(bundleFile) + if err != nil { + logger.Errorln("An error occurred while extracting patient id", err) + c.JSON(http.StatusInternalServerError, gin.H{"success": false, "error": err.Error()}) + return + } + manualSourceCredential.Patient = patientId + + //store the manualSourceCredential + err = databaseRepo.CreateSource(c, &manualSourceCredential) + if err != nil { + logger.Errorln("An error occurred while creating manual source", err) + c.JSON(http.StatusInternalServerError, gin.H{"success": false, "error": err.Error()}) + return + } + + manualSourceClient, _, err := factory.GetSourceClient(sourcePkg.GetFastenEnv(), sourcePkg.SourceTypeManual, c, logger, manualSourceCredential) + if err != nil { + logger.Errorln("An error occurred while initializing hub client using manual source with credential", err) + c.JSON(http.StatusInternalServerError, gin.H{"success": false}) + return + } + + summary, err := manualSourceClient.SyncAllBundle(databaseRepo, bundleFile, bundleType) + if err != nil { + logger.Errorln("An error occurred while processing bundle", err) + c.JSON(http.StatusInternalServerError, gin.H{"success": false, "error": err.Error()}) + return + } + + c.JSON(http.StatusOK, gin.H{"success": true, "data": summary}) +} + +func GetSource(c *gin.Context) { + logger := c.MustGet("LOGGER").(*logrus.Entry) + databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + + sourceCred, err := databaseRepo.GetSource(c, c.Param("sourceId")) + if err != nil { + logger.Errorln("An error occurred while retrieving source credential", err) + c.JSON(http.StatusInternalServerError, gin.H{"success": false}) + return + } + c.JSON(http.StatusOK, gin.H{"success": true, "data": sourceCred}) +} + +func GetSourceSummary(c *gin.Context) { + logger := c.MustGet("LOGGER").(*logrus.Entry) + databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + + sourceSummary, err := databaseRepo.GetSourceSummary(c, c.Param("sourceId")) + if err != nil { + logger.Errorln("An error occurred while retrieving source summary", err) + c.JSON(http.StatusInternalServerError, gin.H{"success": false}) + return + } + c.JSON(http.StatusOK, gin.H{"success": true, "data": sourceSummary}) +} + +func ListSource(c *gin.Context) { + logger := c.MustGet("LOGGER").(*logrus.Entry) + databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + + sourceCreds, err := databaseRepo.GetSources(c) + if err != nil { + logger.Errorln("An error occurred while listing source credentials", err) + c.JSON(http.StatusInternalServerError, gin.H{"success": false}) + return + } + c.JSON(http.StatusOK, gin.H{"success": true, "data": sourceCreds}) +} + +func RawRequestSource(c *gin.Context) { + logger := c.MustGet("LOGGER").(*logrus.Entry) + databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + + //!!!!!!INSECURE!!!!!!S + //We're setting the username to a user provided value, this is insecure, but required for calling databaseRepo fns + c.Set("AUTH_USERNAME", c.Param("username")) + + foundSource, err := databaseRepo.GetSource(c, c.Param("sourceId")) + if err != nil { + logger.Errorf("An error occurred while finding source credential: %v", err) + c.JSON(http.StatusInternalServerError, gin.H{"success": false, "error": err.Error()}) + return + } + + if foundSource == nil { + logger.Errorf("Did not source credentials for %s", c.Param("sourceType")) + c.JSON(http.StatusNotFound, gin.H{"success": false, "error": err.Error()}) + return + } + + client, updatedSource, err := factory.GetSourceClient(sourcePkg.GetFastenEnv(), foundSource.SourceType, c, logger, foundSource) + if err != nil { + logger.Errorf("Could not initialize source client %v", err) + c.JSON(http.StatusInternalServerError, gin.H{"success": false, "error": err.Error()}) + return + } + //TODO: if source has been updated, we should save the access/refresh token. + if updatedSource != nil { + logger.Warnf("TODO: source credential has been updated, we should store it in the database: %v", updatedSource) + // err := databaseRepo.CreateSource(c, updatedSource) + // if err != nil { + // logger.Errorf("An error occurred while updating source credential %v", err) + // c.JSON(http.StatusInternalServerError, gin.H{"success": false, "error": err.Error()}) + // return + // } + } + + var resp map[string]interface{} + + parsedUrl, err := url.Parse(strings.TrimSuffix(c.Param("path"), "/")) + if err != nil { + logger.Errorf("Error parsing request, %v", err) + c.JSON(http.StatusInternalServerError, gin.H{"success": false, "error": err.Error()}) + return + } + //make sure we include all query string parameters with the raw request. + parsedUrl.RawQuery = c.Request.URL.Query().Encode() + + err = client.GetRequest(parsedUrl.String(), &resp) + if err != nil { + logger.Errorf("Error making raw request, %v", err) + c.JSON(http.StatusInternalServerError, gin.H{"success": false, "error": err.Error(), "data": resp}) + return + } + c.JSON(http.StatusOK, gin.H{"success": true, "data": resp}) +} + +////// private functions +func syncSourceResources(c *gin.Context, logger *logrus.Entry, databaseRepo database.DatabaseRepository, sourceCred models.SourceCredential) (sourceModels.UpsertSummary, error) { + // after creating the source, we should do a bulk import + sourceClient, updatedSource, err := factory.GetSourceClient(sourcePkg.GetFastenEnv(), sourceCred.SourceType, c, logger, sourceCred) + if err != nil { + logger.Errorln("An error occurred while initializing hub client using source credential", err) + return sourceModels.UpsertSummary{}, err + } + //TODO: update source + if updatedSource != nil { + logger.Warnf("TODO: source credential has been updated, we should store it in the database: %v", updatedSource) + //err := databaseRepo.CreateSource(c, updatedSource) + //if err != nil { + // logger.Errorln("An error occurred while updating source credential", err) + // return err + //} + } + + summary, err := sourceClient.SyncAll(databaseRepo) + if err != nil { + logger.Errorln("An error occurred while bulk import of resources from source", err) + return summary, err + } + return summary, nil +} diff --git a/backend/pkg/web/handler/summary.go b/backend/pkg/web/handler/summary.go new file mode 100644 index 00000000..182b5edc --- /dev/null +++ b/backend/pkg/web/handler/summary.go @@ -0,0 +1,21 @@ +package handler + +import ( + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/database" + "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "net/http" +) + +func GetSummary(c *gin.Context) { + logger := c.MustGet("LOGGER").(*logrus.Entry) + databaseRepo := c.MustGet("REPOSITORY").(database.DatabaseRepository) + + summary, err := databaseRepo.GetSummary(c) + if err != nil { + logger.Errorln("An error occurred while retrieving summary", err) + c.JSON(http.StatusInternalServerError, gin.H{"success": false}) + return + } + c.JSON(http.StatusOK, gin.H{"success": true, "data": summary}) +} diff --git a/backend/pkg/web/middleware/require_auth.go b/backend/pkg/web/middleware/require_auth.go new file mode 100644 index 00000000..2fd703d9 --- /dev/null +++ b/backend/pkg/web/middleware/require_auth.go @@ -0,0 +1,47 @@ +package middleware + +import ( + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/auth" + "github.com/fastenhealth/fastenhealth-onprem/backend/pkg/config" + "github.com/gin-gonic/gin" + "log" + "net/http" + "strings" +) + +func RequireAuth() gin.HandlerFunc { + return func(c *gin.Context) { + appConfig := c.MustGet("CONFIG").(config.Interface) + + authHeader := c.GetHeader("Authorization") + authHeaderParts := strings.Split(authHeader, " ") + + if len(authHeaderParts) != 2 { + log.Println("Authentication header is invalid: " + authHeader) + c.JSON(http.StatusUnauthorized, gin.H{"success": false, "error": "request does not contain a valid token"}) + c.Abort() + return + } + + tokenString := authHeaderParts[1] + + if tokenString == "" { + c.JSON(http.StatusUnauthorized, gin.H{"success": false, "error": "request does not contain an access token"}) + c.Abort() + return + } + claim, err := auth.JwtValidateFastenToken(appConfig.GetString("jwt.issuer.key"), tokenString) + if err != nil { + c.JSON(http.StatusUnauthorized, gin.H{"success": false, "error": err.Error()}) + c.Abort() + return + } + + //todo, is this shared between all sessions?? + c.Set("AUTH_TOKEN", tokenString) + c.Set("AUTH_USERNAME", claim.Subject) + c.Set("AUTH_USERID", claim.UserId) + + c.Next() + } +} diff --git a/backend/pkg/web/server.go b/backend/pkg/web/server.go index 5051aad4..c0c5df6c 100644 --- a/backend/pkg/web/server.go +++ b/backend/pkg/web/server.go @@ -42,10 +42,32 @@ func (ae *AppEngine) Setup(logger *logrus.Entry) *gin.Engine { api.POST("/auth/signup", handler.AuthSignup) api.POST("/auth/signin", handler.AuthSignin) + // + //r.Any("/database/*proxyPath", handler.CouchDBProxy) + //r.GET("/cors/*proxyPath", handler.CORSProxy) + //r.OPTIONS("/cors/*proxyPath", handler.CORSProxy) - r.Any("/database/*proxyPath", handler.CouchDBProxy) - r.GET("/cors/*proxyPath", handler.CORSProxy) - r.OPTIONS("/cors/*proxyPath", handler.CORSProxy) + secure := api.Group("/secure").Use(middleware.RequireAuth()) + { + secure.GET("/summary", handler.GetSummary) + + secure.POST("/source", handler.CreateSource) + secure.POST("/source/manual", handler.CreateManualSource) + secure.GET("/source", handler.ListSource) + secure.GET("/source/:sourceId", handler.GetSource) + secure.POST("/source/:sourceId/sync", handler.SourceSync) + secure.GET("/source/:sourceId/summary", handler.GetSourceSummary) + secure.GET("/resource/fhir", handler.ListResourceFhir) // + secure.GET("/resource/fhir/:sourceId/:resourceId", handler.GetResourceFhir) + } + + if ae.Config.GetString("log.level") == "DEBUG" { + //in debug mode, this endpoint lets us request data directly from the source api + ae.Logger.Warningf("***INSECURE*** ***INSECURE*** DEBUG mode enables developer functionality, including unauthenticated raw api requests") + + //http://localhost:9090/api/raw/test@test.com/436d7277-ad56-41ce-9823-44e353d1b3f6/Patient/smart-1288992 + api.GET("/raw/:username/:sourceId/*path", handler.RawRequestSource) + } } } diff --git a/config.yaml b/config.yaml index 383516e5..46533d65 100644 --- a/config.yaml +++ b/config.yaml @@ -22,4 +22,4 @@ web: log: file: '' #absolute or relative paths allowed, eg. web.log - level: INFO + level: DEBUG diff --git a/frontend/angular.json b/frontend/angular.json index f81e5350..6f741371 100644 --- a/frontend/angular.json +++ b/frontend/angular.json @@ -34,8 +34,7 @@ ], "scripts": [ "node_modules/@panva/oauth4webapi/build/index.js" - ], - "webWorkerTsConfig": "tsconfig.worker.json" + ] }, "configurations": { "prod": { @@ -161,8 +160,7 @@ "styles": [ "src/styles.scss" ], - "scripts": [], - "webWorkerTsConfig": "tsconfig.worker.json" + "scripts": [] } }, "lint": { diff --git a/frontend/src/app/app-routing.module.ts b/frontend/src/app/app-routing.module.ts index 51dc5e89..ff5ac66d 100644 --- a/frontend/src/app/app-routing.module.ts +++ b/frontend/src/app/app-routing.module.ts @@ -8,9 +8,9 @@ import {ResourceDetailComponent} from './pages/resource-detail/resource-detail.c import {AuthSigninComponent} from './pages/auth-signin/auth-signin.component'; import {AuthSignupComponent} from './pages/auth-signup/auth-signup.component'; import {IsAuthenticatedAuthGuard} from './auth-guards/is-authenticated-auth-guard'; -import {EncryptionEnabledAuthGuard} from './auth-guards/encryption-enabled.auth-guard'; import {SourceDetailComponent} from './pages/source-detail/source-detail.component'; -import {EncryptionManagerComponent} from './pages/encryption-manager/encryption-manager.component'; +import {PatientProfileComponent} from './pages/patient-profile/patient-profile.component'; +import {MedicalHistoryComponent} from './pages/medical-history/medical-history.component'; const routes: Routes = [ @@ -20,14 +20,15 @@ const routes: Routes = [ { path: 'auth/signup/callback/:idp_type', component: AuthSignupComponent }, { path: '', redirectTo: '/dashboard', pathMatch: 'full' }, - { path: 'dashboard', component: DashboardComponent, canActivate: [ IsAuthenticatedAuthGuard, EncryptionEnabledAuthGuard] }, - { path: 'source/:source_id', component: SourceDetailComponent, canActivate: [ IsAuthenticatedAuthGuard, EncryptionEnabledAuthGuard] }, - { path: 'resource/:resource_id', component: ResourceDetailComponent, canActivate: [ IsAuthenticatedAuthGuard, EncryptionEnabledAuthGuard] }, - { path: 'sources', component: MedicalSourcesComponent, canActivate: [ IsAuthenticatedAuthGuard, EncryptionEnabledAuthGuard] }, - { path: 'sources/callback/:source_type', component: MedicalSourcesComponent, canActivate: [ IsAuthenticatedAuthGuard, EncryptionEnabledAuthGuard] }, + { 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: 'sources', component: MedicalSourcesComponent, canActivate: [ IsAuthenticatedAuthGuard] }, + { path: 'sources/callback/:source_type', component: MedicalSourcesComponent, canActivate: [ IsAuthenticatedAuthGuard] }, - { path: 'account/security/manager', component: EncryptionManagerComponent, canActivate: [ IsAuthenticatedAuthGuard] }, + { path: 'patient-profile', component: PatientProfileComponent, canActivate: [ IsAuthenticatedAuthGuard] }, + { path: 'medical-history', component: MedicalHistoryComponent, canActivate: [ IsAuthenticatedAuthGuard] }, // { path: 'general-pages', loadChildren: () => import('./general-pages/general-pages.module').then(m => m.GeneralPagesModule) }, // { path: 'ui-elements', loadChildren: () => import('./ui-elements/ui-elements.module').then(m => m.UiElementsModule) }, diff --git a/frontend/src/app/app.component.ts b/frontend/src/app/app.component.ts index b5b9cc7f..86eb2825 100644 --- a/frontend/src/app/app.component.ts +++ b/frontend/src/app/app.component.ts @@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core'; import {NavigationEnd, Router} from '@angular/router'; import {fromWorker} from 'observable-webworker'; import {Observable, of} from 'rxjs'; -import {QueueService} from './workers/queue.service'; import {ToastService} from './services/toast.service'; @Component({ @@ -17,7 +16,7 @@ export class AppComponent implements OnInit { showHeader:boolean = false; showFooter:boolean = true; - constructor(private router: Router, private queueService: QueueService, private toastService: ToastService) {} + constructor(private router: Router, private toastService: ToastService) {} ngOnInit() { diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts index 60770e1e..6f9431f1 100644 --- a/frontend/src/app/app.module.ts +++ b/frontend/src/app/app.module.ts @@ -19,15 +19,15 @@ import { AuthSigninComponent } from './pages/auth-signin/auth-signin.component'; import { FormsModule } from '@angular/forms'; import { NgxDropzoneModule } from 'ngx-dropzone'; import { IsAuthenticatedAuthGuard } from './auth-guards/is-authenticated-auth-guard'; -import { EncryptionEnabledAuthGuard } from './auth-guards/encryption-enabled.auth-guard'; -import {FastenDbService} from './services/fasten-db.service'; +import {FastenApiService} from './services/fasten-api.service'; import {Router} from '@angular/router'; import { SourceDetailComponent } from './pages/source-detail/source-detail.component'; import { HighlightModule, HIGHLIGHT_OPTIONS } from 'ngx-highlightjs'; import {AuthInterceptorService} from './services/auth-interceptor.service'; import { MomentModule } from 'ngx-moment'; -import { EncryptionManagerComponent } from './pages/encryption-manager/encryption-manager.component'; import {AuthService} from './services/auth.service'; +import { PatientProfileComponent } from './pages/patient-profile/patient-profile.component'; +import { MedicalHistoryComponent } from './pages/medical-history/medical-history.component'; @NgModule({ declarations: [ @@ -40,7 +40,8 @@ import {AuthService} from './services/auth.service'; AuthSignupComponent, AuthSigninComponent, SourceDetailComponent, - EncryptionManagerComponent, + PatientProfileComponent, + MedicalHistoryComponent, ], imports: [ FormsModule, @@ -63,7 +64,6 @@ import {AuthService} from './services/auth.service'; deps: [AuthService, Router] }, IsAuthenticatedAuthGuard, - EncryptionEnabledAuthGuard, { provide: HIGHLIGHT_OPTIONS, useValue: { diff --git a/frontend/src/app/auth-guards/encryption-enabled.auth-guard.ts b/frontend/src/app/auth-guards/encryption-enabled.auth-guard.ts deleted file mode 100644 index e612199f..00000000 --- a/frontend/src/app/auth-guards/encryption-enabled.auth-guard.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Injectable } from '@angular/core'; -import {CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router} from '@angular/router'; -import {FastenDbService} from '../services/fasten-db.service'; - -@Injectable() -export class EncryptionEnabledAuthGuard implements CanActivate { - constructor(private fastenDbService: FastenDbService, private router: Router) { - - } - - async canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise { - //check if the user has encryption data stored in this browser already - if (!await this.fastenDbService.isCryptConfigAvailable()) { - return await this.router.navigate(['/account/security/manager']); - } - // continue as normal - return true - } -} diff --git a/frontend/src/app/components/header/header.component.ts b/frontend/src/app/components/header/header.component.ts index 6feb44e5..0d571ff5 100644 --- a/frontend/src/app/components/header/header.component.ts +++ b/frontend/src/app/components/header/header.component.ts @@ -1,5 +1,4 @@ import { Component, OnInit } from '@angular/core'; -import {FastenDbService} from '../../services/fasten-db.service'; import { Router } from '@angular/router'; import {AuthService} from '../../services/auth.service'; import {UserRegisteredClaims} from '../../models/fasten/user-registered-claims'; diff --git a/frontend/src/app/components/list-fallback-resource/list-fallback-resource.component.html b/frontend/src/app/components/list-fallback-resource/list-fallback-resource.component.html index 7830336d..ae48ac22 100644 --- a/frontend/src/app/components/list-fallback-resource/list-fallback-resource.component.html +++ b/frontend/src/app/components/list-fallback-resource/list-fallback-resource.component.html @@ -9,6 +9,6 @@ diff --git a/frontend/src/app/components/list-fallback-resource/list-fallback-resource.component.ts b/frontend/src/app/components/list-fallback-resource/list-fallback-resource.component.ts index 5cec5f91..9d70da65 100644 --- a/frontend/src/app/components/list-fallback-resource/list-fallback-resource.component.ts +++ b/frontend/src/app/components/list-fallback-resource/list-fallback-resource.component.ts @@ -1,8 +1,7 @@ import {ChangeDetectorRef, Component, Input, OnInit} from '@angular/core'; -import {ResourceFhir} from '../../../lib/models/database/resource_fhir'; +import {ResourceFhir} from '../../models/fasten/resource_fhir'; import {ResourceListComponentInterface} from '../list-generic-resource/list-generic-resource.component'; import {Router} from '@angular/router'; -import {Base64} from '../../../lib/utils/base64'; @Component({ selector: 'app-list-fallback-resource', diff --git a/frontend/src/app/components/list-generic-resource/list-generic-resource.component.ts b/frontend/src/app/components/list-generic-resource/list-generic-resource.component.ts index 2efa70f4..5638c40b 100644 --- a/frontend/src/app/components/list-generic-resource/list-generic-resource.component.ts +++ b/frontend/src/app/components/list-generic-resource/list-generic-resource.component.ts @@ -1,9 +1,8 @@ import {ChangeDetectorRef, Component, Input, OnInit, ViewChild} from '@angular/core'; import {DatatableComponent, ColumnMode, SelectionType} from '@swimlane/ngx-datatable'; -import {ResourceFhir} from '../../../lib/models/database/resource_fhir'; +import {ResourceFhir} from '../../models/fasten/resource_fhir'; import {FORMATTERS, getPath, obsValue, attributeXTime} from './utils'; import {Router} from '@angular/router'; -import {Base64} from '../../../lib/utils/base64'; //all Resource list components must implement this Interface export interface ResourceListComponentInterface { @@ -61,7 +60,6 @@ export class ListGenericResourceComponent implements OnInit, ResourceListCompone this.rows = this.resourceList.map((resource) => { let row = { - _id: resource._id, source_id: resource.source_id, source_resource_type: resource.source_resource_type, source_resource_id: resource.source_resource_id @@ -87,7 +85,8 @@ export class ListGenericResourceComponent implements OnInit, ResourceListCompone */ onSelect({ selected }) { console.log('Select Event', selected); - this.router.navigateByUrl(`/resource/${Base64.Encode(selected[0]._id)}`); + this.router.navigateByUrl(`/source/${selected[0].source_id}/resource/${selected[0].source_resource_id}`); + } } diff --git a/frontend/src/app/components/resource-list/resource-list.component.ts b/frontend/src/app/components/resource-list/resource-list.component.ts index 0a9cf040..0c17aef2 100644 --- a/frontend/src/app/components/resource-list/resource-list.component.ts +++ b/frontend/src/app/components/resource-list/resource-list.component.ts @@ -1,8 +1,8 @@ import {ChangeDetectionStrategy, Component, Input, OnChanges, OnInit, SimpleChanges, Type, ViewChild} from '@angular/core'; -import {FastenDbService} from '../../services/fasten-db.service'; -import {Source} from '../../../lib/models/database/source'; +import {FastenApiService} from '../../services/fasten-api.service'; +import {Source} from '../../models/fasten/source'; import {Observable, of} from 'rxjs'; -import {ResourceFhir} from '../../../lib/models/database/resource_fhir'; +import {ResourceFhir} from '../../models/fasten/resource_fhir'; import {ListAdverseEventComponent} from '../list-generic-resource/list-adverse-event.component'; import {ListCommunicationComponent} from '../list-generic-resource/list-communication.component'; import {ListConditionComponent} from '../list-generic-resource/list-condition.component'; @@ -49,7 +49,7 @@ export class ResourceListComponent implements OnInit, OnChanges { @ViewChild(ResourceListOutletDirective, {static: true}) resourceListOutlet!: ResourceListOutletDirective; - constructor(private fastenDb: FastenDbService) { } + constructor(private fastenApi: FastenApiService) { } ngOnInit(): void { this.loadComponent() @@ -63,7 +63,7 @@ export class ResourceListComponent implements OnInit, OnChanges { const viewContainerRef = this.resourceListOutlet.viewContainerRef; viewContainerRef.clear(); - this.getResources().then((resourceList) => { + this.getResources().subscribe((resourceList) => { let componentType = this.typeLookup(this.resourceListType) if(componentType != null){ console.log("Attempting to create component", this.resourceListType, componentType) @@ -75,19 +75,18 @@ export class ResourceListComponent implements OnInit, OnChanges { }) } - getResources(): Promise{ + getResources(): Observable{ if(this.resourceListType && !this.resourceListCache[this.resourceListType]){ // this resource type list has not been downloaded yet, do so now - return this.fastenDb.GetResourcesForSource(this.source._id, this.resourceListType) - .then((paginatedResponse) => { - let resourceList = paginatedResponse.rows as ResourceFhir[] + return this.fastenApi.getResources(this.resourceListType, this.source.id) + .pipe(map((resourceList: ResourceFhir[]) => { //cache this response so we can skip the request next time this.resourceListCache[this.resourceListType] = resourceList return resourceList - }) + })) } else { - return Promise.resolve(this.resourceListCache[this.resourceListType] || []) + return of(this.resourceListCache[this.resourceListType] || []) } } diff --git a/frontend/src/app/models/fasten/resource_fhir.ts b/frontend/src/app/models/fasten/resource_fhir.ts new file mode 100644 index 00000000..619b4586 --- /dev/null +++ b/frontend/src/app/models/fasten/resource_fhir.ts @@ -0,0 +1,48 @@ +export class ResourceFhir { + user_id?: string + source_id: string = "" + source_resource_type: string = "" + source_resource_id: string = "" + + fhir_version: string = "" + resource_raw: IResourceRaw + + constructor(object?: any) { + return Object.assign(this, object) + } +} + + +//This is the "raw" Fhir resource +export interface IResourceRaw { + resourceType: string + id?: string + meta?: IResourceMetaRaw +} +// This is the "raw" Fhir Bundle resource +export interface IResourceBundleRaw { + resourceType: string + id?: string + entry: IResourceBundleEntryRaw[] + total?: number + link?: IResourceBundleLinkRaw[] + meta?: IResourceMetaRaw +} + +export interface IResourceBundleLinkRaw { + id?: string + relation: string + url: string +} + +export interface IResourceBundleEntryRaw { + id?: string + fullUrl?: string + resource: IResourceRaw +} + +export interface IResourceMetaRaw { + id?: string + versionId?: string + lastUpdated: string +} diff --git a/frontend/src/lib/models/fasten/source-summary.ts b/frontend/src/app/models/fasten/source-summary.ts similarity index 68% rename from frontend/src/lib/models/fasten/source-summary.ts rename to frontend/src/app/models/fasten/source-summary.ts index 61e56182..06a5e315 100644 --- a/frontend/src/lib/models/fasten/source-summary.ts +++ b/frontend/src/app/models/fasten/source-summary.ts @@ -1,5 +1,5 @@ -import {Source} from '../database/source'; -import {ResourceFhir} from '../database/resource_fhir'; +import {Source} from './source'; +import {ResourceFhir} from './resource_fhir'; export class ResourceTypeCounts { count: number diff --git a/frontend/src/app/models/fasten/source.ts b/frontend/src/app/models/fasten/source.ts new file mode 100644 index 00000000..b6abf984 --- /dev/null +++ b/frontend/src/app/models/fasten/source.ts @@ -0,0 +1,18 @@ +import {LighthouseSourceMetadata} from '../lighthouse/lighthouse-source-metadata'; + +export class Source extends LighthouseSourceMetadata{ + id?: string + user_id?: number + source_type: string + + patient: string + access_token: string + refresh_token?: string + id_token?: string + expires_at: number //seconds since epoch + + constructor(object: any) { + super() + return Object.assign(this, object) + } +} diff --git a/frontend/src/lib/models/fasten/summary.ts b/frontend/src/app/models/fasten/summary.ts similarity index 63% rename from frontend/src/lib/models/fasten/summary.ts rename to frontend/src/app/models/fasten/summary.ts index 0ca58e85..989fba14 100644 --- a/frontend/src/lib/models/fasten/summary.ts +++ b/frontend/src/app/models/fasten/summary.ts @@ -1,6 +1,6 @@ -import {Source} from '../database/source'; +import {Source} from './source'; import {ResourceTypeCounts} from './source-summary'; -import {ResourceFhir} from '../database/resource_fhir'; +import {ResourceFhir} from './resource_fhir'; export class Summary { sources: Source[] diff --git a/frontend/src/lib/models/fasten/user.ts b/frontend/src/app/models/fasten/user.ts similarity index 81% rename from frontend/src/lib/models/fasten/user.ts rename to frontend/src/app/models/fasten/user.ts index 9e384b39..4f98b3b2 100644 --- a/frontend/src/lib/models/fasten/user.ts +++ b/frontend/src/app/models/fasten/user.ts @@ -1,4 +1,5 @@ export class User { + user_id?: number full_name?: string username?: string password?: string diff --git a/frontend/src/lib/models/lighthouse/lighthouse-source-metadata.ts b/frontend/src/app/models/lighthouse/lighthouse-source-metadata.ts similarity index 100% rename from frontend/src/lib/models/lighthouse/lighthouse-source-metadata.ts rename to frontend/src/app/models/lighthouse/lighthouse-source-metadata.ts diff --git a/frontend/src/app/models/queue/source-sync-message.ts b/frontend/src/app/models/queue/source-sync-message.ts index 22c0647a..9edcad3c 100644 --- a/frontend/src/app/models/queue/source-sync-message.ts +++ b/frontend/src/app/models/queue/source-sync-message.ts @@ -1,4 +1,4 @@ -import {Source} from '../../../lib/models/database/source'; +import {Source} from '../../models/fasten/source'; export class SourceSyncMessage { source: Source diff --git a/frontend/src/app/pages/auth-signin/auth-signin.component.ts b/frontend/src/app/pages/auth-signin/auth-signin.component.ts index 84411954..3a7ceb1e 100644 --- a/frontend/src/app/pages/auth-signin/auth-signin.component.ts +++ b/frontend/src/app/pages/auth-signin/auth-signin.component.ts @@ -1,13 +1,11 @@ import {Component, OnInit} from '@angular/core'; -import {User} from '../../../lib/models/fasten/user'; -import {FastenDbService} from '../../services/fasten-db.service'; +import {User} from '../../models/fasten/user'; import {ActivatedRoute, Router} from '@angular/router'; import {ToastService} from '../../services/toast.service'; import {ToastNotification, ToastType} from '../../models/fasten/toast'; import {environment} from '../../../environments/environment'; import {AuthService} from '../../services/auth.service'; import {Location} from '@angular/common'; -import {PouchdbCrypto} from '../../../lib/database/plugins/crypto'; @Component({ selector: 'app-auth-signin', @@ -23,7 +21,6 @@ export class AuthSigninComponent implements OnInit { loading: boolean = false constructor( - private fastenDb: FastenDbService, private authService: AuthService, private router: Router, private route: ActivatedRoute, @@ -47,10 +44,7 @@ export class AuthSigninComponent implements OnInit { //TODO: replace Pouchdb. let userId = this.authService.GetCurrentUser().sub //TODO: static IV, must be removed/replaced. - return {username: userId, key: userId, config: "WyI3NUhJcEhZTXBNVXRtMHlJcnBMckhRPT0iLHsic2FsdExlbmd0aCI6MTYsIm1lbW9yeVNpemUiOjQwOTYsIml0ZXJhdGlvbnMiOjEwMCwicGFyYWxsZWxpc20iOjF9XQ=="} - }) - .then((cryptoConfig) => { - PouchdbCrypto.StoreCryptConfig(cryptoConfig) + return {username: userId, key: userId} }) .then(() => this.router.navigateByUrl('/dashboard')) .catch((err)=>{ diff --git a/frontend/src/app/pages/auth-signup/auth-signup.component.ts b/frontend/src/app/pages/auth-signup/auth-signup.component.ts index d4ec0d2c..cab66acb 100644 --- a/frontend/src/app/pages/auth-signup/auth-signup.component.ts +++ b/frontend/src/app/pages/auth-signup/auth-signup.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import {FastenDbService} from '../../services/fasten-db.service'; -import {User} from '../../../lib/models/fasten/user'; +import {User} from '../../models/fasten/user'; import {Router} from '@angular/router'; import {ToastNotification, ToastType} from '../../models/fasten/toast'; import {ToastService} from '../../services/toast.service'; diff --git a/frontend/src/app/pages/dashboard/dashboard.component.html b/frontend/src/app/pages/dashboard/dashboard.component.html index 3421414f..6bbbbb46 100644 --- a/frontend/src/app/pages/dashboard/dashboard.component.html +++ b/frontend/src/app/pages/dashboard/dashboard.component.html @@ -148,7 +148,7 @@
{{metadataSource[source.source_type]?.display}}

- {{getPatientSummary(patientForSource[source._id]?.resource_raw)}} + {{getPatientSummary(patientForSource[source.id]?.resource_raw)}}

diff --git a/frontend/src/app/pages/dashboard/dashboard.component.ts b/frontend/src/app/pages/dashboard/dashboard.component.ts index 6ab872f6..ab2c9fd7 100644 --- a/frontend/src/app/pages/dashboard/dashboard.component.ts +++ b/frontend/src/app/pages/dashboard/dashboard.component.ts @@ -1,12 +1,11 @@ import { Component, OnInit } from '@angular/core'; -import {Source} from '../../../lib/models/database/source'; +import {Source} from '../../models/fasten/source'; import {Router} from '@angular/router'; -import {ResourceFhir} from '../../../lib/models/database/resource_fhir'; +import {ResourceFhir} from '../../models/fasten/resource_fhir'; import {forkJoin} from 'rxjs'; import {MetadataSource} from '../../models/fasten/metadata-source'; -import {FastenDbService} from '../../services/fasten-db.service'; -import {Summary} from '../../../lib/models/fasten/summary'; -import {Base64} from '../../../lib/utils/base64'; +import {FastenApiService} from '../../services/fasten-api.service'; +import {Summary} from '../../models/fasten/summary'; import {LighthouseService} from '../../services/lighthouse.service'; @Component({ @@ -25,7 +24,7 @@ export class DashboardComponent implements OnInit { constructor( private lighthouseApi: LighthouseService, - private fastenDb: FastenDbService, + private fastenApi: FastenApiService, private router: Router ) { } @@ -49,7 +48,7 @@ export class DashboardComponent implements OnInit { // }) // }) - forkJoin([this.fastenDb.GetSummary(), this.lighthouseApi.getLighthouseSourceMetadataMap()]).subscribe(results => { + forkJoin([this.fastenApi.getSummary(), this.lighthouseApi.getLighthouseSourceMetadataMap()]).subscribe(results => { let summary = results[0] as Summary let metadataSource = results[1] as { [name: string]: MetadataSource } @@ -81,7 +80,7 @@ export class DashboardComponent implements OnInit { } selectSource(selectedSource: Source){ - this.router.navigateByUrl(`/source/${Base64.Encode(selectedSource._id)}`, { + this.router.navigateByUrl(`/source/${selectedSource.id}`, { state: selectedSource }); } diff --git a/frontend/src/app/pages/encryption-manager/encryption-manager.component.html b/frontend/src/app/pages/encryption-manager/encryption-manager.component.html deleted file mode 100644 index 62435403..00000000 --- a/frontend/src/app/pages/encryption-manager/encryption-manager.component.html +++ /dev/null @@ -1,151 +0,0 @@ -
-
-
-
-

Security Manager

-

- Before you use Fasten you'll need to import or generate a new encryption key. -
-
- Fasten uses zero-knowledge encryption to secure your medical data. - This means that your medical records are encrypted on your device, before they are stored in the Fasten database. - The encrypted data stored in the database is worthless without your encryption key. -
-
- You must safely store your encryption key as you would a username & password, - as it's the only thing that will allow you to access your records.

- -
- -
- - -

Generate an encryption key

-
-

- Fasten has generated an encryption key for you. You can use this encryption key to decode your medical records on this browser, and other devices. -
- - This is the only time the encryption key will be available to view, copy or download. We recommend downloading this key and storing the file in a secure location. -
- You can reset your encryption key at any time, however any previously encrypted data will no longer be accessible. -

- -
- - -
-
- -

Validate your encryption key

-
-

- Please select your encryption key (which you generated in the previous step) using the file input below. -
- It'll be validated against your browser's encryption key to ensure fidelity. -

- -
-
-
- - -
- {{generateCustomFileError}} -
-
-
-
-
-
- -
-
-
-
    -
  • -
  • -
-
-
- - -
- -
- - -

Import existing encryption key

-
-

- Fasten was unable to find your encryption key on this device, and has detected encrypted data in your database. -
- You will need to provide your encryption key to access your health records. -

- -
-
-
- - -
- {{importCustomFileError}} -
-
-
-
- -
-
- -

Validate encryption key

-
-

- Thank you for providing your encryption key. Fasten will attempt to decrypt your secured records with this key. -

-
- Loading... -
-
-
-
-
- -
-
-
- -
-
diff --git a/frontend/src/app/pages/encryption-manager/encryption-manager.component.spec.ts b/frontend/src/app/pages/encryption-manager/encryption-manager.component.spec.ts deleted file mode 100644 index 040b8e74..00000000 --- a/frontend/src/app/pages/encryption-manager/encryption-manager.component.spec.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { EncryptionManagerComponent } from './encryption-manager.component'; -import {HttpClientTestingModule} from '@angular/common/http/testing'; - -describe('EncryptionManagerComponent', () => { - let component: EncryptionManagerComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ EncryptionManagerComponent ], - imports: [HttpClientTestingModule], - - }) - .compileComponents(); - - fixture = TestBed.createComponent(EncryptionManagerComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/frontend/src/app/pages/encryption-manager/encryption-manager.component.ts b/frontend/src/app/pages/encryption-manager/encryption-manager.component.ts deleted file mode 100644 index f9aed249..00000000 --- a/frontend/src/app/pages/encryption-manager/encryption-manager.component.ts +++ /dev/null @@ -1,198 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { v4 as uuidv4 } from 'uuid'; -import {PouchdbCryptConfig, PouchdbCrypto} from '../../../lib/database/plugins/crypto'; -import {FastenDbService} from '../../services/fasten-db.service'; -import {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser'; -import {Router} from '@angular/router'; -import {ToastService} from '../../services/toast.service'; -import {ToastNotification, ToastType} from '../../models/fasten/toast'; - -export enum CryptoPanelType { - Loading, - Import, - Generate, -} - - -@Component({ - selector: 'app-encryption-manager', - templateUrl: './encryption-manager.component.html', - styleUrls: ['./encryption-manager.component.scss'] -}) -export class EncryptionManagerComponent implements OnInit { - CryptoPanelType = CryptoPanelType - cryptoPanel: CryptoPanelType = CryptoPanelType.Loading - currentCryptoConfig: PouchdbCryptConfig = null - - generateCryptoConfigUrl: SafeResourceUrl = "" - generateCryptoConfigFilename: string = "" - generateCustomFileError: string = "" - - importCustomFileError: string = "" - - currentStep: number - lastStep: number - - - constructor(private fastenDbService: FastenDbService, private sanitizer: DomSanitizer, private router: Router, private toastService: ToastService) { } - - ngOnInit(): void { - - this.fastenDbService.IsDatabasePopulated() - .then((isPopulated) => { - if(isPopulated){ - return this.showImportCryptoConfig() - } else { - return this.showGenerateCryptoConfig() - } - }) - - } - - nextHandler() { - this.currentStep += 1 - // if (!this.stepsService.isLastStep()) { - // this.stepsService.moveToNextStep(); - // } else { - // this.onSubmit(); - // } - } - - ///////////////////////////////////////////////////////////////////////////////////////////////// - // Generate Wizard Methods - ///////////////////////////////////////////////////////////////////////////////////////////////// - async showGenerateCryptoConfig(): Promise { - this.cryptoPanel = CryptoPanelType.Generate - this.currentStep = 1 - this.lastStep = 2 - if(!this.currentCryptoConfig){ - this.currentCryptoConfig = await PouchdbCrypto.CryptConfig(uuidv4(), this.fastenDbService.current_user) - await PouchdbCrypto.StoreCryptConfig(this.currentCryptoConfig) //store in indexdb - - - //generate URL for downloading. - let currentCryptoConfigBlob = new Blob([JSON.stringify(this.currentCryptoConfig)], { type: 'application/json' }); - this.generateCryptoConfigUrl = this.sanitizer.bypassSecurityTrustResourceUrl(window.URL.createObjectURL(currentCryptoConfigBlob)); - this.generateCryptoConfigFilename = `fasten-${this.fastenDbService.current_user}.key.json` - } - - return this.currentCryptoConfig - } - - generateOpenFileHandler(fileList: FileList) { - this.generateCustomFileError = "" - let file = fileList[0]; - this.readFileContent(file) - .then((content) => { - let parsedCryptoConfig = JSON.parse(content) as PouchdbCryptConfig - - //check if the parsed encryption key matches the currently set encryption key - - if(parsedCryptoConfig.key == this.currentCryptoConfig.key && - parsedCryptoConfig.username == this.currentCryptoConfig.username && - parsedCryptoConfig.config == this.currentCryptoConfig.config){ - return true - } else { - //throw an error & notify user - this.generateCustomFileError = "Crypto configuration file does not match" - throw new Error(this.generateCustomFileError) - } - }) - .then(() => { - - const toastNotification = new ToastNotification() - toastNotification.type = ToastType.Success - toastNotification.message = "Successfully validated & stored encryption key." - toastNotification.autohide = true - this.toastService.show(toastNotification) - - //redirect user to dashboard - return this.router.navigate(['/dashboard']); - }) - .catch((err) => { - // delete invalid encryption key - this.currentStep = 1 - return PouchdbCrypto.DeleteCryptConfig(this.fastenDbService.current_user) - .then(() => { - //an error occurred while importing credential - const toastNotification = new ToastNotification() - toastNotification.type = ToastType.Error - toastNotification.message = "Provided encryption key does not match. Generating new encryption key, please store it and try again." - toastNotification.autohide = false - this.toastService.show(toastNotification) - }) - }) - } - - ///////////////////////////////////////////////////////////////////////////////////////////////// - // Import Wizard Methods - ///////////////////////////////////////////////////////////////////////////////////////////////// - - async showImportCryptoConfig(): Promise { - this.cryptoPanel = CryptoPanelType.Import - this.currentStep = 1 - this.lastStep = 2 - } - - importOpenFileHandler(fileList: FileList) { - this.importCustomFileError = "" - let file = fileList[0]; - this.readFileContent(file) - .then((content) => { - let cryptoConfig = JSON.parse(content) as PouchdbCryptConfig - - if(!cryptoConfig.key || !cryptoConfig.config){ - this.importCustomFileError = "Invalid crypto configuration file" - throw new Error(this.importCustomFileError) - } - - return PouchdbCrypto.StoreCryptConfig(cryptoConfig) - }) - .then(() => { - //go to step 2 - this.currentStep = 2 - //attempt to initialize pouchdb with specified crypto - this.fastenDbService.ResetDB() - return this.fastenDbService.GetSources() - - }) - .then(() => { - const toastNotification = new ToastNotification() - toastNotification.type = ToastType.Success - toastNotification.message = "Successfully validated & imported encryption key." - toastNotification.autohide = true - this.toastService.show(toastNotification) - - return this.router.navigate(['/dashboard']); - }) - .catch((err) => { - console.error(err) - // delete invalid encryption key - this.currentStep = 1 - return PouchdbCrypto.DeleteCryptConfig(this.fastenDbService.current_user) - .then(() => { - //an error occurred while importing credential - const toastNotification = new ToastNotification() - toastNotification.type = ToastType.Error - toastNotification.message = "Provided encryption key does not match. Please try a different key" - toastNotification.autohide = false - this.toastService.show(toastNotification) - }) - }) - } - - - private readFileContent(file: File): Promise{ - return new Promise((resolve, reject) => { - if (!file) { - resolve(''); - } - const reader = new FileReader(); - reader.onload = (e) => { - const text = reader.result.toString(); - resolve(text); - }; - reader.readAsText(file); - }); - } -} diff --git a/frontend/src/app/pages/medical-history/medical-history.component.html b/frontend/src/app/pages/medical-history/medical-history.component.html new file mode 100644 index 00000000..339f267d --- /dev/null +++ b/frontend/src/app/pages/medical-history/medical-history.component.html @@ -0,0 +1,124 @@ +
+
+
+ + +
+
+

Medical History

+
+
+

+ Patient: Caldwell, Ruben
+ Address: 123 B Street
Gainsville, FL, 94153
+ Date of Birth: June 20, 1929
+ Phone: 415-343-2342
+ Email: myemail@gmail.com +

+
+
+

+ Primary Care: Bishop, J. ANRP
+ Address: Malcom Randall VA
Medical Center Gainsville FL
+ Phone: 123-321-5532
+ Email: myemail@va.com
+

+
+
+ + +
+
+

Condition

+
+
+

History

+
+
+ + + +
+ +
+

Gout

+
+
+

Nov 16, 2002 - Present

+
+
+ + +
+ + +
+ +
+
+
Involved in Care
+
+ +
+ James Bishop, ANRP +
+
+ Primary Care +
+ +
+ Matthew Leonard, MD +
+
+ Diagnosing Physician +
+ +
+ Stephanie Wrenn, MD +
+
+ Dietitian +
+ + +
+
Initial Presentation
+
+
+ Acute right knee pain and tenderness around the joint line - this was likely caused by acute renal failure. +
+
+ + + +
+
+
+
+
Nov 19, 2012
+
+
+ Medications: Colchicine, as needed for gout attacks +
+ + +
+
Nov 16, 2012
+
+
+ Procedures: The fluid in your right knee was drained. +
+
+ Tests and Examinations: The fluid tested prositive for gout crystals +
+
+ Medications: You were given a steroid injection to reduce inflammation and as short course prednistone to reduce pain and inflammation +
+
+
+
+ + +
+
+
diff --git a/frontend/src/app/pages/encryption-manager/encryption-manager.component.scss b/frontend/src/app/pages/medical-history/medical-history.component.scss similarity index 100% rename from frontend/src/app/pages/encryption-manager/encryption-manager.component.scss rename to frontend/src/app/pages/medical-history/medical-history.component.scss diff --git a/frontend/src/app/pages/medical-history/medical-history.component.spec.ts b/frontend/src/app/pages/medical-history/medical-history.component.spec.ts new file mode 100644 index 00000000..f3691c5c --- /dev/null +++ b/frontend/src/app/pages/medical-history/medical-history.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MedicalHistoryComponent } from './medical-history.component'; + +describe('MedicalHistoryComponent', () => { + let component: MedicalHistoryComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ MedicalHistoryComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(MedicalHistoryComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/src/app/pages/medical-history/medical-history.component.ts b/frontend/src/app/pages/medical-history/medical-history.component.ts new file mode 100644 index 00000000..cc54add2 --- /dev/null +++ b/frontend/src/app/pages/medical-history/medical-history.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-medical-history', + templateUrl: './medical-history.component.html', + styleUrls: ['./medical-history.component.scss'] +}) +export class MedicalHistoryComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/frontend/src/app/pages/medical-sources/medical-sources.component.html b/frontend/src/app/pages/medical-sources/medical-sources.component.html index 1f090661..f3f3e449 100644 --- a/frontend/src/app/pages/medical-sources/medical-sources.component.html +++ b/frontend/src/app/pages/medical-sources/medical-sources.component.html @@ -30,7 +30,7 @@
- client +
diff --git a/frontend/src/app/pages/medical-sources/medical-sources.component.ts b/frontend/src/app/pages/medical-sources/medical-sources.component.ts index 4d6b91f8..55957a1d 100644 --- a/frontend/src/app/pages/medical-sources/medical-sources.component.ts +++ b/frontend/src/app/pages/medical-sources/medical-sources.component.ts @@ -1,20 +1,17 @@ import {Component, OnInit} from '@angular/core'; import {LighthouseService} from '../../services/lighthouse.service'; -import {FastenDbService} from '../../services/fasten-db.service'; -import {LighthouseSourceMetadata} from '../../../lib/models/lighthouse/lighthouse-source-metadata'; -import {Source} from '../../../lib/models/database/source'; +import {FastenApiService} from '../../services/fasten-api.service'; +import {LighthouseSourceMetadata} from '../../models/lighthouse/lighthouse-source-metadata'; +import {Source} from '../../models/fasten/source'; import {getAccessTokenExpiration, jwtDecode} from 'fhirclient/lib/lib'; import BrowserAdapter from 'fhirclient/lib/adapters/BrowserAdapter'; import {MetadataSource} from '../../models/fasten/metadata-source'; import {ModalDismissReasons, NgbModal} from '@ng-bootstrap/ng-bootstrap'; import {ActivatedRoute, Router} from '@angular/router'; import {Location} from '@angular/common'; -import {SourceType} from '../../../lib/models/database/source_types'; -import {QueueService} from '../../workers/queue.service'; import {ToastService} from '../../services/toast.service'; import {ToastNotification, ToastType} from '../../models/fasten/toast'; import {SourceSyncMessage} from '../../models/queue/source-sync-message'; -import {UpsertSummary} from '../../../lib/models/fasten/upsert-summary'; import {environment} from '../../../environments/environment'; // If you dont import this angular will import the wrong "Location" @@ -35,15 +32,15 @@ export class MedicalSourcesComponent implements OnInit { constructor( private lighthouseApi: LighthouseService, - private fastenDb: FastenDbService, + private fastenApi: FastenApiService, private modalService: NgbModal, private route: ActivatedRoute, private router: Router, private location: Location, - private queueService: QueueService, private toastService: ToastService ) { } + environment_name = environment.environment_name status: { [name: string]: string } = {} @@ -66,9 +63,9 @@ export class MedicalSourcesComponent implements OnInit { this.callback(callbackSourceType).then(console.log) } - this.fastenDb.GetSources() - .then((paginatedList) => { - const sourceList = paginatedList.rows as Source[] + this.fastenApi.getSources() + .subscribe((paginatedList: Source[]) => { + const sourceList = paginatedList as Source[] for (const sourceType in this.metadataSources) { let isConnected = false @@ -167,7 +164,7 @@ export class MedicalSourcesComponent implements OnInit { //Create FHIR Client const dbSourceCredential = new Source({ - source_type: sourceType as SourceType, + source_type: sourceType, authorization_endpoint: sourceMetadata.authorization_endpoint, token_endpoint: sourceMetadata.token_endpoint, @@ -194,9 +191,44 @@ export class MedicalSourcesComponent implements OnInit { expires_at: parseInt(getAccessTokenExpiration(payload, new BrowserAdapter())), }) - await this.fastenDb.UpsertSource(dbSourceCredential).then(console.log) - this.queueSourceSyncWorker(sourceType as SourceType, dbSourceCredential) + this.fastenApi.createSource(dbSourceCredential) + .subscribe((msg) => { + // const sourceSyncMessage = JSON.parse(msg) as SourceSyncMessage + delete this.status[sourceType] + // window.location.reload(); + console.log("source sync-all response:", msg) + //remove item from available sources list, add to connected sources. + this.availableSourceList.splice(this.availableSourceList.findIndex((item) => item.metadata.source_type == sourceType), 1); + if(this.connectedSourceList.findIndex((item) => item.metadata.source_type == sourceType) == -1){ + //only add this as a connected source if its "new" + this.connectedSourceList.push({source: msg, metadata: this.metadataSources[sourceType]}) + } + + const toastNotification = new ToastNotification() + toastNotification.type = ToastType.Success + toastNotification.message = `Successfully connected ${sourceType}` + + // const upsertSummary = sourceSyncMessage.response as UpsertSummary + // if(upsertSummary && upsertSummary.totalResources != upsertSummary.updatedResources.length){ + // toastNotification.message += `\n (total: ${upsertSummary.totalResources}, updated: ${upsertSummary.updatedResources.length})` + // } else if(upsertSummary){ + // toastNotification.message += `\n (total: ${upsertSummary.totalResources})` + // } + + this.toastService.show(toastNotification) + }, + (err) => { + delete this.status[sourceType] + // window.location.reload(); + + const toastNotification = new ToastNotification() + toastNotification.type = ToastType.Error + toastNotification.message = `An error occurred while accessing ${sourceType}: ${err}` + toastNotification.autohide = false + this.toastService.show(toastNotification) + console.error(err) + }); }) } @@ -208,15 +240,15 @@ export class MedicalSourcesComponent implements OnInit { public uploadSourceBundleHandler(event) { this.uploadedFile = [event.addedFiles[0]] //TODO: handle manual bundles. - // this.fastenDb.CreateManualSource(event.addedFiles[0]).subscribe( - // (respData) => { - // console.log("source manual source create response:", respData) - // }, - // (err) => {console.log(err)}, - // () => { - // this.uploadedFile = [] - // } - // ) + this.fastenApi.createManualSource(event.addedFiles[0]).subscribe( + (respData) => { + console.log("source manual source create response:", respData) + }, + (err) => {console.log(err)}, + () => { + this.uploadedFile = [] + } + ) } public openModal(contentModalRef, sourceListItem: SourceListItem) { @@ -234,56 +266,22 @@ export class MedicalSourcesComponent implements OnInit { this.status[source.source_type] = "authorize" this.modalService.dismissAll() - this.queueSourceSyncWorker(source.source_type as SourceType, source) + this.fastenApi.syncSource(source.id).subscribe( + (respData) => { + delete this.status[source.source_type] + console.log("source sync response:", respData) + }, + (err) => { + delete this.status[source.source_type] + console.log(err) + } + ) } /////////////////////////////////////////////////////////////////////////////////////// // Private /////////////////////////////////////////////////////////////////////////////////////// - private queueSourceSyncWorker(sourceType: SourceType, source: Source){ - //this work is pushed to the Sync Worker. - //TODO: if the user closes the browser the data update may not complete. we should set a status flag when "starting" sync, and then remove it when compelte - // so that we can show incompelte statuses - this.queueService.runSourceSyncWorker(source) - .subscribe((msg) => { - const sourceSyncMessage = JSON.parse(msg) as SourceSyncMessage - delete this.status[sourceType] - // window.location.reload(); - - console.log("source sync-all response:", sourceSyncMessage) - //remove item from available sources list, add to connected sources. - this.availableSourceList.splice(this.availableSourceList.findIndex((item) => item.metadata.source_type == sourceType), 1); - if(this.connectedSourceList.findIndex((item) => item.metadata.source_type == sourceType) == -1){ - //only add this as a connected source if its "new" - this.connectedSourceList.push({source: sourceSyncMessage.source, metadata: this.metadataSources[sourceType]}) - } - - const toastNotification = new ToastNotification() - toastNotification.type = ToastType.Success - toastNotification.message = `Successfully connected ${sourceType}` - - const upsertSummary = sourceSyncMessage.response as UpsertSummary - if(upsertSummary && upsertSummary.totalResources != upsertSummary.updatedResources.length){ - toastNotification.message += `\n (total: ${upsertSummary.totalResources}, updated: ${upsertSummary.updatedResources.length})` - } else if(upsertSummary){ - toastNotification.message += `\n (total: ${upsertSummary.totalResources})` - } - - this.toastService.show(toastNotification) - }, - (err) => { - delete this.status[sourceType] - // window.location.reload(); - - const toastNotification = new ToastNotification() - toastNotification.type = ToastType.Error - toastNotification.message = `An error occurred while accessing ${sourceType}: ${err}` - toastNotification.autohide = false - this.toastService.show(toastNotification) - console.error(err) - }); - } private getDismissReason(reason: any): string { if (reason === ModalDismissReasons.ESC) { diff --git a/frontend/src/app/pages/patient-profile/patient-profile.component.html b/frontend/src/app/pages/patient-profile/patient-profile.component.html new file mode 100644 index 00000000..d06092fc --- /dev/null +++ b/frontend/src/app/pages/patient-profile/patient-profile.component.html @@ -0,0 +1,191 @@ +
+
+
+ + +
+
+

Patient Profile

+
+
+

+ Patient: Caldwell, Ruben
+ Address: 123 B Street
Gainsville, FL, 94153
+ Date of Birth: June 20, 1929
+ Phone: 415-343-2342
+ Email: myemail@gmail.com +

+
+
+

+ Primary Care: Bishop, J. ANRP
+ Address: Malcom Randall VA
Medical Center Gainsville FL
+ Phone: 123-321-5532
+ Email: myemail@va.com
+

+
+
+ +
+ +
+
+

Caldwell, Ruben

+
+
+ + +
+
+

Patient

+ +
+
+ First Name: +
+
+ Ruben +
+ +
+ Last Name: +
+
+ Caldwell +
+ +
+ Gender: +
+
+ M +
+ +
+ Martial Status: +
+
+ Married +
+ +
+ Religious Affil: +
+
+ N/A +
+ +
+ Ethnicity: +
+
+ White/Caucation +
+ +
+ Language: +
+
+ English +
+ +
+ Address: +
+
+ 123 B Street
Gainsville, FL, 94153
+
+ +
+ Date of Birth: +
+
+ June 20, 1929 +
+ +
+ Phone: +
+
+ 415-343-2342 +
+ +
+ Email: +
+
+ myemail@gmail.com +
+ +
+ +
+
+

Care Provider

+ +
+
+ Primary Care: +
+
+ Bishop, J. ANRP +
+ +
+ Address: +
+
+ Malcom Randall VA
Medical Center Gainsville FL +
+ +
+ Phone: +
+
+ 123-321-5532 +
+ +
+ Email: +
+
+ myemail@va.com +
+ +
+
+
+ + + +
+
+

Immunizations

+ +

+ Phenumovax
+ 07/09/2022
+
+ Hepatitis B Series [complete]
+ 01/12/2005
+
+ Tetanus Toxoid [complete]
+ 02/02/2010
+

+ +
+
+

Allergies

+ +

+ Latex
+ (AV/Historical) with rash and agitation
+
+ +

+
+
+
+
+
+
diff --git a/frontend/src/app/pages/patient-profile/patient-profile.component.scss b/frontend/src/app/pages/patient-profile/patient-profile.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/frontend/src/app/pages/patient-profile/patient-profile.component.spec.ts b/frontend/src/app/pages/patient-profile/patient-profile.component.spec.ts new file mode 100644 index 00000000..5686085d --- /dev/null +++ b/frontend/src/app/pages/patient-profile/patient-profile.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PatientProfileComponent } from './patient-profile.component'; + +describe('PatientProfileComponent', () => { + let component: PatientProfileComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PatientProfileComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(PatientProfileComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/src/app/pages/patient-profile/patient-profile.component.ts b/frontend/src/app/pages/patient-profile/patient-profile.component.ts new file mode 100644 index 00000000..16e7c269 --- /dev/null +++ b/frontend/src/app/pages/patient-profile/patient-profile.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-patient-profile', + templateUrl: './patient-profile.component.html', + styleUrls: ['./patient-profile.component.scss'] +}) +export class PatientProfileComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/frontend/src/app/pages/patient/patient.component.html b/frontend/src/app/pages/patient/patient.component.html deleted file mode 100644 index dc62028c..00000000 --- a/frontend/src/app/pages/patient/patient.component.html +++ /dev/null @@ -1,186 +0,0 @@ - -
-
-
-
-
Edit Profile
-
-
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
-
- -
-
-
-
-
-

-
-
-
-
-
- - ... - -
Mike Andrew
-
-

Ceo/Co-Founder

-
-
- Do not be scared of the truth because we need to restart the human - foundation in truth And I love you like Kanye loves Kanye I love - Rick Owens’€™ bed design but the back is... -
-
- -
-
-
-
diff --git a/frontend/src/app/pages/patient/patient.component.ts b/frontend/src/app/pages/patient/patient.component.ts deleted file mode 100644 index 7a4b5ebe..00000000 --- a/frontend/src/app/pages/patient/patient.component.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Component, OnInit } from "@angular/core"; - -@Component({ - selector: "app-patient", - templateUrl: "patient.component.html" -}) -export class PatientComponent implements OnInit { - constructor() {} - - ngOnInit() {} -} 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 7b325184..1f92d236 100644 --- a/frontend/src/app/pages/resource-detail/resource-detail.component.ts +++ b/frontend/src/app/pages/resource-detail/resource-detail.component.ts @@ -1,8 +1,7 @@ import { Component, OnInit } from '@angular/core'; -import {FastenDbService} from '../../services/fasten-db.service'; +import {FastenApiService} from '../../services/fasten-api.service'; import {ActivatedRoute, Router} from '@angular/router'; -import {ResourceFhir} from '../../../lib/models/database/resource_fhir'; -import {Base64} from '../../../lib/utils/base64'; +import {ResourceFhir} from '../../models/fasten/resource_fhir'; @Component({ selector: 'app-resource-detail', @@ -14,23 +13,16 @@ export class ResourceDetailComponent implements OnInit { sourceName: string = "" resource: ResourceFhir = null - constructor(private fastenDb: FastenDbService, private router: Router, private route: ActivatedRoute) { + constructor(private fastenApi: FastenApiService, private router: Router, private route: ActivatedRoute) { } ngOnInit(): void { - //always request the resource by id - let resourceId = Base64.Decode(this.route.snapshot.paramMap.get('resource_id')) - if (resourceId){ - this.fastenDb.GetResource(resourceId) - .then((resourceFhir) => { - this.resource = resourceFhir; - }); - this.sourceId = resourceId.split(":")[1] - this.sourceName = Base64.Decode(this.sourceId).split(":")[1] - } else { - console.log("invalid or missing resource id") - } - + this.fastenApi.getResourceBySourceId(this.route.snapshot.paramMap.get('source_id'), this.route.snapshot.paramMap.get('resource_id')).subscribe((resourceFhir) => { + console.log("RESOURECE FHIR", resourceFhir) + this.resource = resourceFhir; + this.sourceId = this.route.snapshot.paramMap.get('source_id') + this.sourceName = "unknown" //TODO popualte this + }); } } diff --git a/frontend/src/app/pages/source-detail/source-detail.component.html b/frontend/src/app/pages/source-detail/source-detail.component.html index d284dabb..077b8a2d 100644 --- a/frontend/src/app/pages/source-detail/source-detail.component.html +++ b/frontend/src/app/pages/source-detail/source-detail.component.html @@ -18,7 +18,7 @@

{{getPatientName()}}

diff --git a/frontend/src/app/pages/source-detail/source-detail.component.ts b/frontend/src/app/pages/source-detail/source-detail.component.ts index 7e99da8e..ae205185 100644 --- a/frontend/src/app/pages/source-detail/source-detail.component.ts +++ b/frontend/src/app/pages/source-detail/source-detail.component.ts @@ -1,11 +1,9 @@ import {Component, OnInit, ViewChild} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; -import {Source} from '../../../lib/models/database/source'; -import {FastenDbService} from '../../services/fasten-db.service'; -import {ResourceFhir} from '../../../lib/models/database/resource_fhir'; +import {Source} from '../../models/fasten/source'; +import {FastenApiService} from '../../services/fasten-api.service'; +import {ResourceFhir} from '../../models/fasten/resource_fhir'; import {getPath} from '../../components/list-generic-resource/utils'; -import {Base64} from '../../../lib/utils/base64'; - @Component({ selector: 'app-source-detail', @@ -20,7 +18,7 @@ export class SourceDetailComponent implements OnInit { resourceTypeCounts: { [name: string]: number } = {} - constructor(private fastenDb: FastenDbService, private router: Router, private route: ActivatedRoute) { + constructor(private fastenApi: FastenApiService, private router: Router, private route: ActivatedRoute) { //check if the current Source was sent over using the router state storage: if(this.router.getCurrentNavigation()?.extras?.state){ this.selectedSource = this.router.getCurrentNavigation().extras.state as Source @@ -29,7 +27,7 @@ export class SourceDetailComponent implements OnInit { ngOnInit(): void { //always request the source summary - this.fastenDb.GetSourceSummary(Base64.Decode(this.route.snapshot.paramMap.get('source_id'))).then((sourceSummary) => { + this.fastenApi.getSourceSummary(this.route.snapshot.paramMap.get('source_id')).subscribe((sourceSummary) => { this.selectedSource = sourceSummary.source; this.selectedPatient = sourceSummary.patient; for(let resourceTypeCount of sourceSummary.resource_type_counts){ diff --git a/frontend/src/app/services/auth-interceptor.service.ts b/frontend/src/app/services/auth-interceptor.service.ts index 521140d7..d5761f9d 100644 --- a/frontend/src/app/services/auth-interceptor.service.ts +++ b/frontend/src/app/services/auth-interceptor.service.ts @@ -1,6 +1,5 @@ import { Injectable, Injector } from '@angular/core'; import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http'; -import { FastenDbService } from './fasten-db.service'; import {Router} from '@angular/router'; import {Observable, of, throwError} from 'rxjs'; import {catchError} from 'rxjs/operators'; @@ -30,40 +29,61 @@ export class AuthInterceptorService implements HttpInterceptor { } intercept(req: HttpRequest, next: HttpHandler): Observable> { - let authToken = this.authService.GetAuthToken() - if(!authToken){ - //no authToken available, lets just handle the request as-is - return next.handle(req) - } - //only intercept requests to the Fasten API, Database & Lighthouse, all other requests should be sent as-is + console.log("Intercepting Request", req) + + //only intercept requests to the fasten API & lighthouse, all other requests should be sent as-is let reqUrl = new URL(req.url) let lighthouseUrl = new URL(GetEndpointAbsolutePath(globalThis.location, environment.lighthouse_api_endpoint_base)) let apiUrl = new URL(GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)) - //skip database, header is sent automatically via PouchDB - // let databaseUrl = new URL(GetEndpointAbsolutePath(globalThis.location, environment.couchdb_endpoint_base)) - if( - (reqUrl.origin == lighthouseUrl.origin && reqUrl.pathname.startsWith(lighthouseUrl.pathname)) + !((reqUrl.origin == apiUrl.origin && reqUrl.pathname.startsWith(apiUrl.pathname)) || + (reqUrl.origin == lighthouseUrl.origin && reqUrl.pathname.startsWith(lighthouseUrl.pathname))) ){ - //all requests to the lighthouse require the JWT - console.log("making authorized request...") - // Clone the request to add the new auth header. - const authReq = req.clone({headers: req.headers.set('Authorization', 'Bearer ' + this.authService.GetAuthToken())}); - // catch the error, make specific functions for catching specific errors and you can chain through them with more catch operators - return next.handle(authReq).pipe(catchError(x=> this.handleAuthError(x))); //here use an arrow function, otherwise you may get "Cannot read property 'navigate' of undefined" on angular 4.4.2/net core 2/webpack 2.70 + return next.handle(req) } - // else if(){ - // //TODO: only CORS requests to the API endpoint require JWT, but they also require a custom header. - // - // //(reqUrl.origin == lighthouseUrl.origin && reqUrl.pathname.startsWith(lighthouseUrl.pathname)) || - // // () || - // // (reqUrl.origin == apiUrl.origin && reqUrl.pathname.startsWith(apiUrl.pathname)) - // - // } - return next.handle(req) + // Clone the request to add the new header. + const authReq = req.clone({headers: req.headers.set('Authorization', 'Bearer ' + this.authService.GetAuthToken())}); + // catch the error, make specific functions for catching specific errors and you can chain through them with more catch operators + return next.handle(authReq).pipe(catchError(x=> this.handleAuthError(x))); //here use an arrow function, otherwise you may get "Cannot read property 'navigate' of undefined" on angular 4.4.2/net core 2/webpack 2.70 + + + // let authToken = this.authService.GetAuthToken() + // if(!authToken){ + // //no authToken available, lets just handle the request as-is + // return next.handle(req) + // } + // + // //only intercept requests to the Fasten API, Database & Lighthouse, all other requests should be sent as-is + // let reqUrl = new URL(req.url) + // let lighthouseUrl = new URL(GetEndpointAbsolutePath(globalThis.location, environment.lighthouse_api_endpoint_base)) + // let apiUrl = new URL(GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)) + // + // //skip database, header is sent automatically via PouchDB + // // let databaseUrl = new URL(GetEndpointAbsolutePath(globalThis.location, environment.couchdb_endpoint_base)) + // + // if( + // (reqUrl.origin == lighthouseUrl.origin && reqUrl.pathname.startsWith(lighthouseUrl.pathname)) + // ){ + // //all requests to the lighthouse require the JWT + // console.log("making authorized request...") + // // Clone the request to add the new auth header. + // const authReq = req.clone({headers: req.headers.set('Authorization', 'Bearer ' + this.authService.GetAuthToken())}); + // // catch the error, make specific functions for catching specific errors and you can chain through them with more catch operators + // return next.handle(authReq).pipe(catchError(x=> this.handleAuthError(x))); //here use an arrow function, otherwise you may get "Cannot read property 'navigate' of undefined" on angular 4.4.2/net core 2/webpack 2.70 + // } + // // else if(){ + // // //TODO: only CORS requests to the API endpoint require JWT, but they also require a custom header. + // // + // // //(reqUrl.origin == lighthouseUrl.origin && reqUrl.pathname.startsWith(lighthouseUrl.pathname)) || + // // // () || + // // // (reqUrl.origin == apiUrl.origin && reqUrl.pathname.startsWith(apiUrl.pathname)) + // // + // // } + // + // return next.handle(req) } } diff --git a/frontend/src/app/services/auth.service.ts b/frontend/src/app/services/auth.service.ts index ec6d70a7..504db3da 100644 --- a/frontend/src/app/services/auth.service.ts +++ b/frontend/src/app/services/auth.service.ts @@ -1,13 +1,11 @@ import { Injectable } from '@angular/core'; import {HttpClient, HttpHeaders} from '@angular/common/http'; -import {FastenDbService} from './fasten-db.service'; -import {User} from '../../lib/models/fasten/user'; +import {User} from '../models/fasten/user'; import {environment} from '../../environments/environment'; import {GetEndpointAbsolutePath} from '../../lib/utils/endpoint_absolute_path'; import {ResponseWrapper} from '../models/response-wrapper'; import * as Oauth from '@panva/oauth4webapi'; import {SourceState} from '../models/fasten/source-state'; -import {Session} from '../models/database/session'; import * as jose from 'jose'; import {UserRegisteredClaims} from '../models/fasten/user-registered-claims'; @@ -137,25 +135,29 @@ export class AuthService { if(!hasAuthToken){ return false } - //check if the authToken works - let databaseEndpointBase = GetEndpointAbsolutePath(globalThis.location, environment.couchdb_endpoint_base) - try { - let resp = await this._httpClient.get(`${databaseEndpointBase}/_session`, { - headers: new HttpHeaders({ - 'Content-Type': 'application/json', - Authorization: `Bearer ${authToken}` - }) - }).toPromise() - // logic to check if user is logged in here. - let session = resp as Session - if(!session.ok || session?.info?.authenticated != "jwt" || !session.userCtx?.name){ - //invalid session, not jwt auth, or username is empty - return false - } - return true - } catch (e) { - return false - } + + //todo: check if the authToken has expired + return true + + // //check if the authToken has expired. + // let databaseEndpointBase = GetEndpointAbsolutePath(globalThis.location, environment.couchdb_endpoint_base) + // try { + // let resp = await this._httpClient.get(`${databaseEndpointBase}/_session`, { + // headers: new HttpHeaders({ + // 'Content-Type': 'application/json', + // Authorization: `Bearer ${authToken}` + // }) + // }).toPromise() + // // logic to check if user is logged in here. + // let session = resp as Session + // if(!session.ok || session?.info?.authenticated != "jwt" || !session.userCtx?.name){ + // //invalid session, not jwt auth, or username is empty + // return false + // } + // return true + // } catch (e) { + // return false + // } } public GetAuthToken(): string { diff --git a/frontend/src/app/services/fasten-db.service.spec.ts b/frontend/src/app/services/fasten-api.service.spec.ts similarity index 64% rename from frontend/src/app/services/fasten-db.service.spec.ts rename to frontend/src/app/services/fasten-api.service.spec.ts index e000a460..aa4d7cc8 100644 --- a/frontend/src/app/services/fasten-db.service.spec.ts +++ b/frontend/src/app/services/fasten-api.service.spec.ts @@ -1,16 +1,16 @@ import { TestBed } from '@angular/core/testing'; -import { FastenDbService } from './fasten-db.service'; +import { FastenApiService } from './fasten-api.service'; import {HttpClientTestingModule} from '@angular/common/http/testing'; -describe('FastenDbService', () => { - let service: FastenDbService; +describe('FastenApiService', () => { + let service: FastenApiService; beforeEach(() => { TestBed.configureTestingModule({ imports: [HttpClientTestingModule], }); - service = TestBed.inject(FastenDbService); + service = TestBed.inject(FastenApiService); }); it('should be created', () => { diff --git a/frontend/src/app/services/fasten-api.service.ts b/frontend/src/app/services/fasten-api.service.ts new file mode 100644 index 00000000..b6f6186b --- /dev/null +++ b/frontend/src/app/services/fasten-api.service.ts @@ -0,0 +1,131 @@ +import { Injectable } from '@angular/core'; +import { HttpClient, HttpHeaders } from '@angular/common/http'; +import {Observable} from 'rxjs'; +import { Router } from '@angular/router'; +import {map} from 'rxjs/operators'; +import {ResponseWrapper} from '../models/response-wrapper'; +import {Source} from '../models/fasten/source'; +import {User} from '../models/fasten/user'; +import {ResourceFhir} from '../models/fasten/resource_fhir'; +import {SourceSummary} from '../models/fasten/source-summary'; +import {Summary} from '../models/fasten/summary'; +import {MetadataSource} from '../models/fasten/metadata-source'; +import {AuthService} from './auth.service'; +import {GetEndpointAbsolutePath} from '../../lib/utils/endpoint_absolute_path'; +import {environment} from '../../environments/environment'; + +@Injectable({ + providedIn: 'root' +}) +export class FastenApiService { + + constructor(private _httpClient: HttpClient, private router: Router, private authService: AuthService) { + } + + + /* + SECURE ENDPOINTS + */ + getSummary(): Observable { + return this._httpClient.get(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/summary`, ) + .pipe( + map((response: ResponseWrapper) => { + console.log("Summary RESPONSE", response) + return response.data as Summary + }) + ); + } + + createSource(source: Source): Observable { + return this._httpClient.post(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/source`, source) + .pipe( + map((response: ResponseWrapper) => { + console.log("SOURCE RESPONSE", response) + return response.data as Source + }) + ); + } + + createManualSource(file: File): Observable { + + const formData = new FormData(); + formData.append('file', file); + + return this._httpClient.post(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/source/manual`, formData) + .pipe( + map((response: ResponseWrapper) => { + console.log("MANUAL SOURCE RESPONSE", response) + return response.data as Source + }) + ); + } + + getSources(): Observable { + return this._httpClient.get(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/source`) + .pipe( + map((response: ResponseWrapper) => { + console.log("SOURCE RESPONSE", response) + return response.data as Source[] + }) + ); + } + + getSource(sourceId: string): Observable { + return this._httpClient.get(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/source/${sourceId}`) + .pipe( + map((response: ResponseWrapper) => { + console.log("SOURCE RESPONSE", response) + return response.data as Source + }) + ); + } + + getSourceSummary(sourceId: string): Observable { + return this._httpClient.get(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/source/${sourceId}/summary`) + .pipe( + map((response: ResponseWrapper) => { + console.log("SOURCE RESPONSE", response) + return response.data as SourceSummary + }) + ); + } + + syncSource(sourceId: string): Observable { + return this._httpClient.post(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/source/${sourceId}/sync`, {}) + .pipe( + map((response: ResponseWrapper) => { + console.log("SOURCE RESPONSE", response) + return response.data + }) + ); + } + + getResources(sourceResourceType?: string, sourceID?: string): Observable { + let queryParams = {} + if(sourceResourceType){ + queryParams["sourceResourceType"] = sourceResourceType + } + if(sourceID){ + queryParams["sourceID"] = sourceID + } + + return this._httpClient.get(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/resource/fhir`, {params: queryParams}) + .pipe( + map((response: ResponseWrapper) => { + console.log("RESPONSE", response) + return response.data as ResourceFhir[] + }) + ); + } + + getResourceBySourceId(sourceId: string, resourceId: string): Observable { + + return this._httpClient.get(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/resource/fhir/${sourceId}/${resourceId}`) + .pipe( + map((response: ResponseWrapper) => { + console.log("RESPONSE", response) + return response.data as ResourceFhir + }) + ); + } +} diff --git a/frontend/src/app/services/fasten-db.service.ts b/frontend/src/app/services/fasten-db.service.ts deleted file mode 100644 index 0db7e0bd..00000000 --- a/frontend/src/app/services/fasten-db.service.ts +++ /dev/null @@ -1,147 +0,0 @@ -import { Injectable } from '@angular/core'; -import {PouchdbRepository} from '../../lib/database/pouchdb_repository'; -import {User} from '../../lib/models/fasten/user'; -import {ResponseWrapper} from '../models/response-wrapper'; -import {HttpClient} from '@angular/common/http'; -import {Summary} from '../../lib/models/fasten/summary'; -import {DocType} from '../../lib/database/constants'; -import {ResourceTypeCounts} from '../../lib/models/fasten/source-summary'; -import {Base64} from '../../lib/utils/base64'; -import * as jose from 'jose' - -// PouchDB & plugins (must be similar to the plugins specified in pouchdb repository) -import * as PouchDB from 'pouchdb/dist/pouchdb'; -import find from 'pouchdb-find'; -PouchDB.plugin(find); //does not work in -import * as PouchUpsert from 'pouchdb-upsert'; -PouchDB.plugin(PouchUpsert); -import * as PouchCrypto from 'crypto-pouch'; -PouchDB.plugin(PouchCrypto); -import PouchAuth from 'pouchdb-authentication' -import {PouchdbCrypto} from '../../lib/database/plugins/crypto'; -import {environment} from '../../environments/environment'; -import {GetEndpointAbsolutePath} from '../../lib/utils/endpoint_absolute_path'; -import {AuthService} from './auth.service'; -PouchDB.plugin(PouchAuth); - -@Injectable({ - providedIn: 'root' -}) -export class FastenDbService extends PouchdbRepository { - - - // There are 3 different ways to initialize the Database - // - explicitly after signin/signup - // - explicitly during web-worker init (not supported by this class, see PouchdbRepository.NewPouchdbRepositoryWebWorker) - // - implicitly after Lighthouse redirect (when user is directed back to the app) - // Three peices of information are required during intialization - // - couchdb endpoint (constant, see environment.couchdb_endpoint_base) - // - username - // - JWT token - constructor(private _httpClient: HttpClient, private authService: AuthService) { - super(environment.couchdb_endpoint_base); - } - - - /** - * Try to get PouchDB database using token auth information - * This method must handle 2 types of authentication - * - pouchdb init after signin/signup - * - implicit init after lighthouse redirect - * @constructor - */ - public override async GetSessionDB(): Promise { - if(this.pouchDb){ - console.log("Session DB already exists..") - return this.pouchDb - } - - //check if we have a JWT token (we should, otherwise the auth-guard would have redirected to login page) - let authToken = this.authService.GetAuthToken() - if(!authToken){ - throw new Error("no auth token found") - } - - //parse the authToken to get user information - this.current_user = this.authService.GetCurrentUser().sub - - // add JWT bearer token header to all requests - // https://stackoverflow.com/questions/62129654/how-to-handle-jwt-authentication-with-rxdb - this.pouchDb = new PouchDB(this.getRemoteUserDb(this.current_user), { - fetch: function (url, opts) { - opts.headers.set('Authorization', `Bearer ${authToken}`) - return PouchDB.fetch(url, opts); - } - }) - return this.pouchDb - } - - /** - * Is the crypto configuration for the authenticated user already available in the browser? Or do we need to import/generate new config. - */ - public async isCryptConfigAvailable(): Promise{ - try { - await this.GetSessionDB() - let cryptConfig = await PouchdbCrypto.RetrieveCryptConfig(this.current_user) - - return !!cryptConfig - }catch(e){ - return false - } - } - - - public Close(): Promise { - return super.Close() - } - - /////////////////////////////////////////////////////////////////////////////////////// - // Summary - - public async GetSummary(): Promise { - const summary = new Summary() - summary.sources = await this.GetSources() - .then((paginatedResp) => paginatedResp.rows) - - // summary.patients = [] - summary.patients = await this.GetDB() - .then((db) => { - - return db.find({ - selector: { - doc_type: DocType.ResourceFhir, - source_resource_type: "Patient", - } - }).then((results) => { - return Promise.all((results.docs || []).map((doc) => PouchdbCrypto.decryptDocument(db, doc))) - }) - }) - - - summary.resource_type_counts = await this.findDocumentByPrefix(`${DocType.ResourceFhir}`, false) - .then((paginatedResp) => { - const lookup: {[name: string]: ResourceTypeCounts} = {} - paginatedResp?.rows.forEach((resourceWrapper) => { - const resourceIdParts = resourceWrapper.id.split(':') - const resourceType = resourceIdParts[2] - - let currentResourceStats = lookup[resourceType] || { - count: 0, - source_id: Base64.Decode(resourceIdParts[1]), - resource_type: resourceType - } - currentResourceStats.count += 1 - lookup[resourceType] = currentResourceStats - }) - - const arr = [] - for(let key in lookup){ - arr.push(lookup[key]) - } - return arr - }) - - - return summary - } -} diff --git a/frontend/src/app/services/lighthouse.service.ts b/frontend/src/app/services/lighthouse.service.ts index a5a1f1e4..01df8bf5 100644 --- a/frontend/src/app/services/lighthouse.service.ts +++ b/frontend/src/app/services/lighthouse.service.ts @@ -4,7 +4,7 @@ import {Observable} from 'rxjs'; import {environment} from '../../environments/environment'; import {map, tap} from 'rxjs/operators'; import {ResponseWrapper} from '../models/response-wrapper'; -import {LighthouseSourceMetadata} from '../../lib/models/lighthouse/lighthouse-source-metadata'; +import {LighthouseSourceMetadata} from '../models/lighthouse/lighthouse-source-metadata'; import * as Oauth from '@panva/oauth4webapi'; import {SourceState} from '../models/fasten/source-state'; import {MetadataSource} from '../models/fasten/metadata-source'; diff --git a/frontend/src/app/workers/queue.service.spec.ts b/frontend/src/app/workers/queue.service.spec.ts deleted file mode 100644 index 4f509ce4..00000000 --- a/frontend/src/app/workers/queue.service.spec.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { QueueService } from './queue.service'; -import {HttpClientTestingModule} from '@angular/common/http/testing'; - -describe('QueueService', () => { - let service: QueueService; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [HttpClientTestingModule], - }); - service = TestBed.inject(QueueService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/frontend/src/app/workers/queue.service.ts b/frontend/src/app/workers/queue.service.ts deleted file mode 100644 index ccdc2eff..00000000 --- a/frontend/src/app/workers/queue.service.ts +++ /dev/null @@ -1,45 +0,0 @@ -import {Injectable} from '@angular/core'; -import {Observable, of} from 'rxjs'; -import {fromWorker} from 'observable-webworker'; -import {Source} from '../../lib/models/database/source'; -import {SourceSyncMessage} from '../models/queue/source-sync-message'; -import {ToastService} from '../services/toast.service'; -import {ToastNotification, ToastType} from '../models/fasten/toast'; -import {FastenDbService} from '../services/fasten-db.service'; -import {environment} from '../../environments/environment'; -import {AuthService} from '../services/auth.service'; - -@Injectable({ - providedIn: 'root' -}) -export class QueueService { - - constructor(private toastService: ToastService, private authService: AuthService) { } - - runSourceSyncWorker(source: Source):Observable { - if (typeof Worker !== 'undefined') { - const sourceSync = new SourceSyncMessage() - sourceSync.source = source - sourceSync.current_user = this.authService.GetCurrentUser().sub - sourceSync.auth_token = this.authService.GetAuthToken() - sourceSync.couchdb_endpoint_base = environment.couchdb_endpoint_base - sourceSync.fasten_api_endpoint_base = environment.fasten_api_endpoint_base - const input$: Observable = of(JSON.stringify(sourceSync)); - return fromWorker(() => new Worker(new URL('./source-sync.worker', import.meta.url), {type: 'module'}), input$) - // .subscribe(message => { - // console.log(`Got message`, message); - // }); - }else { - // Web workers are not supported in this environment. - // You should add a fallback so that your program still executes correctly. - console.error("WORKERS ARE NOT SUPPORTED") - - const toastNotificaiton = new ToastNotification() - toastNotificaiton.type = ToastType.Error - toastNotificaiton.message = "Your browser does not support web-workers. Cannot continue." - toastNotificaiton.autohide = false - this.toastService.show(toastNotificaiton) - } - - } -} diff --git a/frontend/src/app/workers/source-sync.worker.ts b/frontend/src/app/workers/source-sync.worker.ts deleted file mode 100644 index 2635f5cf..00000000 --- a/frontend/src/app/workers/source-sync.worker.ts +++ /dev/null @@ -1,71 +0,0 @@ -/// - -import {DoWork, runWorker} from 'observable-webworker'; -import {Observable} from 'rxjs'; -import {mergeMap} from 'rxjs/operators'; -import {SourceSyncMessage} from '../models/queue/source-sync-message'; -import {NewPouchdbRepositoryWebWorker, PouchdbRepository} from '../../lib/database/pouchdb_repository'; -import {NewClient} from '../../lib/conduit/factory'; -import {Source} from '../../lib/models/database/source'; -import {ClientConfig} from '../../lib/models/client/client-config'; -import {client} from 'fhirclient'; - -export class SourceSyncWorker implements DoWork { - public work(input$: Observable): Observable { - return input$.pipe( - //mergeMap allows us to convert a promise into an observable - // https://stackoverflow.com/questions/53649294/how-to-handle-for-promise-inside-a-piped-map - mergeMap(msg => { - try { - console.log(msg); // outputs 'Hello from main thread' - const sourceSyncMessage = JSON.parse(msg) as SourceSyncMessage - - const db = NewPouchdbRepositoryWebWorker({current_user: sourceSyncMessage.current_user, auth_token: sourceSyncMessage.auth_token}, sourceSyncMessage.couchdb_endpoint_base) - - let clientConfig = new ClientConfig() - clientConfig.fasten_api_endpoint_base = sourceSyncMessage.fasten_api_endpoint_base - const client = NewClient(sourceSyncMessage.source.source_type, new Source(sourceSyncMessage.source), clientConfig) - //TODO: validate the FHIR version from the datasource matches the client - // if the source token has been refreshed, we need to store it in the DB. - // await db.UpsertSource() - - - //lets refresh the source information if required. - console.log("!!!!!!!!!!!!!!STARTING WORKER SYNC!!!!!!!!!", sourceSyncMessage) - return client.RefreshSourceToken() - .then((wasSourceRefreshed) => { - if(wasSourceRefreshed){ - //the source was updated, we need to save the updated source information - return db.UpsertSource(client.source) - .then(() => { - return client - }) - } - return client - }) - .then((client) => { - return client.SyncAll(db) - }) - .then((resp) => { - console.log("!!!!!!!!!!!!!COMPLETE WORKER SYNC!!!!!!!!!!", resp) - sourceSyncMessage.response = resp - return JSON.stringify(sourceSyncMessage) - - }) - .catch((err) => { - console.error("!!!!!!!!!!!!!ERROR WORKER SYNC!!!!!!!!!!", err) - throw err - }) - // return from(resp) - - } catch (e) { - console.log("CAUGHT ERROR", e) - console.trace(e) - throw e - } - }), - ); - } -} - -runWorker(SourceSyncWorker); diff --git a/frontend/src/lib/conduit/factory.ts b/frontend/src/lib/conduit/factory.ts deleted file mode 100644 index 0a4f5985..00000000 --- a/frontend/src/lib/conduit/factory.ts +++ /dev/null @@ -1,84 +0,0 @@ -import {SourceType} from '../models/database/source_types'; -import {Source} from '../models/database/source'; -import {IClient} from './interface'; - -import {HealthITClient} from './fhir/sandbox/healthit_client'; -import {LogicaClient} from './fhir/sandbox/logica_client'; -import {AthenaClient} from './fhir/sandbox/athena_client'; - -import {CareEvolutionClient} from './fhir/platforms/careevolution_client'; -import {CernerClient} from './fhir/platforms/cerner_client'; -import {EpicClient} from './fhir/platforms/epic_client'; - -import {AetnaClient} from './fhir/aetna_client'; -import {BlueButtonClient} from './fhir/bluebutton_client'; -import {CignaClient} from './fhir/cigna_client'; -import {ClientConfig} from '../models/client/client-config'; - -export function NewClient(sourceType: SourceType, source: Source, clientConfig: ClientConfig): IClient { - - switch(sourceType) { - - //sandbox - case SourceType.Athena: - return new AthenaClient(source, clientConfig) - case SourceType.HealthIT: - return new HealthITClient(source, clientConfig) - case SourceType.Logica: - return new LogicaClient(source, clientConfig ) - - //platforms - case SourceType.CareEvolution: - return new CareEvolutionClient(source, clientConfig) - case SourceType.Cerner: - return new CernerClient(source, clientConfig) - case SourceType.Epic: - return new EpicClient(source, clientConfig) - - //providers - case SourceType.Aetna: - return new AetnaClient(source, clientConfig) - - case SourceType.Amerigroup: - case SourceType.AmerigroupMedicaid: - case SourceType.Anthem: - case SourceType.AnthemBluecrossCA: - case SourceType.BluecrossBlueshieldKansasMedicare: - case SourceType.BluecrossBlueshieldKansas: - case SourceType.BluecrossBlueshieldNY: - case SourceType.BlueMedicareAdvantage: - case SourceType.ClearHealthAlliance: - case SourceType.DellChildrens: - case SourceType.EmpireBlue: - case SourceType.EmpireBlueMedicaid: - case SourceType.HealthyBlueLA: - case SourceType.HealthyBlueLAMedicaid: - case SourceType.HealthyBlueMO: - case SourceType.HealthyBlueMOMedicaid: - case SourceType.HealthyBlueNC: - case SourceType.HealthyBlueNCMedicaid: - case SourceType.HealthyBlueNE: - case SourceType.HealthyBlueSC: - case SourceType.HighmarkWesternNY: - case SourceType.SimplyHealthcareMedicaid: - case SourceType.SimplyHealthcareMedicare: - case SourceType.SummitCommunityCare: - case SourceType.Unicare: - case SourceType.UnicareMA: - case SourceType.UnicareMedicaid: - return new CareEvolutionClient(source, clientConfig) - - case SourceType.UCSF: - return new EpicClient(source, clientConfig) - - case SourceType.Cigna: - return new CignaClient(source, clientConfig) - case SourceType.BlueButton: - return new BlueButtonClient(source, clientConfig) - - // case SourceType.Manual: - // return new ManualClient(source) - default: - throw new Error(`Unknown Source Type: ${sourceType}`) - } -} diff --git a/frontend/src/lib/conduit/fhir/aetna_client.ts b/frontend/src/lib/conduit/fhir/aetna_client.ts deleted file mode 100644 index 0d3ba5d1..00000000 --- a/frontend/src/lib/conduit/fhir/aetna_client.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {IClient} from '../interface'; -import {FHIR401Client} from './base/fhir401_r4_client'; -import {Source} from '../../models/database/source'; -import {IDatabaseRepository} from '../../database/interface'; -import {UpsertSummary} from '../../models/fasten/upsert-summary'; -import {ClientConfig} from '../../models/client/client-config'; - -export class AetnaClient extends FHIR401Client implements IClient { - constructor(source: Source, clientConfig: ClientConfig) { - super(source, clientConfig); - } - - /** - * Aetna overrides the SyncAll function because Patient-everything operation uses a non-standard endpoint - * @param db - * @constructor - */ - async SyncAll(db: IDatabaseRepository): Promise { - const bundle = await this.GetResourceBundlePaginated("Patient") - - const wrappedResourceModels = await this.ProcessBundle(bundle) - //todo, create the resources in dependency order - return await db.UpsertResources(wrappedResourceModels) - } -} diff --git a/frontend/src/lib/conduit/fhir/base/base_client.spec.ts b/frontend/src/lib/conduit/fhir/base/base_client.spec.ts deleted file mode 100644 index eade2478..00000000 --- a/frontend/src/lib/conduit/fhir/base/base_client.spec.ts +++ /dev/null @@ -1,75 +0,0 @@ -import {BaseClient} from './base_client'; -import {Source} from '../../../models/database/source'; - -// @ts-ignore -import * as BaseClient_GetRequest from './fixtures/BaseClient_GetRequest.json'; -// @ts-ignore -import * as BaseClient_GetFhirVersion from './fixtures/BaseClient_GetFhirVersion.json'; -import {ClientConfig} from '../../../models/client/client-config'; - - -class TestClient extends BaseClient { - constructor(source: Source) { - super(source, new ClientConfig()); - } -} - -describe('BaseClient', () => { - let client: TestClient; - - beforeEach(async () => { - client = new TestClient(new Source({ - "authorization_endpoint": "https://fhirsandbox.healthit.gov/open/r4/authorize", - "token_endpoint": "https://fhirsandbox.healthit.gov/open/r4/token", - "introspection_endpoint": "", - "issuer": "https://fhirsandbox.healthit.go", - "api_endpoint_base_url": "https://fhirsandbox.healthit.gov/secure/r4/fhir", - "client_id": "9ad3ML0upIMiawLVdM5-DiPinGcv7M", - "redirect_uri": "https://lighthouse.fastenhealth.com/sandbox/callback/healthit", - "confidential": false, - "source_type": "healthit", - "patient": "placeholder", - "access_token": "2e1be8c72d4d5225aae264a1fb7e1d3e", - "refresh_token": "", - "expires_at": 16649837100, //aug 11, 2497 (for testing) - })); - }); - - it('should be created', () => { - expect(client).toBeTruthy(); - }); - - describe('GetRequest', () => { - it('should make an authorized request', async () => { - - //setup - let response = new Response(JSON.stringify(BaseClient_GetRequest)); - Object.defineProperty(response, "url", { value: `${client.source.api_endpoint_base_url}/Patient/${client.source.patient}`}); - spyOn(window, "fetch").and.returnValue(Promise.resolve(response)); - - //test - const resp = await client.GetRequest(`Patient/${client.source.patient}`) - - //expect - expect(resp.resourceType).toEqual("Patient"); - expect(resp.id).toEqual("123d41e1-0f71-4e9f-8eb2-d1b1330201a6"); - }); - }) - - describe('GetFhirVersion', () => { - it('should make an authorized request', async () => { - //setup - let response = new Response(JSON.stringify(BaseClient_GetFhirVersion)); - Object.defineProperty(response, "url", { value: `${client.source.api_endpoint_base_url}/metadata`}); - spyOn(window, "fetch").and.returnValue(Promise.resolve(response)); - - //test - const resp = await client.GetFhirVersion() - - //expect - expect(resp).toEqual("4.0.1"); - }); - }); - - -}) diff --git a/frontend/src/lib/conduit/fhir/base/base_client.ts b/frontend/src/lib/conduit/fhir/base/base_client.ts deleted file mode 100644 index 1a66681a..00000000 --- a/frontend/src/lib/conduit/fhir/base/base_client.ts +++ /dev/null @@ -1,153 +0,0 @@ -import {Source} from '../../../models/database/source'; -import * as Oauth from '@panva/oauth4webapi'; -import {IResourceRaw} from '../../interface'; -import {GetEndpointAbsolutePath} from '../../../utils/endpoint_absolute_path'; -import {ClientConfig} from '../../../models/client/client-config'; - - -class SourceUpdateStatus { - is_updated: boolean = false - source: Source -} - -// BaseClient is an abstract/partial class, its intended to be used by FHIR clients, and generically handle OAuth requests. -export abstract class BaseClient { - - private clientConfig: ClientConfig - private oauthClient: Oauth.Client - private oauthAuthorizationServer: Oauth.AuthorizationServer - public source: Source - public headers: Headers - public fhirVersion: string - - - protected constructor(source: Source, clientConfig: ClientConfig) { - this.source = source - this.clientConfig = clientConfig - this.headers = new Headers() - - //init Oauth client based on source configuration - this.oauthClient = { - client_id: source.client_id, - client_secret: "placeholder" //this is always a placeholder, if client_secret is required (for confidential clients), token_endpoint will be Lighthouse server. - } - this.oauthAuthorizationServer = { - issuer: source.issuer, - authorization_endpoint: source.authorization_endpoint, - token_endpoint: source.token_endpoint, - introspection_endpoint: source.introspection_endpoint, - } - } - - /** - * This function gets the FhirVersion as specified by the api CapabilityStatement endpoint (metadata) - * https://build.fhir.org/capabilitystatement.html - * @constructor - */ - public async GetFhirVersion(): Promise { - return this.GetRequest("metadata") - .then((resp) => { - return resp.fhirVersion - }) - } - - /** - * This function will make an authenticated request against an OAuth protected resource. If the AccessToken used has expired, it will attempt - * to use a refresh token (if present) to get a new AccessToken. - * @param resourceSubpathOrNext - * @constructor - */ - public async GetRequest(resourceSubpathOrNext: string): Promise { - - //check if the url is absolute - let resourceUrl: string - if (!(resourceSubpathOrNext.indexOf('http://') === 0 || resourceSubpathOrNext.indexOf('https://') === 0)) { - //not absolute, so lets prefix with the source api endpoint - resourceUrl = `${this.source.api_endpoint_base_url.trimEnd()}/${resourceSubpathOrNext.trimStart()}` - } else { - resourceUrl = resourceSubpathOrNext - } - if(this.source.cors_relay_required){ - //this endpoint requires a CORS relay - //get the path to the Fasten server, and append `cors/` and then append the request url - let resourceParts = new URL(resourceUrl) - resourceUrl = GetEndpointAbsolutePath(globalThis.location, this.clientConfig.fasten_api_endpoint_base) + `/cors/${resourceParts.hostname}${resourceParts.pathname}${resourceParts.search}` - } - - - //refresh the source if required - await this.RefreshSourceToken() - - //make a request to the protected resource - const resp = await Oauth.protectedResourceRequest(this.source.access_token, 'GET', new URL(resourceUrl), this.headers, null) - - if(resp.status >=300 || resp.status < 200){ - // b, _ := io.ReadAll(resp.Body) - throw new Error(`An error occurred during request ${resourceUrl} - ${resp.status} - ${resp.statusText} ${await resp.text()}`) - } - return resp.json() - // err = ParseBundle(resp.Body, decodeModelPtr) - // return err - } - - public async RefreshSourceToken(): Promise{ - - let sourceUpdateStatus = await this.refreshExpiredTokenIfRequired(this.source) - this.source = sourceUpdateStatus.source - return sourceUpdateStatus.is_updated - } - - - ///////////////////////////////////////////////////////////////////////////// - // Protected methods - ///////////////////////////////////////////////////////////////////////////// - - - ///////////////////////////////////////////////////////////////////////////// - // Private methods - ///////////////////////////////////////////////////////////////////////////// - - private async refreshExpiredTokenIfRequired(source: Source): Promise { - const sourceUpdateStatus = new SourceUpdateStatus() - //check if token has expired, and a refreshtoken is available - // Note: source.expires_at is in seconds, Date.now() is in milliseconds. - if(source.expires_at > Math.floor(Date.now() / 1000)) { //not expired return - sourceUpdateStatus.source = source - return Promise.resolve(sourceUpdateStatus) - } - if(!source.refresh_token){ - return Promise.reject(new Error("access token is expired, but no refresh token available")) - } - - console.log("access token expired, refreshing...") - return Oauth.refreshTokenGrantRequest(this.oauthAuthorizationServer, this.oauthClient, source.refresh_token) - .then((refreshTokenResp) => { - return Oauth.processRefreshTokenResponse(this.oauthAuthorizationServer, this.oauthClient, refreshTokenResp) - }) - .then((newToken) => { - - if(newToken.access_token != source.access_token){ - sourceUpdateStatus.is_updated = true - // { - // access_token: 'token', - // token_type: 'bearer', - // expires_in: 60, - // scope: 'api:read', - // refresh_token: 'refresh_token', - // } - - source.access_token = newToken.access_token as string - // @ts-ignore - source.expires_at = Math.floor(Date.now() / 1000) + parseInt(newToken.expires_in); - - // update the "source" credential with new data (which will need to be sent - // Don't overwrite `RefreshToken` with an empty value - if(newToken.refresh_token != ""){ - source.refresh_token = newToken.refresh_token as string - } - } - sourceUpdateStatus.source = source - return sourceUpdateStatus - }) - } -} diff --git a/frontend/src/lib/conduit/fhir/base/fhir401_r4_client.spec.ts b/frontend/src/lib/conduit/fhir/base/fhir401_r4_client.spec.ts deleted file mode 100644 index 5b0134fe..00000000 --- a/frontend/src/lib/conduit/fhir/base/fhir401_r4_client.spec.ts +++ /dev/null @@ -1,119 +0,0 @@ -import {FHIR401Client} from './fhir401_r4_client'; -import {Source} from '../../../models/database/source'; -import {IResourceBundleRaw} from '../../interface'; -import {ResourceFhir} from '../../../models/database/resource_fhir'; -import {NewPouchdbRepositoryWebWorker} from '../../../database/pouchdb_repository'; -import {Base64} from '../../../utils/base64'; -import * as PouchDB from 'pouchdb/dist/pouchdb'; -import { v4 as uuidv4 } from 'uuid'; - -// @ts-ignore -import * as FHIR401Client_ProcessBundle from './fixtures/FHIR401Client_ProcessBundle.json'; -// @ts-ignore -import * as FHIR401Client_ExtractResourceReference from './fixtures/FHIR401Client_ExtractResourceReference.json'; -import {IDatabaseRepository} from '../../../database/interface'; -import {PouchdbCrypto} from '../../../database/plugins/crypto'; -import {ClientConfig} from '../../../models/client/client-config'; - - -class TestClient extends FHIR401Client { - constructor(source: Source) { - super(source, new ClientConfig()); - } - - public async ProcessBundle(bundle: IResourceBundleRaw): Promise { - return super.ProcessBundle(bundle); - } -} - -describe('FHIR401Client', () => { - let client: TestClient; - - beforeEach(async () => { - client = new TestClient(new Source({ - "_id": "source:aetna:12345", - "authorization_endpoint": "https://fhirsandbox.healthit.gov/open/r4/authorize", - "token_endpoint": "https://fhirsandbox.healthit.gov/open/r4/token", - "introspection_endpoint": "", - "issuer": "https://fhirsandbox.healthit.go", - "api_endpoint_base_url": "https://fhirsandbox.healthit.gov/secure/r4/fhir", - "client_id": "9ad3ML0upIMiawLVdM5-DiPinGcv7M", - "redirect_uri": "https://lighthouse.fastenhealth.com/sandbox/callback/healthit", - "confidential": false, - "source_type": "healthit", - "patient": "placeholder", - "access_token": "2e1be8c72d4d5225aae264a1fb7e1d3e", - "refresh_token": "", - "expires_at": 16649837100, //aug 11, 2497 (for testing) - })); - }); - - it('should be created', () => { - expect(client).toBeTruthy(); - }); - - describe('ProcessBundle', () => { - it('should correctly wrap each BundleEntry with ResourceFhir', async () => { - - //setup - - //test - const resp = await client.ProcessBundle(FHIR401Client_ProcessBundle) - //expect - expect(resp.length).toEqual(206); - expect(resp[0].source_resource_id).toEqual("c088b7af-fc41-43cc-ab80-4a9ab8d47cd9"); - expect(resp[0].source_resource_type).toEqual("Patient"); - }); - }) - - describe('SyncAll', () => { - let repository: IDatabaseRepository; - - beforeEach(async () => { - let current_user = uuidv4() as string - let cryptoConfig = await PouchdbCrypto.CryptConfig(current_user, current_user) - await PouchdbCrypto.StoreCryptConfig(cryptoConfig) - repository = NewPouchdbRepositoryWebWorker({current_user: current_user, auth_token:""}, '/database', new PouchDB("FHIR401Client-"+ current_user)); - }); - - afterEach(async () => { - if(repository){ - const db = await repository.GetDB() - db.destroy() //wipe the db. - } - }) - it('should correctly add resources to the database', async () => { - //setup - let response = new Response(JSON.stringify(FHIR401Client_ProcessBundle)); - Object.defineProperty(response, "url", { value: `${client.source.api_endpoint_base_url}/Patient/${client.source.patient}/$everything`}); - spyOn(window, "fetch").and.returnValue(Promise.resolve(response)); - - //test - const resp = await client.SyncAll(repository) - const firstResourceFhir = resp.updatedResources[0] - const resourceIdParts = firstResourceFhir.split(":") - - //expect - expect(resp.totalResources).toEqual(206); - expect(resp.updatedResources.length).toEqual(206); - expect(firstResourceFhir).toEqual('resource_fhir:b64.c291cmNlOmFldG5hOjEyMzQ1:Patient:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9'); - expect(Base64.Decode(resourceIdParts[1])).toEqual("source:aetna:12345"); - - - }, 10000); - }) - - describe('ExtractResourceReference', () => { - it('should correctly extract resource identifier from raw resources', async () => { - - //setup - - //test - const resp = await client.ExtractResourceReference("CarePlan", FHIR401Client_ExtractResourceReference) - //expect - expect(resp.length).toEqual(2); - expect(resp).toEqual(['Encounter/97961321', 'Practitioner/12763770']); - }); - }) - -}) diff --git a/frontend/src/lib/conduit/fhir/base/fhir401_r4_client.ts b/frontend/src/lib/conduit/fhir/base/fhir401_r4_client.ts deleted file mode 100644 index fdeb719b..00000000 --- a/frontend/src/lib/conduit/fhir/base/fhir401_r4_client.ts +++ /dev/null @@ -1,594 +0,0 @@ -import {IClient, IResourceBundleEntryRaw, IResourceBundleRaw, IResourceRaw} from '../../interface'; -import {BaseClient} from './base_client'; -import {Source} from '../../../models/database/source'; -import {IDatabaseRepository} from '../../../database/interface'; -import {ResourceFhir} from '../../../models/database/resource_fhir'; -import {UpsertSummary} from '../../../models/fasten/upsert-summary'; -import {ClientConfig} from '../../../models/client/client-config'; - -export class FHIR401Client extends BaseClient implements IClient { - - //clients extending this class must validate fhirVersion matches using conformance/metadata url. - fhirVersion = "4.0.1" - - // https://build.fhir.org/ig/HL7/US-Core/ - usCoreResources: string[] = [ - "AllergyIntolerance", - //"Binary", - "CarePlan", - "CareTeam", - "Condition", - //"Coverage", - "Device", - "DiagnosticReport", - "DocumentReference", - "Encounter", - "Goal", - "Immunization", - //"Location", - //"Medication", - //"MedicationRequest", - "Observation", - //"Organization", - //"Patient", - //"Practitioner", - //"PractitionerRole", - "Procedure", - //"Provenance", - //"RelatedPerson", - // "ServiceRequest", - // "Specimen", - ] - - constructor(source: Source, clientConfig: ClientConfig) { - super(source, clientConfig); - } - - /** - * This function attempts to retrieve a Patient Bundle and sync all resources to the database - * @param db - * @constructor - */ - public async SyncAll(db: IDatabaseRepository): Promise { - const bundle = await this.GetPatientBundle(this.source.patient) - - const wrappedResourceModels = await this.ProcessBundle(bundle) - //todo, create the resources in dependency order - - return db.UpsertResources(wrappedResourceModels) - - } - - /** - * If Patient-everything api endpoint is unavailable (SyncAll) this function can be used to search for each resource associated with a Patient - * and sync them to the database. - * @param db - * @param resourceNames - * @constructor - */ - public async SyncAllByResourceName(db: IDatabaseRepository, resourceNames: string[]): Promise{ - //Store the Patient - const patientResource = await this.GetPatient(this.source.patient) - - const patientResourceFhir = new ResourceFhir() - patientResourceFhir.source_id = this.source._id - patientResourceFhir.source_resource_type = patientResource.resourceType - patientResourceFhir.source_resource_id = patientResource.id - patientResourceFhir.resource_raw = patientResource - - const upsertSummary = await db.UpsertResource(patientResourceFhir) - - //error map storage. - let syncErrors = {} - - //Store all other resources. - for(let resourceType of resourceNames) { - - try { - let bundle = await this.GetResourceBundlePaginated(`${resourceType}?patient=${this.source.patient}`) - let wrappedResourceModels = await this.ProcessBundle(bundle) - let resourceUpsertSummary = await db.UpsertResources(wrappedResourceModels) - - upsertSummary.updatedResources = upsertSummary.updatedResources.concat(resourceUpsertSummary.updatedResources) - upsertSummary.totalResources += resourceUpsertSummary.totalResources - - - // check if theres any "extracted" resource references that we should sync as well - let extractedResourceReferences = [] - extractedResourceReferences = wrappedResourceModels.reduce((previousVal, wrappedResource) => { - return previousVal.concat(this.ExtractResourceReference(wrappedResource.source_resource_type, wrappedResource.resource_raw)) - }, extractedResourceReferences) - - - if(extractedResourceReferences.length > 0 ){ - console.log("Extracted Resource References", extractedResourceReferences) - - let extractedResourceBundle = await this.GenerateResourceBundleFromResourceIds(extractedResourceReferences) - let wrappedExtractedResourceBundle = await this.ProcessBundle(extractedResourceBundle) - let extractedResourceUpsertSummary = await db.UpsertResources(wrappedExtractedResourceBundle) - - upsertSummary.updatedResources = upsertSummary.updatedResources.concat(extractedResourceUpsertSummary.updatedResources) - upsertSummary.totalResources += extractedResourceUpsertSummary.totalResources - } - - } - catch (e) { - console.error(`An error occurred while processing ${resourceType} bundle ${this.source.patient}`) - syncErrors[resourceType] = e - continue - } - } - - //TODO: correctly return newly inserted documents - return upsertSummary - } - - /** - * Given a raw resource payload, this function will determine if there are references to other resources, and extract them if so - * This is useful because search (by patient id) is disabled for certain resource types. - * @param sourceResourceType - * @param resourceRaw - * @constructor - */ - public ExtractResourceReference(sourceResourceType: string, resourceRaw): string[] { - let resourceRefs = [] - - switch (sourceResourceType) { - case "CarePlan": - // encounter can contain - //- Encounter - resourceRefs.push(resourceRaw.encounter?.reference) - - //author can contain - //- Practitioner - //- Organization - //- Patient - //- PractitionerRole - //- CareTeam - //- RelatedPerson - resourceRefs.push(resourceRaw.author?.reference) - - - //contributor can contain - //- Practitioner - //- Organization - //- Patient - //- PractitionerRole - //- CareTeam - //- RelatedPerson - resourceRefs.push(resourceRaw.contributor?.reference) - - //careTeam can contain - //- CareTeam - resourceRefs.push(resourceRaw.careTeam?.reference) - - break; - case "CareTeam": - // encounter can contain - //- Encounter - resourceRefs.push(resourceRaw.encounter?.reference) - - //participant[x].member can contain - //- Practitioner - //- Organization - //- Patient - //- PractitionerRole - //- CareTeam - //- RelatedPerson - //participant[x].onBehalfOf can contain - //- Organization - resourceRaw.participant?.map((participant) => { - resourceRefs.push(participant.member?.reference) - resourceRefs.push(participant.onBehalfOf?.reference) - }) - - //managingOrganization - //- Organization - resourceRaw.managingOrganization?.map((managingOrganization) => { - resourceRefs.push(managingOrganization.reference) - }) - break; - case "Condition": - // recorder can contain - //- Practitioner - //- PractitionerRole - //- Patient - //- RelatedPerson - resourceRefs.push(resourceRaw.recorder?.reference) - - // asserter can contain - //- Practitioner - //- PractitionerRole - //- Patient - //- RelatedPerson - resourceRefs.push(resourceRaw.asserter?.reference) - - break; - case "DiagnosticReport": - //basedOn[x] can contain - //- CarePlan - //- ImmunizationRecommendation - //- MedicationRequest - //- NutritionOrder - //- ServiceRequest - resourceRaw.basedOn?.map((basedOn) => { - resourceRefs.push(basedOn.reference) - }) - - // performer[x] can contain - //- Practitioner - //- PractitionerRole - //- Organization - //- CareTeam - resourceRaw.performer?.map((performer) => { - resourceRefs.push(performer.reference) - }) - break; - case "DocumentReference": - //author[x] can contain - //- Practitioner - //- Organization - //- Patient - //- PractitionerRole - //- CareTeam - //- Device - resourceRaw.author?.map((author) => { - resourceRefs.push(author.reference) - }) - - //authenticator can contain - //- Practitioner - //- Organization - //- PractitionerRole - resourceRefs.push(resourceRaw.authenticator?.reference) - - // custodian can contain - //- Organization - resourceRefs.push(resourceRaw.custodian?.reference) - - // relatesTo.target - //- DocumentReference - resourceRaw.relatesTo?.map((relatesTo) => { - resourceRefs.push(relatesTo.target?.reference) - }) - - //content.attachment can contain - //- Attachment - break - case "Encounter": - // basedOn[x] can contain - //- ServiceRequest - resourceRaw.basedOn?.map((basedOn) => { - resourceRefs.push(basedOn.reference) - }) - - //participant[x].individual can contain - //- Practitioner - //- PractitionerRole - //- RelatedPerson - resourceRaw.participant?.map((participant) => { - resourceRefs.push(participant.individual?.reference) - }) - - //reasonReference[x] can contain - //- Condition - //- Procedure - //- Observation - //- ImmunizationRecommendation - resourceRaw.reasonReference?.map((reasonReference) => { - resourceRefs.push(reasonReference.reference) - }) - - //hospitalization.origin can contain - //- Location - //- Organization - resourceRefs.push(resourceRaw.hospitalization?.origin?.reference) - - //hospitalization.destination can contain - //- Location - //- Organization - resourceRefs.push(resourceRaw.hospitalization?.destination?.reference) - - //location[x].location can contain - //- Location - resourceRaw.location?.map((location) => { - resourceRefs.push(location.location?.reference) - }) - - //serviceProvider can contain - //- Organization - resourceRefs.push(resourceRaw.serviceProvider?.reference) - - break - case "Immunization": - // location can contain - //- Location - resourceRefs.push(resourceRaw.location?.reference) - - // manufacturer can contain - //- Organization - resourceRefs.push(resourceRaw.manufacturer?.reference) - - //performer[x].actor can contain - //- Practitioner | PractitionerRole | Organization - resourceRaw.performer?.map((performer) => { - resourceRefs.push(performer.actor?.reference) - }) - - //reasonReference[x] can contain - //- Condition | Observation | DiagnosticReport - resourceRaw.reasonReference?.map((reasonReference) => { - resourceRefs.push(reasonReference.reference) - }) - - //protocolApplied[x].authority can contain - //- Organization - resourceRaw.protocolApplied?.map((protocolApplied) => { - resourceRefs.push(protocolApplied.authority?.reference) - }) - break - case "Location": - // managingOrganization can contain - //- Organization - resourceRefs.push(resourceRaw.managingOrganization?.reference) - - // partOf can contain - //- Location - resourceRefs.push(resourceRaw.partOf?.reference) - - break - case "MedicationRequest": - // reported.reportedReference can contain - //- Practitioner - //- Organization - //- Patient - //- PractitionerRole - //- RelatedPerson - resourceRefs.push(resourceRaw.reported?.reportedReference?.reference) - - // medication[x] can contain - //- Medication - resourceRefs.push(resourceRaw.reported?.reportedReference?.reference) - - // requester can contain - //- Practitioner - //- Organization - //- Patient - //- PractitionerRole - //- RelatedPerson - //- Device - resourceRefs.push(resourceRaw.requester?.reference) - - // performer can contain - //- Practitioner | PractitionerRole | Organization | Patient | Device | RelatedPerson | CareTeam - resourceRefs.push(resourceRaw.performer?.reference) - // recorder can contain - //- Practitioner | PractitionerRole - resourceRefs.push(resourceRaw.recorder?.reference) - - //TODO: reasonReference - //TODO: basedOn - //TODO: insurance - - // dispenseRequest.performer can contain - //- Organization - resourceRefs.push(resourceRaw.dispenseRequest?.performer?.reference) - break - case "Observation": - //basedOn[x] can contain - //- CarePlan | DeviceRequest | ImmunizationRecommendation | MedicationRequest | NutritionOrder | ServiceRequest - resourceRaw.basedOn?.map((basedOn) => { - resourceRefs.push(basedOn.reference) - }) - - // partOf[x] can contain - //- MedicationAdministration | MedicationDispense | MedicationStatement | Procedure | Immunization | ImagingStudy - resourceRaw.partOf?.map((partOf) => { - resourceRefs.push(partOf.reference) - }) - // performer[x] can contain - //- Practitioner | PractitionerRole | Organization | CareTeam | Patient | RelatedPerson - resourceRaw.performer?.map((performer) => { - resourceRefs.push(performer.reference) - }) - // device can contain - //- Device | DeviceMetric - resourceRefs.push(resourceRaw.device?.reference) - - break - case "PractitionerRole": - // practitioner can contain - //- Practitioner - resourceRefs.push(resourceRaw.practitioner?.reference) - - //organization can contain - //- Organization - resourceRefs.push(resourceRaw.organization?.reference) - - //location can contain - //- Location - resourceRefs.push(resourceRaw.location?.reference) - - //TODO: healthcareService - //TODO: endpoint - break - case "ServiceRequest": - // basedOn[x] can contain - //- CarePlan | ServiceRequest | MedicationRequest - resourceRaw.basedOn?.map((basedOn) => { - resourceRefs.push(basedOn.reference) - }) - - //requester can contain - //- Practitioner - //- Organization - //- Patient - //- PractitionerRole - //- RelatedPerson - //- Device - resourceRefs.push(resourceRaw.requester?.reference) - - //performer[x] can contain - //- Practitioner | PractitionerRole | Organization | CareTeam | HealthcareService | Patient | Device | RelatedPerson - resourceRaw.performer?.map((performer) => { - resourceRefs.push(performer.reference) - }) - - //locationReference[x] an contain - //-Location - resourceRaw.locationReference?.map((locationReference) => { - resourceRefs.push(locationReference.reference) - }) - - //reasonReference[x] can contain - //-Condition - //-Observation - //-DiagnosticReport - //-DocumentReference - resourceRaw.reasonReference?.map((reasonReference) => { - resourceRefs.push(reasonReference.reference) - }) - - //insurance[x] can contain - //- Coverage | ClaimResponse - resourceRaw.insurance?.map((insurance) => { - resourceRefs.push(insurance.reference) - }) - break - } - - // remove all null values, remove all duplicates - let cleanResourceRefs = resourceRefs.filter(i => !(typeof i === 'undefined' || i === null)); - cleanResourceRefs = [...new Set(cleanResourceRefs)] - return cleanResourceRefs - } - - /** - * This function is used to sync all resources from a Bundle file. Not applicable to this Client - * @param db - * @param bundleFile - * @constructor - */ - public async SyncAllFromBundleFile(db: IDatabaseRepository, bundleFile: any): Promise { - return Promise.reject(new Error("not implemented")); - } - - ///////////////////////////////////////////////////////////////////////////// - // Protected methods - ///////////////////////////////////////////////////////////////////////////// - /** - * This function attempts to retrieve the Patient Bundle using the Patient-everything api endpoint (if available) - * This response may be paginated - * https://hl7.org/fhir/operation-patient-everything.html - * @param patientId - * @constructor - * @protected - */ - protected GetPatientBundle(patientId: string): Promise { - return this.GetResourceBundlePaginated(`Patient/${patientId}/$everything`) - } - - /** - * This function retrieves a patient resource - * @param patientId - * @constructor - * @protected - */ - protected GetPatient(patientId: string): Promise { - return this.GetRequest(`Patient/${patientId}`) - } - - /** - * This function parses a FHIR Bundle and wraps each BundleEntry resource in a ResourceFhir object which can be stored in the DB. - * @param bundle - * @constructor - * @protected - */ - protected async ProcessBundle(bundle: IResourceBundleRaw): Promise { - // console.log(bundle) - // process each entry in bundle - return bundle.entry - .filter((bundleEntry) => { - return bundleEntry.resource.id // keep this entry if it has an ID, skip otherwise. - }) - .map((bundleEntry) => { - const wrappedResourceModel = new ResourceFhir() - wrappedResourceModel.fhir_version = this.fhirVersion - wrappedResourceModel.source_id = this.source._id - wrappedResourceModel.source_resource_id = bundleEntry.resource.id - wrappedResourceModel.source_resource_type = bundleEntry.resource.resourceType - wrappedResourceModel.resource_raw = bundleEntry.resource - // TODO find a way to safely/consistently get the resource updated date (and other metadata) which shoudl be added to the model. - // wrappedResourceModel.updated_at = bundleEntry.resource.meta?.lastUpdated - return wrappedResourceModel - }) - } - - /** - * Given a list of resource ids (Patient/xxx, Observation/yyyy), request these resources and generate a pseudo-bundle file - * @param resourceIds - * @constructor - * @protected - */ - protected async GenerateResourceBundleFromResourceIds(resourceIds: string[]): Promise{ - - resourceIds = [...new Set(resourceIds)] //make sure they are unique references. - let rawResourceRefs = await Promise.all(resourceIds.map(async (extractedResourceRef) => { - return { - resource: await this.GetRequest(extractedResourceRef) as IResourceRaw - } as IResourceBundleEntryRaw - })) - - return {resourceType: "Bundle", entry: rawResourceRefs} - } - - /** - * Retrieve a resource bundle. While "next" link is present in response, continue to request urls and append BundleEntries - * @param relativeResourcePath - * @constructor - * @private - */ - protected async GetResourceBundlePaginated(relativeResourcePath: string): Promise { - // https://www.hl7.org/fhir/patient-operation-everything.html - - const bundle = await this.GetRequest(relativeResourcePath) as IResourceBundleRaw - - let next: string - let prev: string - let self: string - for(let link of bundle.link || []){ - if(link.relation == "next"){ - next = link.url - } else if(link.relation == "self"){ - self = link.url - } else if(link.relation == "previous"){ - prev = link.url - } - } - - while(next && next != self && next != prev){ - console.debug(`Paginated request => ${next}`) - let nextBundle = await this.GetRequest(next) as IResourceBundleRaw - bundle.entry = bundle.entry.concat(nextBundle.entry) - - next = "" //reset the pointers - self = "" - prev = "" - for(let link of nextBundle.link){ - if(link.relation == "next"){ - next = link.url - } else if(link.relation == "self"){ - self = link.url - } else if(link.relation == "previous"){ - prev = link.url - } - } - } - - return bundle - } - - ///////////////////////////////////////////////////////////////////////////// - // Private methods - ///////////////////////////////////////////////////////////////////////////// -} diff --git a/frontend/src/lib/conduit/fhir/base/fixtures/BaseClient_GetFhirVersion.json b/frontend/src/lib/conduit/fhir/base/fixtures/BaseClient_GetFhirVersion.json deleted file mode 100644 index 42174507..00000000 --- a/frontend/src/lib/conduit/fhir/base/fixtures/BaseClient_GetFhirVersion.json +++ /dev/null @@ -1,1990 +0,0 @@ -{ - "date": "2021-08-13T12:25:53.113552", - "fhirVersion": "4.0.1", - "format": [ - "application/fhir+json" - ], - "implementation": { - "description": "PatientAccess API", - "url": "https://p-hi2.digitaledge.cigna.com/PatientAccess/v1" - }, - "kind": "instance", - "publisher": "Cigna, Inc.", - "rest": [ - { - "mode": "server", - "resource": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "search-type" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "searchParam": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-patient", - "documentation": "The client **SHALL** provide at least a id value and **MAY** provide both the Type and id values.\n\nThe server **SHALL** support both.", - "name": "patient", - "type": "reference" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/Resource-lastUpdated", - "name": "_lastUpdated", - "type": "date" - } - ], - "searchRevInclude": [ - "Provenance:target" - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance" - ], - "type": "AllergyIntolerance" - }, - { - "extension": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "url": "required", - "valueString": "patient" - }, - { - "url": "required", - "valueString": "category" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination" - }, - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "search-type" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "searchParam": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-category", - "documentation": "The client **SHALL** provide at least a code value and **MAY** provide both the system and code values.\n\nThe server **SHALL** support both.", - "name": "category", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-patient", - "documentation": "The client **SHALL** provide at least a id value and **MAY** provide both the Type and id values.\n\nThe server **SHALL** support both.", - "name": "patient", - "type": "reference" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/Resource-lastUpdated", - "name": "_lastUpdated", - "type": "date" - } - ], - "searchRevInclude": [ - "Provenance:target" - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan" - ], - "type": "CarePlan" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "url": "required", - "valueString": "patient" - }, - { - "url": "required", - "valueString": "status" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "search-type" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "searchParam": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-careteam-patient", - "documentation": "The client **SHALL** provide at least a id value and **MAY** provide both the Type and id values.\n\nThe server **SHALL** support both.", - "name": "patient", - "type": "reference" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-careteam-status", - "documentation": "The client **SHALL** provide at least a code value and **MAY** provide both the system and code values.\n\nThe server **SHALL** support both.", - "name": "status", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/Resource-lastUpdated", - "name": "_lastUpdated", - "type": "date" - } - ], - "searchRevInclude": [ - "Provenance:target" - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam" - ], - "type": "CareTeam" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "search-type" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "searchParam": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-patient", - "documentation": "The client **SHALL** provide at least a id value and **MAY** provide both the Type and id values.\n\nThe server **SHALL** support both.", - "name": "patient", - "type": "reference" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/Resource-lastUpdated", - "name": "_lastUpdated", - "type": "date" - } - ], - "searchRevInclude": [ - "Provenance:target" - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" - ], - "type": "Condition" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "search-type" - } - ], - "searchInclude": [ - "Coverage:payor" - ], - "searchParam": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "documentation": "The client **SHALL** provide at least a id value and **MAY** provide both the Type and id values.\n\nThe server **SHALL** support both.", - "name": "patient", - "type": "reference" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/Resource-lastUpdated", - "name": "_lastUpdated", - "type": "date" - } - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-Coverage" - ], - "type": "Coverage" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "search-type" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "searchParam": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-device-patient", - "documentation": "The client **SHALL** provide at least a id value and **MAY** provide both the Type and id values.\n\nThe server **SHALL** support both.", - "name": "patient", - "type": "reference" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/Resource-lastUpdated", - "name": "_lastUpdated", - "type": "date" - } - ], - "searchRevInclude": [ - "Provenance:target" - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device" - ], - "type": "Device" - }, - { - "extension": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "url": "required", - "valueString": "patient" - }, - { - "url": "required", - "valueString": "category" - }, - { - "url": "required", - "valueString": "date" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "url": "required", - "valueString": "patient" - }, - { - "url": "required", - "valueString": "category" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination" - }, - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "url": "required", - "valueString": "patient" - }, - { - "url": "required", - "valueString": "code" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "search-type" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "searchParam": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-category", - "documentation": "The client **SHALL** provide at least a code value and **MAY** provide both the system and code values.\n\nThe server **SHALL** support both.", - "name": "category", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-code", - "documentation": "The client **SHALL** provide at least a code value and **MAY** provide both the system and code values.\n\nThe server **SHALL** support both.", - "name": "code", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-date", - "documentation": "A client **SHALL** provide a value precise to the *second + time offset*.\n\nA server **SHALL** support a value precise to the *second + time offset*.", - "name": "date", - "type": "date" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-patient", - "documentation": "The client **SHALL** provide at least a id value and **MAY** provide both the Type and id values.\n\nThe server **SHALL** support both.", - "name": "patient", - "type": "reference" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/Resource-lastUpdated", - "name": "_lastUpdated", - "type": "date" - } - ], - "searchRevInclude": [ - "Provenance:target" - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab", - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" - ], - "type": "DiagnosticReport" - }, - { - "extension": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "url": "required", - "valueString": "patient" - }, - { - "url": "required", - "valueString": "category" - }, - { - "url": "required", - "valueString": "date" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "url": "required", - "valueString": "patient" - }, - { - "url": "required", - "valueString": "type" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "url": "required", - "valueString": "patient" - }, - { - "url": "required", - "valueString": "category" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination" - }, - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "search-type" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "searchParam": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-id", - "name": "_id", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-category", - "documentation": "The client **SHALL** provide at least a code value and **MAY** provide both the system and code values.\n\nThe server **SHALL** support both.", - "name": "category", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-date", - "documentation": "A client **SHALL** provide a value precise to the *second + time offset*.\n\nA server **SHALL** support a value precise to the *second + time offset*.", - "name": "date", - "type": "date" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-patient", - "documentation": "The client **SHALL** provide at least a id value and **MAY** provide both the Type and id values.\n\nThe server **SHALL** support both.", - "name": "patient", - "type": "reference" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-period", - "documentation": "A client **SHALL** provide a value precise to the *second + time offset*.\n\nA server **SHALL** support a value precise to the *second + time offset*.", - "name": "period", - "type": "date" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-type", - "documentation": "The client **SHALL** provide at least a code value and **MAY** provide both the system and code values.\n\nThe server **SHALL** support both.", - "name": "type", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/Resource-lastUpdated", - "name": "_lastUpdated", - "type": "date" - } - ], - "searchRevInclude": [ - "Provenance:target" - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" - ], - "type": "DocumentReference" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "url": "required", - "valueString": "date" - }, - { - "url": "required", - "valueString": "patient" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "search-type" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "searchParam": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-id", - "name": "_id", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-date", - "documentation": "A client **SHALL** provide a value precise to the *second + time offset*.\n\nA server **SHALL** support a value precise to the *second + time offset*.", - "name": "date", - "type": "date" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-patient", - "documentation": "The client **SHALL** provide at least a id value and **MAY** provide both the Type and id values.\n\nThe server **SHALL** support both.", - "name": "patient", - "type": "reference" - } - ], - "searchRevInclude": [ - "Provenance:target" - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter" - ], - "type": "Encounter" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "search-type" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read", - "documentation": "Searches using service-date, _lastUpdated, or type require a patient search argument.\n\n_include:* SHALL be supported.\n" - } - ], - "searchInclude": [ - "ExplanationOfBenefit:*", - "ExplanationOfBenefit:care-team", - "ExplanationOfBenefit:coverage", - "ExplanationOfBenefit:insurer", - "ExplanationOfBenefit:patient", - "ExplanationOfBenefit:provider" - ], - "searchParam": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/Resource-id", - "name": "_id", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/Resource-lastUpdated", - "name": "_lastUpdated", - "type": "date" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/carin-bb/SearchParameter/explanationofbenefit-identifier", - "name": "identifier", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/carin-bb/SearchParameter/explanationofbenefit-patient", - "name": "patient", - "type": "reference" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/carin-bb/SearchParameter/explanationofbenefit-service-date", - "name": "service-date", - "type": "date" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/carin-bb/SearchParameter/explanationofbenefit-type", - "name": "type", - "type": "token" - } - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit", - "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Inpatient-Institutional", - "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Outpatient-Institutional", - "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Pharmacy", - "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Professional-NonClinician" - ], - "type": "ExplanationOfBenefit" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "search-type" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "searchParam": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-patient", - "documentation": "The client **SHALL** provide at least a id value and **MAY** provide both the Type and id values.\n\nThe server **SHALL** support both.", - "name": "patient", - "type": "reference" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/Resource-lastUpdated", - "name": "_lastUpdated", - "type": "date" - } - ], - "searchRevInclude": [ - "Provenance:target" - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal" - ], - "type": "Goal" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "search-type" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "searchInclude": [ - "*", - "Immunization:location", - "Immunization:manufacturer", - "Immunization:patient", - "Immunization:performer", - "Immunization:reaction", - "Immunization:reason-reference" - ], - "searchParam": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-patient", - "documentation": "The client **SHALL** provide at least a id value and **MAY** provide both the Type and id values.\n\nThe server **SHALL** support both.", - "name": "patient", - "type": "reference" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/Resource-lastUpdated", - "name": "_lastUpdated", - "type": "date" - }, - { - "name": "vaccine-code", - "type": "token", - "documentation": "Vaccine Product Administered" - } - ], - "searchRevInclude": [ - "Provenance:target" - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization" - ], - "type": "Immunization" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "search-type" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "searchParam": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/Resource-id", - "name": "_id", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/clinical-identifier", - "name": "identifier", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/List-item", - "name": "item", - "type": "reference" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/List-status", - "name": "status", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/Resource-lastUpdated", - "name": "_lastUpdated", - "type": "date" - } - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-CoveragePlan" - ], - "type": "List" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-location" - ], - "type": "Location" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication" - ], - "type": "Medication" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "search-type" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "searchParam": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/davinci-drug-formulary/SearchParameter/DrugName", - "name": "DrugName", - "type": "string" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/davinci-drug-formulary/SearchParameter/DrugPlan", - "name": "DrugPlan", - "type": "string" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/davinci-drug-formulary/SearchParameter/DrugTier", - "name": "DrugTier", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/Resource-id", - "name": "_id", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/MedicationKnowledge-code", - "name": "code", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/Resource-lastUpdated", - "name": "_lastUpdated", - "type": "date" - } - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-FormularyDrug" - ], - "type": "MedicationKnowledge" - }, - { - "extension": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "url": "required", - "valueString": "patient" - }, - { - "url": "required", - "valueString": "intent" - }, - { - "url": "required", - "valueString": "status" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "url": "required", - "valueString": "patient" - }, - { - "url": "required", - "valueString": "intent" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination" - }, - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "search-type" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "searchInclude": [ - "MedicationRequest:medication" - ], - "searchParam": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-intent", - "documentation": "The client **SHALL** provide at least a code value and **MAY** provide both the system and code values.\n\nThe server **SHALL** support both.", - "name": "intent", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-patient", - "documentation": "The client **SHALL** provide at least a id value and **MAY** provide both the Type and id values.\n\nThe server **SHALL** support both.", - "name": "patient", - "type": "reference" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-status", - "documentation": "The client **SHALL** provide at least a code value and **MAY** provide both the system and code values.\n\nThe server **SHALL** support both.", - "name": "status", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/Resource-lastUpdated", - "name": "_lastUpdated", - "type": "date" - } - ], - "searchRevInclude": [ - "Provenance:target" - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest" - ], - "type": "MedicationRequest" - }, - { - "extension": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "url": "required", - "valueString": "patient" - }, - { - "url": "required", - "valueString": "category" - }, - { - "url": "required", - "valueString": "date" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "url": "required", - "valueString": "patient" - }, - { - "url": "required", - "valueString": "category" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination" - }, - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "url": "required", - "valueString": "patient" - }, - { - "url": "required", - "valueString": "code" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "search-type" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "searchParam": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-category", - "documentation": "The client **SHALL** provide at least a code value and **MAY** provide both the system and code values.\n\nThe server **SHALL** support both.", - "name": "category", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-code", - "documentation": "The client **SHALL** provide at least a code value and **MAY** provide both the system and code values.\n\nThe server **SHALL** support both.", - "name": "code", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-date", - "documentation": "A client **SHALL** provide a value precise to the *second + time offset*.\n\nA server **SHALL** support a value precise to the *second + time offset*.", - "name": "date", - "type": "date" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-patient", - "documentation": "The client **SHALL** provide at least a id value and **MAY** provide both the Type and id values.\n\nThe server **SHALL** support both.", - "name": "patient", - "type": "reference" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/Resource-lastUpdated", - "name": "_lastUpdated", - "type": "date" - } - ], - "searchRevInclude": [ - "Provenance:target" - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-bmi", - "http://hl7.org/fhir/us/core/StructureDefinition/head-occipital-frontal-circumference-percentile", - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-respiratory-rate", - "http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height", - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-heart-rate", - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-body-height", - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-blood-pressure", - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-pulse-oximetry", - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-vital-signs", - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-body-temperature", - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus", - "http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age", - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-head-circumference", - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-body-weight", - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" - ], - "type": "Observation" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization", - "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-Organization" - ], - "type": "Organization" - }, - { - "extension": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "url": "required", - "valueString": "gender" - }, - { - "url": "required", - "valueString": "name" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "url": "required", - "valueString": "birthdate" - }, - { - "url": "required", - "valueString": "name" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination" - }, - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "search-type" - } - ], - "operation": [ - { - "definition": "https://spec.smarthealth.cards/artifacts/operation-patient-i-health-cards-issue.json", - "documentation": "This operation is used to return a signed vaccine credential", - "name": "health-cards-issue" - }, - { - "definition": "http://hl7.org/fhir/OperationDefinition/Patient-everything", - "documentation": "This operation is used to return all the information related to a patient", - "name": "everything" - } - ], - "searchParam": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-id", - "name": "_id", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-birthdate", - "documentation": "A client **SHALL** provide a value precise to the *day*.\n\nA server **SHALL** support a value a value precise to the *day*.", - "name": "birthdate", - "type": "date" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-gender", - "documentation": "The client **SHALL** provide at least a code value and **MAY** provide both the system and code values.\n\nThe server **SHALL** support both.", - "name": "gender", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-identifier", - "documentation": "The client **SHALL** provide at least a code value and **MAY** provide both the system and code values.\n\nThe server **SHALL** support both.", - "name": "identifier", - "type": "token" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-name", - "name": "name", - "type": "string" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/Resource-lastUpdated", - "name": "_lastUpdated", - "type": "date" - } - ], - "searchRevInclude": [ - "Provenance:target" - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient", - "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-Patient" - ], - "type": "Patient" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner", - "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-Practitioner" - ], - "type": "Practitioner" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole" - ], - "type": "PractitionerRole" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - }, - { - "url": "required", - "valueString": "patient" - }, - { - "url": "required", - "valueString": "date" - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "search-type" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "searchParam": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-date", - "documentation": "A client **SHALL** provide a value precise to the *second + time offset*.\n\nA server **SHALL** support a value precise to the *second + time offset*.", - "name": "date", - "type": "date" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "definition": "http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-patient", - "documentation": "The client **SHALL** provide at least a id value and **MAY** provide both the Type and id values.\n\nThe server **SHALL** support both.", - "name": "patient", - "type": "reference" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "MAY" - } - ], - "definition": "http://hl7.org/fhir/SearchParameter/Resource-lastUpdated", - "name": "_lastUpdated", - "type": "date" - } - ], - "searchRevInclude": [ - "Provenance:target" - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure" - ], - "type": "Procedure" - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "interaction": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation", - "valueCode": "SHALL" - } - ], - "code": "read" - } - ], - "supportedProfile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-provenance" - ], - "type": "Provenance" - } - ], - "security": { - "extension": [ - { - "extension": [ - { - "url": "authorize", - "valueUri": "https://r-hi2.cigna.com/mga/sps/oauth/oauth20/authorize" - }, - { - "url": "token", - "valueUri": "https://r-hi2.cigna.com/mga/sps/oauth/oauth20/token" - } - ], - "url": "http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris" - } - ], - "service": [ - { - "coding": [ - { - "code": "SMART-on-FHIR", - "system": "http://hl7.org/fhir/restful-security-service" - } - ], - "text": "OAuth2 using SMART-on-FHIR profile (see http://docs.smarthealthit.org)" - } - ] - } - } - ], - "status": "active", - "resourceType": "CapabilityStatement" -} diff --git a/frontend/src/lib/conduit/fhir/base/fixtures/BaseClient_GetRequest.json b/frontend/src/lib/conduit/fhir/base/fixtures/BaseClient_GetRequest.json deleted file mode 100644 index be754145..00000000 --- a/frontend/src/lib/conduit/fhir/base/fixtures/BaseClient_GetRequest.json +++ /dev/null @@ -1,159 +0,0 @@ -{ - "resourceType": "Patient", - "id": "123d41e1-0f71-4e9f-8eb2-d1b1330201a6", - "meta": { - "versionId": "1.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": "2054-5", - "display": "Black or African American" - } - }, - { - "url": "text", - "valueString": "Black or African American" - } - ] - }, - { - "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": "2135-2", - "display": "Hispanic or Latino" - } - }, - { - "url": "text", - "valueString": "Hispanic or Latino" - } - ] - }, - { - "url": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName", - "valueString": "Ramona980 Franco581" - }, - { - "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex", - "valueCode": "M" - }, - { - "url": "http://hl7.org/fhir/StructureDefinition/data-absent-reason", - "valueCode": "masked" - } - ], - "identifier": [ - { - "system": "https://github.com/synthetichealth/synthea", - "value": "123d41e1-0f71-4e9f-8eb2-d1b1330201a6" - }, - { - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0203", - "code": "MR", - "display": "Medical Record Number" - } - ] - }, - "system": "http://hospital.smarthealthit.org", - "value": "123d41e1-0f71-4e9f-8eb2-d1b1330201a6" - }, - { - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0203", - "code": "SS", - "display": "Social Security Number" - } - ] - }, - "system": "http://hl7.org/fhir/sid/us-ssn", - "value": "999-50-6731" - }, - { - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0203", - "code": "DL", - "display": "Drivers License" - } - ] - }, - "system": "urn:oid:2.16.840.1.113883.4.3.25", - "value": "S99957478" - } - ], - "name": [ - { - "use": "official", - "family": "Gutiérrez115", - "given": [ - "Hugo693" - ], - "prefix": [ - "Mr." - ] - } - ], - "telecom": [ - { - "system": "phone", - "value": "555-914-6475", - "use": "home" - } - ], - "gender": "male", - "birthDate": "1969-01-12", - "address": [ - { - "line": [ - "[\"293 Douglas Ramp\"]" - ], - "city": "Natick", - "state": "MA", - "postalCode": "01999", - "country": "US", - "period": { - "start": "1969-01-12T00:00:00+00:00" - } - } - ], - "maritalStatus": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus", - "code": "M", - "display": "M" - } - ], - "text": "M" - }, - "multipleBirthBoolean": false, - "communication": [ - { - "language": { - "coding": [ - { - "system": "urn:ietf:bcp:47", - "code": "es", - "display": "Spanish" - } - ] - } - } - ] -} diff --git a/frontend/src/lib/conduit/fhir/base/fixtures/FHIR401Client_ExtractResourceReference.json b/frontend/src/lib/conduit/fhir/base/fixtures/FHIR401Client_ExtractResourceReference.json deleted file mode 100644 index cd36120b..00000000 --- a/frontend/src/lib/conduit/fhir/base/fixtures/FHIR401Client_ExtractResourceReference.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "resourceType": "CarePlan", - "id": "197543976", - "meta": { - "versionId": "1", - "lastUpdated": "2021-10-04T14:46:33.000Z" - }, - "text": { - "status": "additional", - "div": "

Care Plan

Patient: SMART, NANCYU NHA EEEEEE

Title: Comorbidities found via Retrieve Dx

Description: Malnutrition:Severe --- Inputs [Height: 165.1, Weight: 25, BMI (Calculated): 9.171615976368047]\n\nAnoxic Brain Injury\n\n

Status: Active

Intent: Plan

Category: Assessment and Plan of Treatment

Author: P., MD, Cardio

Effective Period: Oct 4, 2021 2:46 P.M. UTC

" - }, - "status": "active", - "intent": "plan", - "category": [ - { - "coding": [ - { - "system": "http://hl7.org/fhir/us/core/CodeSystem/careplan-category", - "code": "assess-plan", - "display": "Assessment and Plan of Treatment" - } - ], - "text": "Assessment and Plan of Treatment" - } - ], - "title": "Comorbidities found via Retrieve Dx", - "subject": { - "reference": "Patient/12724066", - "display": "SMART, NANCYU NHA EEEEEE" - }, - "encounter": { - "reference": "Encounter/97961321" - }, - "period": { - "start": "2021-10-04T14:46:33.000Z" - }, - "author": { - "reference": "Practitioner/12763770", - "display": "P., MD, Cardio" - } -} diff --git a/frontend/src/lib/conduit/fhir/base/fixtures/FHIR401Client_ProcessBundle.json b/frontend/src/lib/conduit/fhir/base/fixtures/FHIR401Client_ProcessBundle.json deleted file mode 100644 index 64e2c9c7..00000000 --- a/frontend/src/lib/conduit/fhir/base/fixtures/FHIR401Client_ProcessBundle.json +++ /dev/null @@ -1,16695 +0,0 @@ -{ - "resourceType": "Bundle", - "type": "transaction", - "entry": [ - { - "fullUrl": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "resource": { - "resourceType": "Patient", - "id": "c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "text": { - "status": "generated", - "div": "
Generated by Synthea.Version identifier: v2.4.0-404-ge7ce2295\n . Person seed: -2282623849526784568 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": "Sandra485 Cormier289" - }, - { - "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex", - "valueCode": "F" - }, - { - "url": "http://hl7.org/fhir/StructureDefinition/patient-birthPlace", - "valueAddress": { - "city": "Tewksbury", - "state": "Massachusetts", - "country": "US" - } - }, - { - "url": "http://synthetichealth.github.io/synthea/disability-adjusted-life-years", - "valueDecimal": 0.7742822202801629 - }, - { - "url": "http://synthetichealth.github.io/synthea/quality-adjusted-life-years", - "valueDecimal": 52.22571777971984 - } - ], - "identifier": [ - { - "system": "https://github.com/synthetichealth/synthea", - "value": "1e0a8bd3-3b82-4f17-b1d6-19043aa0db6b" - }, - { - "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": "1e0a8bd3-3b82-4f17-b1d6-19043aa0db6b" - }, - { - "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-76-3236" - }, - { - "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": "S99995466" - }, - { - "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": "X41129973X" - } - ], - "name": [ - { - "use": "official", - "family": "Marks830", - "given": [ - "Alesha810" - ], - "prefix": [ - "Ms." - ] - } - ], - "telecom": [ - { - "system": "phone", - "value": "555-664-6121", - "use": "home" - } - ], - "gender": "female", - "birthDate": "1965-11-04", - "address": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/geolocation", - "extension": [ - { - "url": "latitude", - "valueDecimal": 42.60588776678466 - }, - { - "url": "longitude", - "valueDecimal": -71.0695322588603 - } - ] - } - ], - "line": [ - "165 Shanahan View" - ], - "city": "North Reading", - "state": "Massachusetts", - "country": "US" - } - ], - "maritalStatus": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus", - "code": "S", - "display": "S" - } - ], - "text": "S" - }, - "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:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "resource": { - "resourceType": "Organization", - "id": "f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "identifier": [ - { - "system": "https://github.com/synthetichealth/synthea", - "value": "f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4" - } - ], - "active": true, - "type": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/organization-type", - "code": "prov", - "display": "Healthcare Provider" - } - ], - "text": "Healthcare Provider" - } - ], - "name": "LAWRENCE GENERAL HOSPITAL", - "telecom": [ - { - "system": "phone", - "value": "9786834000" - } - ], - "address": [ - { - "line": [ - "ONE GENERAL STREET" - ], - "city": "LAWRENCE", - "state": "MA", - "postalCode": "01842", - "country": "US" - } - ] - }, - "request": { - "method": "POST", - "url": "Organization" - } - }, - { - "fullUrl": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e", - "resource": { - "resourceType": "Practitioner", - "id": "0000016d-3a85-4cca-0000-00000000001e", - "identifier": [ - { - "system": "http://hl7.org/fhir/sid/us-npi", - "value": "30" - } - ], - "active": true, - "name": [ - { - "family": "Lind531", - "given": [ - "Cedrick207" - ], - "prefix": [ - "Dr." - ] - } - ], - "telecom": [ - { - "system": "email", - "value": "Cedrick207.Lind531@example.com", - "use": "work" - } - ], - "address": [ - { - "line": [ - "ONE GENERAL STREET" - ], - "city": "LAWRENCE", - "state": "MA", - "postalCode": "01842", - "country": "US" - } - ], - "gender": "male" - }, - "request": { - "method": "POST", - "url": "Practitioner" - } - }, - { - "fullUrl": "urn:uuid:3879ad6c-0839-48f3-8e17-30d5637f874b", - "resource": { - "resourceType": "Encounter", - "id": "3879ad6c-0839-48f3-8e17-30d5637f874b", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e", - "display": "Dr. Cedrick207 Lind531" - } - } - ], - "period": { - "start": "1967-11-11T00:24:38-05:00", - "end": "1967-11-11T00:54:38-05:00" - }, - "reasonCode": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "233678006", - "display": "Childhood asthma" - } - ] - } - ], - "serviceProvider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:b86ed58d-d67e-4616-b028-51d5a2dd0552", - "resource": { - "resourceType": "MedicationRequest", - "id": "b86ed58d-d67e-4616-b028-51d5a2dd0552", - "status": "active", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://www.nlm.nih.gov/research/umls/rxnorm", - "code": "895994", - "display": "120 ACTUAT Fluticasone propionate 0.044 MG/ACTUAT Metered Dose Inhaler" - } - ], - "text": "120 ACTUAT Fluticasone propionate 0.044 MG/ACTUAT Metered Dose Inhaler" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:3879ad6c-0839-48f3-8e17-30d5637f874b" - }, - "authoredOn": "1967-11-11T00:24:38-05:00", - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e", - "display": "Dr. Cedrick207 Lind531" - }, - "dosageInstruction": [ - { - "sequence": 1, - "asNeededBoolean": true - } - ] - }, - "request": { - "method": "POST", - "url": "MedicationRequest" - } - }, - { - "fullUrl": "urn:uuid:ec24034c-62ae-4fa9-b53b-e5b3e14096fc", - "resource": { - "resourceType": "Claim", - "id": "ec24034c-62ae-4fa9-b53b-e5b3e14096fc", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "pharmacy" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "1967-11-11T00:24:38-05:00", - "end": "1967-11-11T00:54:38-05:00" - }, - "created": "1967-11-11T00:54:38-05:00", - "provider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - }, - "priority": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/processpriority", - "code": "normal" - } - ] - }, - "prescription": { - "reference": "urn:uuid:b86ed58d-d67e-4616-b028-51d5a2dd0552" - }, - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "item": [ - { - "sequence": 1, - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "185345009", - "display": "Encounter for symptom" - } - ], - "text": "Encounter for symptom" - }, - "encounter": [ - { - "reference": "urn:uuid:3879ad6c-0839-48f3-8e17-30d5637f874b" - } - ] - } - ], - "total": { - "value": 21.1, - "currency": "USD" - } - }, - "request": { - "method": "POST", - "url": "Claim" - } - }, - { - "fullUrl": "urn:uuid:0d99e987-eaff-4cdb-8b60-853feb003c5d", - "resource": { - "resourceType": "MedicationRequest", - "id": "0d99e987-eaff-4cdb-8b60-853feb003c5d", - "status": "active", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://www.nlm.nih.gov/research/umls/rxnorm", - "code": "745679", - "display": "200 ACTUAT Albuterol 0.09 MG/ACTUAT Metered Dose Inhaler" - } - ], - "text": "200 ACTUAT Albuterol 0.09 MG/ACTUAT Metered Dose Inhaler" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:3879ad6c-0839-48f3-8e17-30d5637f874b" - }, - "authoredOn": "1967-11-11T00:24:38-05:00", - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e", - "display": "Dr. Cedrick207 Lind531" - }, - "dosageInstruction": [ - { - "sequence": 1, - "asNeededBoolean": true - } - ] - }, - "request": { - "method": "POST", - "url": "MedicationRequest" - } - }, - { - "fullUrl": "urn:uuid:5df4777f-d82e-4815-bf56-dd1e647fdf13", - "resource": { - "resourceType": "Claim", - "id": "5df4777f-d82e-4815-bf56-dd1e647fdf13", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "pharmacy" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "1967-11-11T00:24:38-05:00", - "end": "1967-11-11T00:54:38-05:00" - }, - "created": "1967-11-11T00:54:38-05:00", - "provider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - }, - "priority": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/processpriority", - "code": "normal" - } - ] - }, - "prescription": { - "reference": "urn:uuid:0d99e987-eaff-4cdb-8b60-853feb003c5d" - }, - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "item": [ - { - "sequence": 1, - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "185345009", - "display": "Encounter for symptom" - } - ], - "text": "Encounter for symptom" - }, - "encounter": [ - { - "reference": "urn:uuid:3879ad6c-0839-48f3-8e17-30d5637f874b" - } - ] - } - ], - "total": { - "value": 50.29, - "currency": "USD" - } - }, - "request": { - "method": "POST", - "url": "Claim" - } - }, - { - "fullUrl": "urn:uuid:a55b85b0-5be8-47cb-b393-7b3d1b7e52e3", - "resource": { - "resourceType": "CareTeam", - "id": "a55b85b0-5be8-47cb-b393-7b3d1b7e52e3", - "status": "active", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:3879ad6c-0839-48f3-8e17-30d5637f874b" - }, - "period": { - "start": "1967-11-11T00:24:38-05:00" - }, - "participant": [ - { - "role": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "116153009", - "display": "Patient" - } - ], - "text": "Patient" - } - ], - "member": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - } - }, - { - "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-00000000001e", - "display": "Dr. Cedrick207 Lind531" - } - }, - { - "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:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - } - } - ], - "reasonCode": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "233678006", - "display": "Childhood asthma" - } - ], - "text": "Childhood asthma" - } - ], - "managingOrganization": [ - { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - } - ] - }, - "request": { - "method": "POST", - "url": "CareTeam" - } - }, - { - "fullUrl": "urn:uuid:4e5c4e96-96e8-4e4e-b3cb-35b25cdd2cf9", - "resource": { - "resourceType": "CarePlan", - "id": "4e5c4e96-96e8-4e4e-b3cb-35b25cdd2cf9", - "text": { - "status": "generated", - "div": "
Care Plan for Asthma self management.
Activities:
  • Asthma self management
  • Asthma self management
  • Asthma self management

Care plan is meant to treat Childhood asthma.
" - }, - "status": "active", - "intent": "order", - "category": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "699728000", - "display": "Asthma self management" - } - ], - "text": "Asthma self management" - } - ], - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:3879ad6c-0839-48f3-8e17-30d5637f874b" - }, - "period": { - "start": "1967-11-11T00:24:38-05:00" - }, - "careTeam": [ - { - "reference": "urn:uuid:a55b85b0-5be8-47cb-b393-7b3d1b7e52e3" - } - ], - "activity": [ - { - "detail": { - "code": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "710818004", - "display": "Inhaled steroid therapy" - } - ], - "text": "Inhaled steroid therapy" - }, - "status": "in-progress", - "location": { - "display": "LAWRENCE GENERAL HOSPITAL" - } - } - }, - { - "detail": { - "code": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "708409001", - "display": "Home nebulizer therapy" - } - ], - "text": "Home nebulizer therapy" - }, - "status": "in-progress", - "location": { - "display": "LAWRENCE GENERAL HOSPITAL" - } - } - }, - { - "detail": { - "code": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "229298005", - "display": "Breathing control" - } - ], - "text": "Breathing control" - }, - "status": "in-progress", - "location": { - "display": "LAWRENCE GENERAL HOSPITAL" - } - } - } - ] - }, - "request": { - "method": "POST", - "url": "CarePlan" - } - }, - { - "fullUrl": "urn:uuid:8e08fd86-4a37-4b97-9636-1f9ac77b416d", - "resource": { - "resourceType": "Claim", - "id": "8e08fd86-4a37-4b97-9636-1f9ac77b416d", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "1967-11-11T00:24:38-05:00", - "end": "1967-11-11T00:54:38-05:00" - }, - "created": "1967-11-11T00:54:38-05:00", - "provider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - }, - "priority": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/processpriority", - "code": "normal" - } - ] - }, - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "item": [ - { - "sequence": 1, - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "185345009", - "display": "Encounter for symptom" - } - ], - "text": "Encounter for symptom" - }, - "encounter": [ - { - "reference": "urn:uuid:3879ad6c-0839-48f3-8e17-30d5637f874b" - } - ] - } - ], - "total": { - "value": 129.16, - "currency": "USD" - } - }, - "request": { - "method": "POST", - "url": "Claim" - } - }, - { - "fullUrl": "urn:uuid:721349f8-f463-4c61-b01d-b45684f5c877", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "721349f8-f463-4c61-b01d-b45684f5c877", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "8e08fd86-4a37-4b97-9636-1f9ac77b416d" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "1967-11-11T00:54:38-05:00", - "end": "1968-11-11T00:54:38-05:00" - }, - "created": "1967-11-11T00:54:38-05:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:8e08fd86-4a37-4b97-9636-1f9ac77b416d" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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": "1967-11-11T00:24:38-05:00", - "end": "1967-11-11T00:54:38-05:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "21", - "display": "Inpatient Hospital" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:3879ad6c-0839-48f3-8e17-30d5637f874b" - } - ] - } - ], - "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:294bdfba-55a3-44f7-b208-cb5835a67424", - "resource": { - "resourceType": "Encounter", - "id": "294bdfba-55a3-44f7-b208-cb5835a67424", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e", - "display": "Dr. Cedrick207 Lind531" - } - } - ], - "period": { - "start": "1968-11-10T00:24:38-05:00", - "end": "1968-11-24T00:24:38-05:00" - }, - "reasonCode": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "367498001", - "display": "Seasonal allergic rhinitis" - } - ] - } - ], - "serviceProvider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:54c20754-d436-4f6b-a0a5-466fd36665a9", - "resource": { - "resourceType": "Condition", - "id": "54c20754-d436-4f6b-a0a5-466fd36665a9", - "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": "367498001", - "display": "Seasonal allergic rhinitis" - } - ], - "text": "Seasonal allergic rhinitis" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:294bdfba-55a3-44f7-b208-cb5835a67424" - }, - "onsetDateTime": "1968-11-10T00:24:38-05:00", - "recordedDate": "1968-11-10T00:24:38-05:00" - }, - "request": { - "method": "POST", - "url": "Condition" - } - }, - { - "fullUrl": "urn:uuid:1f14d2ae-a3bd-412b-9068-35efef091e2c", - "resource": { - "resourceType": "MedicationRequest", - "id": "1f14d2ae-a3bd-412b-9068-35efef091e2c", - "status": "active", - "intent": "order", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://www.nlm.nih.gov/research/umls/rxnorm", - "code": "477045", - "display": "Chlorpheniramine Maleate 2 MG/ML Oral Solution" - } - ], - "text": "Chlorpheniramine Maleate 2 MG/ML Oral Solution" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:294bdfba-55a3-44f7-b208-cb5835a67424" - }, - "authoredOn": "1968-11-24T00:24:38-05:00", - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e", - "display": "Dr. Cedrick207 Lind531" - }, - "dosageInstruction": [ - { - "sequence": 1, - "asNeededBoolean": true - } - ] - }, - "request": { - "method": "POST", - "url": "MedicationRequest" - } - }, - { - "fullUrl": "urn:uuid:41cdd5a1-c2b4-4c21-8490-2eefb931c958", - "resource": { - "resourceType": "Claim", - "id": "41cdd5a1-c2b4-4c21-8490-2eefb931c958", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "pharmacy" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "1968-11-10T00:24:38-05:00", - "end": "1968-11-24T00:24:38-05:00" - }, - "created": "1968-11-24T00:24:38-05:00", - "provider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - }, - "priority": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/processpriority", - "code": "normal" - } - ] - }, - "prescription": { - "reference": "urn:uuid:1f14d2ae-a3bd-412b-9068-35efef091e2c" - }, - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "item": [ - { - "sequence": 1, - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "185345009", - "display": "Encounter for symptom" - } - ], - "text": "Encounter for symptom" - }, - "encounter": [ - { - "reference": "urn:uuid:294bdfba-55a3-44f7-b208-cb5835a67424" - } - ] - } - ], - "total": { - "value": 6.77, - "currency": "USD" - } - }, - "request": { - "method": "POST", - "url": "Claim" - } - }, - { - "fullUrl": "urn:uuid:61cd342f-cd24-47d6-85d3-bf74746e5c36", - "resource": { - "resourceType": "Claim", - "id": "61cd342f-cd24-47d6-85d3-bf74746e5c36", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "1968-11-10T00:24:38-05:00", - "end": "1968-11-24T00:24:38-05:00" - }, - "created": "1968-11-24T00:24:38-05:00", - "provider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - }, - "priority": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/processpriority", - "code": "normal" - } - ] - }, - "diagnosis": [ - { - "sequence": 1, - "diagnosisReference": { - "reference": "urn:uuid:54c20754-d436-4f6b-a0a5-466fd36665a9" - } - } - ], - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "item": [ - { - "sequence": 1, - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "185345009", - "display": "Encounter for symptom" - } - ], - "text": "Encounter for symptom" - }, - "encounter": [ - { - "reference": "urn:uuid:294bdfba-55a3-44f7-b208-cb5835a67424" - } - ] - }, - { - "sequence": 2, - "diagnosisSequence": [ - 1 - ], - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "367498001", - "display": "Seasonal allergic rhinitis" - } - ], - "text": "Seasonal allergic rhinitis" - } - } - ], - "total": { - "value": 129.16, - "currency": "USD" - } - }, - "request": { - "method": "POST", - "url": "Claim" - } - }, - { - "fullUrl": "urn:uuid:3d193393-8532-47a2-b50f-43879ae73316", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "3d193393-8532-47a2-b50f-43879ae73316", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "61cd342f-cd24-47d6-85d3-bf74746e5c36" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "1968-11-24T00:24:38-05:00", - "end": "1969-11-24T00:24:38-05:00" - }, - "created": "1968-11-24T00:24:38-05:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:61cd342f-cd24-47d6-85d3-bf74746e5c36" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "diagnosis": [ - { - "sequence": 1, - "diagnosisReference": { - "reference": "urn:uuid:54c20754-d436-4f6b-a0a5-466fd36665a9" - }, - "type": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", - "code": "principal" - } - ] - } - ] - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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": "1968-11-10T00:24:38-05:00", - "end": "1968-11-24T00:24:38-05:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "21", - "display": "Inpatient Hospital" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:294bdfba-55a3-44f7-b208-cb5835a67424" - } - ] - }, - { - "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": "367498001", - "display": "Seasonal allergic rhinitis" - } - ], - "text": "Seasonal allergic rhinitis" - }, - "servicedPeriod": { - "start": "1968-11-10T00:24:38-05:00", - "end": "1968-11-24T00:24:38-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:81db737b-092f-469d-a898-03c15260e6a6", - "resource": { - "resourceType": "Encounter", - "id": "81db737b-092f-469d-a898-03c15260e6a6", - "status": "finished", - "class": { - "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", - "code": "AMB" - }, - "type": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "185347001", - "display": "Encounter for problem" - } - ], - "text": "Encounter for problem" - } - ], - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e", - "display": "Dr. Cedrick207 Lind531" - } - } - ], - "period": { - "start": "1968-11-29T00:24:38-05:00", - "end": "1968-11-29T00:39:38-05:00" - }, - "serviceProvider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:2b48d92c-5f92-46ee-9777-b42112b35cb3", - "resource": { - "resourceType": "AllergyIntolerance", - "id": "2b48d92c-5f92-46ee-9777-b42112b35cb3", - "clinicalStatus": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", - "code": "active" - } - ] - }, - "verificationStatus": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", - "code": "confirmed" - } - ] - }, - "type": "allergy", - "category": [ - "food" - ], - "criticality": "low", - "code": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "300916003", - "display": "Latex allergy" - } - ], - "text": "Latex allergy" - }, - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "recordedDate": "1968-11-29T00:24:38-05:00" - }, - "request": { - "method": "POST", - "url": "AllergyIntolerance" - } - }, - { - "fullUrl": "urn:uuid:2d6f8548-1344-4a6f-b2ea-af43b808439c", - "resource": { - "resourceType": "AllergyIntolerance", - "id": "2d6f8548-1344-4a6f-b2ea-af43b808439c", - "clinicalStatus": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", - "code": "active" - } - ] - }, - "verificationStatus": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", - "code": "confirmed" - } - ] - }, - "type": "allergy", - "category": [ - "food" - ], - "criticality": "low", - "code": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "419474003", - "display": "Allergy to mould" - } - ], - "text": "Allergy to mould" - }, - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "recordedDate": "1968-11-29T00:24:38-05:00" - }, - "request": { - "method": "POST", - "url": "AllergyIntolerance" - } - }, - { - "fullUrl": "urn:uuid:6840b5f7-e097-4ba7-b35b-0c3b0770a2b1", - "resource": { - "resourceType": "AllergyIntolerance", - "id": "6840b5f7-e097-4ba7-b35b-0c3b0770a2b1", - "clinicalStatus": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", - "code": "active" - } - ] - }, - "verificationStatus": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", - "code": "confirmed" - } - ] - }, - "type": "allergy", - "category": [ - "food" - ], - "criticality": "low", - "code": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "232350006", - "display": "House dust mite allergy" - } - ], - "text": "House dust mite allergy" - }, - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "recordedDate": "1968-11-29T00:24:38-05:00" - }, - "request": { - "method": "POST", - "url": "AllergyIntolerance" - } - }, - { - "fullUrl": "urn:uuid:72c5fe15-5835-4e6f-a645-fa8659faa1dd", - "resource": { - "resourceType": "AllergyIntolerance", - "id": "72c5fe15-5835-4e6f-a645-fa8659faa1dd", - "clinicalStatus": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", - "code": "active" - } - ] - }, - "verificationStatus": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", - "code": "confirmed" - } - ] - }, - "type": "allergy", - "category": [ - "food" - ], - "criticality": "low", - "code": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "232347008", - "display": "Dander (animal) allergy" - } - ], - "text": "Dander (animal) allergy" - }, - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "recordedDate": "1968-11-29T00:24:38-05:00" - }, - "request": { - "method": "POST", - "url": "AllergyIntolerance" - } - }, - { - "fullUrl": "urn:uuid:a62570ee-1e8d-410b-b353-786a036b4ac8", - "resource": { - "resourceType": "AllergyIntolerance", - "id": "a62570ee-1e8d-410b-b353-786a036b4ac8", - "clinicalStatus": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", - "code": "active" - } - ] - }, - "verificationStatus": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", - "code": "confirmed" - } - ] - }, - "type": "allergy", - "category": [ - "food" - ], - "criticality": "low", - "code": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "419263009", - "display": "Allergy to tree pollen" - } - ], - "text": "Allergy to tree pollen" - }, - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "recordedDate": "1968-11-29T00:24:38-05:00" - }, - "request": { - "method": "POST", - "url": "AllergyIntolerance" - } - }, - { - "fullUrl": "urn:uuid:5ffad690-a0b1-4756-a7e1-120cd880090a", - "resource": { - "resourceType": "CareTeam", - "id": "5ffad690-a0b1-4756-a7e1-120cd880090a", - "status": "active", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:81db737b-092f-469d-a898-03c15260e6a6" - }, - "period": { - "start": "1968-11-29T00:24:38-05:00" - }, - "participant": [ - { - "role": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "116153009", - "display": "Patient" - } - ], - "text": "Patient" - } - ], - "member": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - } - }, - { - "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-00000000001e", - "display": "Dr. Cedrick207 Lind531" - } - }, - { - "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:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - } - } - ], - "managingOrganization": [ - { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - } - ] - }, - "request": { - "method": "POST", - "url": "CareTeam" - } - }, - { - "fullUrl": "urn:uuid:1154ba7a-df80-4753-aef8-61351cc1817c", - "resource": { - "resourceType": "CarePlan", - "id": "1154ba7a-df80-4753-aef8-61351cc1817c", - "text": { - "status": "generated", - "div": "
Care Plan for Self care.
Activities:
  • Self care
" - }, - "status": "active", - "intent": "order", - "category": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "326051000000105", - "display": "Self care" - } - ], - "text": "Self care" - } - ], - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:81db737b-092f-469d-a898-03c15260e6a6" - }, - "period": { - "start": "1968-11-29T00:24:38-05:00" - }, - "careTeam": [ - { - "reference": "urn:uuid:5ffad690-a0b1-4756-a7e1-120cd880090a" - } - ], - "activity": [ - { - "detail": { - "code": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "58332002", - "display": "Allergy education" - } - ], - "text": "Allergy education" - }, - "status": "in-progress", - "location": { - "display": "LAWRENCE GENERAL HOSPITAL" - } - } - } - ] - }, - "request": { - "method": "POST", - "url": "CarePlan" - } - }, - { - "fullUrl": "urn:uuid:6a0eef16-49a0-41a2-b3cb-322c14eaab8d", - "resource": { - "resourceType": "Claim", - "id": "6a0eef16-49a0-41a2-b3cb-322c14eaab8d", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "1968-11-29T00:24:38-05:00", - "end": "1968-11-29T00:39:38-05:00" - }, - "created": "1968-11-29T00:39:38-05:00", - "provider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - }, - "priority": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/processpriority", - "code": "normal" - } - ] - }, - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "item": [ - { - "sequence": 1, - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "185347001", - "display": "Encounter for problem" - } - ], - "text": "Encounter for problem" - }, - "encounter": [ - { - "reference": "urn:uuid:81db737b-092f-469d-a898-03c15260e6a6" - } - ] - } - ], - "total": { - "value": 129.16, - "currency": "USD" - } - }, - "request": { - "method": "POST", - "url": "Claim" - } - }, - { - "fullUrl": "urn:uuid:aef924ce-6797-4c16-8882-9bea844e5e5b", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "aef924ce-6797-4c16-8882-9bea844e5e5b", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "6a0eef16-49a0-41a2-b3cb-322c14eaab8d" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "1968-11-29T00:39:38-05:00", - "end": "1969-11-29T00:39:38-05:00" - }, - "created": "1968-11-29T00:39:38-05:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:6a0eef16-49a0-41a2-b3cb-322c14eaab8d" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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": "185347001", - "display": "Encounter for problem" - } - ], - "text": "Encounter for problem" - }, - "servicedPeriod": { - "start": "1968-11-29T00:24:38-05:00", - "end": "1968-11-29T00:39:38-05:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "21", - "display": "Inpatient Hospital" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:81db737b-092f-469d-a898-03c15260e6a6" - } - ] - } - ], - "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:54f6fc59-7709-310f-9249-1e92d0464b00", - "resource": { - "resourceType": "Organization", - "id": "54f6fc59-7709-310f-9249-1e92d0464b00", - "identifier": [ - { - "system": "https://github.com/synthetichealth/synthea", - "value": "54f6fc59-7709-310f-9249-1e92d0464b00" - } - ], - "active": true, - "type": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/organization-type", - "code": "prov", - "display": "Healthcare Provider" - } - ], - "text": "Healthcare Provider" - } - ], - "name": "PCP145391", - "address": [ - { - "line": [ - "21 MAIN ST" - ], - "city": "NORTH READING", - "state": "MA", - "postalCode": "01864-2270", - "country": "US" - } - ] - }, - "request": { - "method": "POST", - "url": "Organization" - } - }, - { - "fullUrl": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710", - "resource": { - "resourceType": "Practitioner", - "id": "0000016d-3a85-4cca-0000-00000000c710", - "identifier": [ - { - "system": "http://hl7.org/fhir/sid/us-npi", - "value": "50960" - } - ], - "active": true, - "name": [ - { - "family": "Cummerata161", - "given": [ - "Shantae970" - ], - "prefix": [ - "Dr." - ] - } - ], - "telecom": [ - { - "system": "email", - "value": "Shantae970.Cummerata161@example.com", - "use": "work" - } - ], - "address": [ - { - "line": [ - "21 MAIN ST" - ], - "city": "NORTH READING", - "state": "MA", - "postalCode": "01864-2270", - "country": "US" - } - ], - "gender": "female" - }, - "request": { - "method": "POST", - "url": "Practitioner" - } - }, - { - "fullUrl": "urn:uuid:51142185-4752-442c-a9ed-bb8ea0b31dd4", - "resource": { - "resourceType": "Encounter", - "id": "51142185-4752-442c-a9ed-bb8ea0b31dd4", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710", - "display": "Dr. Shantae970 Cummerata161" - } - } - ], - "period": { - "start": "1983-12-29T00:24:38-05:00", - "end": "1983-12-29T00:54:38-05:00" - }, - "serviceProvider": { - "reference": "urn:uuid:54f6fc59-7709-310f-9249-1e92d0464b00", - "display": "PCP145391" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:52207d7f-0b29-4fbd-a8ed-4b3f73373ef6", - "resource": { - "resourceType": "Condition", - "id": "52207d7f-0b29-4fbd-a8ed-4b3f73373ef6", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:51142185-4752-442c-a9ed-bb8ea0b31dd4" - }, - "onsetDateTime": "1983-12-29T00:24:38-05:00", - "recordedDate": "1983-12-29T00:24:38-05:00" - }, - "request": { - "method": "POST", - "url": "Condition" - } - }, - { - "fullUrl": "urn:uuid:d64f4b7d-0267-4476-a83c-57b52f1c7eab", - "resource": { - "resourceType": "MedicationRequest", - "id": "d64f4b7d-0267-4476-a83c-57b52f1c7eab", - "status": "active", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:51142185-4752-442c-a9ed-bb8ea0b31dd4" - }, - "authoredOn": "1983-12-29T00:24:38-05:00", - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710", - "display": "Dr. Shantae970 Cummerata161" - }, - "reasonReference": [ - { - "reference": "urn:uuid:52207d7f-0b29-4fbd-a8ed-4b3f73373ef6" - } - ] - }, - "request": { - "method": "POST", - "url": "MedicationRequest" - } - }, - { - "fullUrl": "urn:uuid:244423ca-353d-4294-b3ab-37e92f6b8d61", - "resource": { - "resourceType": "Claim", - "id": "244423ca-353d-4294-b3ab-37e92f6b8d61", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "pharmacy" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "1983-12-29T00:24:38-05:00", - "end": "1983-12-29T00:54:38-05:00" - }, - "created": "1983-12-29T00:54:38-05:00", - "provider": { - "reference": "urn:uuid:54f6fc59-7709-310f-9249-1e92d0464b00", - "display": "PCP145391" - }, - "priority": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/processpriority", - "code": "normal" - } - ] - }, - "prescription": { - "reference": "urn:uuid:d64f4b7d-0267-4476-a83c-57b52f1c7eab" - }, - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "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:51142185-4752-442c-a9ed-bb8ea0b31dd4" - } - ] - } - ], - "total": { - "value": 263.49, - "currency": "USD" - } - }, - "request": { - "method": "POST", - "url": "Claim" - } - }, - { - "fullUrl": "urn:uuid:ba4d5d85-c7ca-4c93-ab81-4a6bb23d6a7f", - "resource": { - "resourceType": "CareTeam", - "id": "ba4d5d85-c7ca-4c93-ab81-4a6bb23d6a7f", - "status": "active", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:51142185-4752-442c-a9ed-bb8ea0b31dd4" - }, - "period": { - "start": "1983-12-29T00:24:38-05:00" - }, - "participant": [ - { - "role": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "116153009", - "display": "Patient" - } - ], - "text": "Patient" - } - ], - "member": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - } - }, - { - "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-00000000c710", - "display": "Dr. Shantae970 Cummerata161" - } - }, - { - "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:54f6fc59-7709-310f-9249-1e92d0464b00", - "display": "PCP145391" - } - } - ], - "reasonCode": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "59621000", - "display": "Hypertension" - } - ], - "text": "Hypertension" - } - ], - "managingOrganization": [ - { - "reference": "urn:uuid:54f6fc59-7709-310f-9249-1e92d0464b00", - "display": "PCP145391" - } - ] - }, - "request": { - "method": "POST", - "url": "CareTeam" - } - }, - { - "fullUrl": "urn:uuid:cf5a54a4-2ec8-4acd-871f-1a59bbe7d992", - "resource": { - "resourceType": "Goal", - "id": "cf5a54a4-2ec8-4acd-871f-1a59bbe7d992", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - } - }, - "request": { - "method": "POST", - "url": "Goal" - } - }, - { - "fullUrl": "urn:uuid:0271e0b9-1743-49f0-a414-84826fd63d50", - "resource": { - "resourceType": "Goal", - "id": "0271e0b9-1743-49f0-a414-84826fd63d50", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - } - }, - "request": { - "method": "POST", - "url": "Goal" - } - }, - { - "fullUrl": "urn:uuid:c7fc97e5-f9e4-4fec-9525-051ddd1c6262", - "resource": { - "resourceType": "CarePlan", - "id": "c7fc97e5-f9e4-4fec-9525-051ddd1c6262", - "text": { - "status": "generated", - "div": "
Care Plan for Lifestyle education regarding hypertension.
Activities:
  • Lifestyle education regarding hypertension
  • Lifestyle education regarding hypertension
  • Lifestyle education regarding hypertension
  • Lifestyle education regarding hypertension

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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:51142185-4752-442c-a9ed-bb8ea0b31dd4" - }, - "period": { - "start": "1983-12-29T00:24:38-05:00" - }, - "careTeam": [ - { - "reference": "urn:uuid:ba4d5d85-c7ca-4c93-ab81-4a6bb23d6a7f" - } - ], - "addresses": [ - { - "reference": "urn:uuid:52207d7f-0b29-4fbd-a8ed-4b3f73373ef6" - } - ], - "goal": [ - { - "reference": "urn:uuid:cf5a54a4-2ec8-4acd-871f-1a59bbe7d992" - }, - { - "reference": "urn:uuid:0271e0b9-1743-49f0-a414-84826fd63d50" - } - ], - "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": "PCP145391" - } - } - }, - { - "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": "PCP145391" - } - } - }, - { - "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": "PCP145391" - } - } - }, - { - "detail": { - "code": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "225323000", - "display": "Smoking cessation education" - } - ], - "text": "Smoking cessation education" - }, - "status": "in-progress", - "location": { - "display": "PCP145391" - } - } - } - ] - }, - "request": { - "method": "POST", - "url": "CarePlan" - } - }, - { - "fullUrl": "urn:uuid:92f51b68-9ec2-499b-a6ba-b374200d9766", - "resource": { - "resourceType": "Claim", - "id": "92f51b68-9ec2-499b-a6ba-b374200d9766", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "1983-12-29T00:24:38-05:00", - "end": "1983-12-29T00:54:38-05:00" - }, - "created": "1983-12-29T00:54:38-05:00", - "provider": { - "reference": "urn:uuid:54f6fc59-7709-310f-9249-1e92d0464b00", - "display": "PCP145391" - }, - "priority": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/processpriority", - "code": "normal" - } - ] - }, - "diagnosis": [ - { - "sequence": 1, - "diagnosisReference": { - "reference": "urn:uuid:52207d7f-0b29-4fbd-a8ed-4b3f73373ef6" - } - } - ], - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "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:51142185-4752-442c-a9ed-bb8ea0b31dd4" - } - ] - }, - { - "sequence": 2, - "diagnosisSequence": [ - 1 - ], - "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:54b88b5e-69b9-4d7e-ab6a-48b23e71004a", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "54b88b5e-69b9-4d7e-ab6a-48b23e71004a", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "92f51b68-9ec2-499b-a6ba-b374200d9766" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "1983-12-29T00:54:38-05:00", - "end": "1984-12-29T00:54:38-05:00" - }, - "created": "1983-12-29T00:54:38-05:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:92f51b68-9ec2-499b-a6ba-b374200d9766" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "diagnosis": [ - { - "sequence": 1, - "diagnosisReference": { - "reference": "urn:uuid:52207d7f-0b29-4fbd-a8ed-4b3f73373ef6" - }, - "type": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", - "code": "principal" - } - ] - } - ] - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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": "1983-12-29T00:24:38-05:00", - "end": "1983-12-29T00:54:38-05:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "19", - "display": "Off Campus-Outpatient Hospital" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:51142185-4752-442c-a9ed-bb8ea0b31dd4" - } - ] - }, - { - "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": "59621000", - "display": "Hypertension" - } - ], - "text": "Hypertension" - }, - "servicedPeriod": { - "start": "1983-12-29T00:24:38-05:00", - "end": "1983-12-29T00:54:38-05: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": 0.0, - "currency": "USD" - } - } - }, - "request": { - "method": "POST", - "url": "ExplanationOfBenefit" - } - }, - { - "fullUrl": "urn:uuid:6d846e9f-40c3-42b5-a952-4401164102f7", - "resource": { - "resourceType": "Encounter", - "id": "6d846e9f-40c3-42b5-a952-4401164102f7", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710", - "display": "Dr. Shantae970 Cummerata161" - } - } - ], - "period": { - "start": "2009-11-19T00:24:38-05:00", - "end": "2009-11-19T00:39:38-05:00" - }, - "serviceProvider": { - "reference": "urn:uuid:54f6fc59-7709-310f-9249-1e92d0464b00", - "display": "PCP145391" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:87e26906-c3d6-424b-a0b8-28f51e7e00de", - "resource": { - "resourceType": "Observation", - "id": "87e26906-c3d6-424b-a0b8-28f51e7e00de", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:6d846e9f-40c3-42b5-a952-4401164102f7" - }, - "effectiveDateTime": "2009-11-19T00:24:38-05:00", - "issued": "2009-11-19T00:24:38.752-05:00", - "valueQuantity": { - "value": 155.01680645430415, - "unit": "cm", - "system": "http://unitsofmeasure.org", - "code": "cm" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:2231ce31-cf31-4d96-80c6-93cedad1ab82", - "resource": { - "resourceType": "Observation", - "id": "2231ce31-cf31-4d96-80c6-93cedad1ab82", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:6d846e9f-40c3-42b5-a952-4401164102f7" - }, - "effectiveDateTime": "2009-11-19T00:24:38-05:00", - "issued": "2009-11-19T00:24:38.752-05:00", - "valueQuantity": { - "value": 3.3512054198931174, - "unit": "{score}", - "system": "http://unitsofmeasure.org", - "code": "{score}" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:b21bb015-9965-4aed-8928-8da75982cb90", - "resource": { - "resourceType": "Observation", - "id": "b21bb015-9965-4aed-8928-8da75982cb90", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:6d846e9f-40c3-42b5-a952-4401164102f7" - }, - "effectiveDateTime": "2009-11-19T00:24:38-05:00", - "issued": "2009-11-19T00:24:38.752-05:00", - "valueQuantity": { - "value": 65.79684973105927, - "unit": "kg", - "system": "http://unitsofmeasure.org", - "code": "kg" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:3580afa4-29dc-4706-8074-dc783b6da239", - "resource": { - "resourceType": "Observation", - "id": "3580afa4-29dc-4706-8074-dc783b6da239", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:6d846e9f-40c3-42b5-a952-4401164102f7" - }, - "effectiveDateTime": "2009-11-19T00:24:38-05:00", - "issued": "2009-11-19T00:24:38.752-05:00", - "valueQuantity": { - "value": 27.38088803859094, - "unit": "kg/m2", - "system": "http://unitsofmeasure.org", - "code": "kg/m2" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:3088c179-0ef9-4fe7-899e-8a941bdac6f7", - "resource": { - "resourceType": "Observation", - "id": "3088c179-0ef9-4fe7-899e-8a941bdac6f7", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:6d846e9f-40c3-42b5-a952-4401164102f7" - }, - "effectiveDateTime": "2009-11-19T00:24:38-05:00", - "issued": "2009-11-19T00:24:38.752-05:00", - "component": [ - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "8462-4", - "display": "Diastolic Blood Pressure" - } - ], - "text": "Diastolic Blood Pressure" - }, - "valueQuantity": { - "value": 84.85191424756442, - "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": 103.6779728677694, - "unit": "mm[Hg]", - "system": "http://unitsofmeasure.org", - "code": "mm[Hg]" - } - } - ] - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:a2bb184e-d641-4585-ae20-153e8047b476", - "resource": { - "resourceType": "Observation", - "id": "a2bb184e-d641-4585-ae20-153e8047b476", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:6d846e9f-40c3-42b5-a952-4401164102f7" - }, - "effectiveDateTime": "2009-11-19T00:24:38-05:00", - "issued": "2009-11-19T00:24:38.752-05:00", - "valueCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "8517006", - "display": "Former smoker" - } - ], - "text": "Former smoker" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:b0af72c9-4314-4e9b-80a4-4c5d15a16bef", - "resource": { - "resourceType": "Immunization", - "id": "b0af72c9-4314-4e9b-80a4-4c5d15a16bef", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:6d846e9f-40c3-42b5-a952-4401164102f7" - }, - "occurrenceDateTime": "2009-11-19T00:24:38-05:00", - "primarySource": true - }, - "request": { - "method": "POST", - "url": "Immunization" - } - }, - { - "fullUrl": "urn:uuid:d11073f7-618e-4b5e-b92b-25e5ec16866d", - "resource": { - "resourceType": "Claim", - "id": "d11073f7-618e-4b5e-b92b-25e5ec16866d", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "2009-11-19T00:24:38-05:00", - "end": "2009-11-19T00:39:38-05:00" - }, - "created": "2009-11-19T00:39:38-05:00", - "provider": { - "reference": "urn:uuid:54f6fc59-7709-310f-9249-1e92d0464b00", - "display": "PCP145391" - }, - "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:b0af72c9-4314-4e9b-80a4-4c5d15a16bef" - } - } - ], - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "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:6d846e9f-40c3-42b5-a952-4401164102f7" - } - ] - }, - { - "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:00d3d0bd-6866-405e-a67e-45fed5c5c57d", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "00d3d0bd-6866-405e-a67e-45fed5c5c57d", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "d11073f7-618e-4b5e-b92b-25e5ec16866d" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "2009-11-19T00:39:38-05:00", - "end": "2010-11-19T00:39:38-05:00" - }, - "created": "2009-11-19T00:39:38-05:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:d11073f7-618e-4b5e-b92b-25e5ec16866d" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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": "2009-11-19T00:24:38-05:00", - "end": "2009-11-19T00:39:38-05:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "19", - "display": "Off Campus-Outpatient Hospital" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:6d846e9f-40c3-42b5-a952-4401164102f7" - } - ] - }, - { - "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": "2009-11-19T00:24:38-05:00", - "end": "2009-11-19T00:39:38-05: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:4f761b91-7603-461e-aecd-d18f297f6632", - "resource": { - "resourceType": "Encounter", - "id": "4f761b91-7603-461e-aecd-d18f297f6632", - "status": "finished", - "class": { - "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", - "code": "AMB" - }, - "type": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "394701000", - "display": "Asthma follow-up" - } - ], - "text": "Asthma follow-up" - } - ], - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e", - "display": "Dr. Cedrick207 Lind531" - } - } - ], - "period": { - "start": "2010-03-15T01:24:38-04:00", - "end": "2010-03-15T01:39:38-04:00" - }, - "reasonCode": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "195967001", - "display": "Asthma" - } - ] - } - ], - "serviceProvider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:740d7f40-2418-44c8-91dc-1000eba4dc3b", - "resource": { - "resourceType": "Claim", - "id": "740d7f40-2418-44c8-91dc-1000eba4dc3b", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "2010-03-15T01:24:38-04:00", - "end": "2010-03-15T01:39:38-04:00" - }, - "created": "2010-03-15T01:39:38-04:00", - "provider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - }, - "priority": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/processpriority", - "code": "normal" - } - ] - }, - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "item": [ - { - "sequence": 1, - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "394701000", - "display": "Asthma follow-up" - } - ], - "text": "Asthma follow-up" - }, - "encounter": [ - { - "reference": "urn:uuid:4f761b91-7603-461e-aecd-d18f297f6632" - } - ] - } - ], - "total": { - "value": 129.16, - "currency": "USD" - } - }, - "request": { - "method": "POST", - "url": "Claim" - } - }, - { - "fullUrl": "urn:uuid:4bdb9df2-97fe-4faa-bee4-25f2d5df7547", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "4bdb9df2-97fe-4faa-bee4-25f2d5df7547", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "740d7f40-2418-44c8-91dc-1000eba4dc3b" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "2010-03-15T01:39:38-04:00", - "end": "2011-03-15T01:39:38-04:00" - }, - "created": "2010-03-15T01:39:38-04:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:740d7f40-2418-44c8-91dc-1000eba4dc3b" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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": "394701000", - "display": "Asthma follow-up" - } - ], - "text": "Asthma follow-up" - }, - "servicedPeriod": { - "start": "2010-03-15T01:24:38-04:00", - "end": "2010-03-15T01:39:38-04:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "21", - "display": "Inpatient Hospital" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:4f761b91-7603-461e-aecd-d18f297f6632" - } - ] - } - ], - "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:f0dfdfb3-d42d-428c-9314-d68283fcf087", - "resource": { - "resourceType": "Encounter", - "id": "f0dfdfb3-d42d-428c-9314-d68283fcf087", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e", - "display": "Dr. Cedrick207 Lind531" - } - } - ], - "period": { - "start": "2010-03-22T01:24:38-04:00", - "end": "2010-03-22T01:54:38-04:00" - }, - "reasonCode": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "195662009", - "display": "Acute viral pharyngitis (disorder)" - } - ] - } - ], - "serviceProvider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:20ff4a63-ada1-44f4-bff7-d951b0de4a2a", - "resource": { - "resourceType": "Condition", - "id": "20ff4a63-ada1-44f4-bff7-d951b0de4a2a", - "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": "195662009", - "display": "Acute viral pharyngitis (disorder)" - } - ], - "text": "Acute viral pharyngitis (disorder)" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:f0dfdfb3-d42d-428c-9314-d68283fcf087" - }, - "onsetDateTime": "2010-03-22T01:24:38-04:00", - "abatementDateTime": "2010-03-30T01:24:38-04:00", - "recordedDate": "2010-03-22T01:24:38-04:00" - }, - "request": { - "method": "POST", - "url": "Condition" - } - }, - { - "fullUrl": "urn:uuid:09f5c351-3462-4977-9e41-fcd493d08e18", - "resource": { - "resourceType": "Observation", - "id": "09f5c351-3462-4977-9e41-fcd493d08e18", - "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": "8331-1", - "display": "Oral temperature" - } - ], - "text": "Oral temperature" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:f0dfdfb3-d42d-428c-9314-d68283fcf087" - }, - "effectiveDateTime": "2010-03-22T01:24:38-04:00", - "issued": "2010-03-22T01:24:38.752-04:00", - "valueQuantity": { - "value": 37.165995943945376, - "unit": "Cel", - "system": "http://unitsofmeasure.org", - "code": "Cel" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:b491e8d4-248f-4069-8098-a02cf194fc41", - "resource": { - "resourceType": "Procedure", - "id": "b491e8d4-248f-4069-8098-a02cf194fc41", - "status": "completed", - "code": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "117015009", - "display": "Throat culture (procedure)" - } - ], - "text": "Throat culture (procedure)" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:f0dfdfb3-d42d-428c-9314-d68283fcf087" - }, - "performedPeriod": { - "start": "2010-03-22T01:24:38-04:00", - "end": "2010-03-22T01:39:38-04:00" - }, - "reasonReference": [ - { - "reference": "urn:uuid:20ff4a63-ada1-44f4-bff7-d951b0de4a2a", - "display": "Acute viral pharyngitis (disorder)" - } - ] - }, - "request": { - "method": "POST", - "url": "Procedure" - } - }, - { - "fullUrl": "urn:uuid:5e6e954f-8767-4479-b2fd-908554450698", - "resource": { - "resourceType": "Claim", - "id": "5e6e954f-8767-4479-b2fd-908554450698", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "2010-03-22T01:24:38-04:00", - "end": "2010-03-22T01:54:38-04:00" - }, - "created": "2010-03-22T01:54:38-04:00", - "provider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - }, - "priority": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/processpriority", - "code": "normal" - } - ] - }, - "diagnosis": [ - { - "sequence": 1, - "diagnosisReference": { - "reference": "urn:uuid:20ff4a63-ada1-44f4-bff7-d951b0de4a2a" - } - } - ], - "procedure": [ - { - "sequence": 1, - "procedureReference": { - "reference": "urn:uuid:b491e8d4-248f-4069-8098-a02cf194fc41" - } - } - ], - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "item": [ - { - "sequence": 1, - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "185345009", - "display": "Encounter for symptom" - } - ], - "text": "Encounter for symptom" - }, - "encounter": [ - { - "reference": "urn:uuid:f0dfdfb3-d42d-428c-9314-d68283fcf087" - } - ] - }, - { - "sequence": 2, - "diagnosisSequence": [ - 1 - ], - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "195662009", - "display": "Acute viral pharyngitis (disorder)" - } - ], - "text": "Acute viral pharyngitis (disorder)" - } - }, - { - "sequence": 3, - "procedureSequence": [ - 1 - ], - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "117015009", - "display": "Throat culture (procedure)" - } - ], - "text": "Throat culture (procedure)" - }, - "net": { - "value": 1327.91, - "currency": "USD" - } - } - ], - "total": { - "value": 129.16, - "currency": "USD" - } - }, - "request": { - "method": "POST", - "url": "Claim" - } - }, - { - "fullUrl": "urn:uuid:ce04e563-4435-4383-b2c1-536b9595f39e", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "ce04e563-4435-4383-b2c1-536b9595f39e", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "5e6e954f-8767-4479-b2fd-908554450698" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "2010-03-22T01:54:38-04:00", - "end": "2011-03-22T01:54:38-04:00" - }, - "created": "2010-03-22T01:54:38-04:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:5e6e954f-8767-4479-b2fd-908554450698" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "diagnosis": [ - { - "sequence": 1, - "diagnosisReference": { - "reference": "urn:uuid:20ff4a63-ada1-44f4-bff7-d951b0de4a2a" - }, - "type": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", - "code": "principal" - } - ] - } - ] - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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": "2010-03-22T01:24:38-04:00", - "end": "2010-03-22T01:54:38-04:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "21", - "display": "Inpatient Hospital" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:f0dfdfb3-d42d-428c-9314-d68283fcf087" - } - ] - }, - { - "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": "195662009", - "display": "Acute viral pharyngitis (disorder)" - } - ], - "text": "Acute viral pharyngitis (disorder)" - }, - "servicedPeriod": { - "start": "2010-03-22T01:24:38-04:00", - "end": "2010-03-22T01:54:38-04:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "21", - "display": "Inpatient Hospital" - } - ] - } - }, - { - "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": "117015009", - "display": "Throat culture (procedure)" - } - ], - "text": "Throat culture (procedure)" - }, - "servicedPeriod": { - "start": "2010-03-22T01:24:38-04:00", - "end": "2010-03-22T01:54:38-04:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "21", - "display": "Inpatient Hospital" - } - ] - }, - "net": { - "value": 1327.91, - "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": 265.58200000000005, - "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": 1062.3280000000002, - "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": 1327.91, - "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": 1327.91, - "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": 1062.3280000000002, - "currency": "USD" - } - } - }, - "request": { - "method": "POST", - "url": "ExplanationOfBenefit" - } - }, - { - "fullUrl": "urn:uuid:f1313c7d-3148-335b-adc3-337f15567b82", - "resource": { - "resourceType": "Organization", - "id": "f1313c7d-3148-335b-adc3-337f15567b82", - "identifier": [ - { - "system": "https://github.com/synthetichealth/synthea", - "value": "f1313c7d-3148-335b-adc3-337f15567b82" - } - ], - "active": true, - "type": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/organization-type", - "code": "prov", - "display": "Healthcare Provider" - } - ], - "text": "Healthcare Provider" - } - ], - "name": "WINCHESTER HOSPITAL FAMILY MEDICAL CENTER", - "telecom": [ - { - "system": "phone", - "value": "978-988-6105" - } - ], - "address": [ - { - "line": [ - "500 SALEM STREET" - ], - "city": "WILMINGTON", - "state": "MA", - "postalCode": "1887", - "country": "US" - } - ] - }, - "request": { - "method": "POST", - "url": "Organization" - } - }, - { - "fullUrl": "urn:uuid:0000016d-3a85-4cca-0000-000000016c9c", - "resource": { - "resourceType": "Practitioner", - "id": "0000016d-3a85-4cca-0000-000000016c9c", - "identifier": [ - { - "system": "http://hl7.org/fhir/sid/us-npi", - "value": "93340" - } - ], - "active": true, - "name": [ - { - "family": "Pouros728", - "given": [ - "Jacquelyn628" - ], - "prefix": [ - "Dr." - ] - } - ], - "telecom": [ - { - "system": "email", - "value": "Jacquelyn628.Pouros728@example.com", - "use": "work" - } - ], - "address": [ - { - "line": [ - "500 SALEM STREET" - ], - "city": "WILMINGTON", - "state": "MA", - "postalCode": "1887", - "country": "US" - } - ], - "gender": "female" - }, - "request": { - "method": "POST", - "url": "Practitioner" - } - }, - { - "fullUrl": "urn:uuid:31c17645-917b-4a93-8351-f8082dc5ac4e", - "resource": { - "resourceType": "Encounter", - "id": "31c17645-917b-4a93-8351-f8082dc5ac4e", - "status": "finished", - "class": { - "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", - "code": "AMB" - }, - "type": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "702927004", - "display": "Urgent care clinic (procedure)" - } - ], - "text": "Urgent care clinic (procedure)" - } - ], - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-000000016c9c", - "display": "Dr. Jacquelyn628 Pouros728" - } - } - ], - "period": { - "start": "2010-04-01T01:24:38-04:00", - "end": "2010-04-01T01:39:38-04:00" - }, - "serviceProvider": { - "reference": "urn:uuid:f1313c7d-3148-335b-adc3-337f15567b82", - "display": "WINCHESTER HOSPITAL FAMILY MEDICAL CENTER" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:0005c0c0-7a46-417b-b856-fd3967e12425", - "resource": { - "resourceType": "Immunization", - "id": "0005c0c0-7a46-417b-b856-fd3967e12425", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:31c17645-917b-4a93-8351-f8082dc5ac4e" - }, - "occurrenceDateTime": "2010-04-01T01:24:38-04:00", - "primarySource": true - }, - "request": { - "method": "POST", - "url": "Immunization" - } - }, - { - "fullUrl": "urn:uuid:bab12743-0520-479b-89d2-a1aca8c4715e", - "resource": { - "resourceType": "Claim", - "id": "bab12743-0520-479b-89d2-a1aca8c4715e", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "2010-04-01T01:24:38-04:00", - "end": "2010-04-01T01:39:38-04:00" - }, - "created": "2010-04-01T01:39:38-04:00", - "provider": { - "reference": "urn:uuid:f1313c7d-3148-335b-adc3-337f15567b82", - "display": "WINCHESTER HOSPITAL FAMILY MEDICAL CENTER" - }, - "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:0005c0c0-7a46-417b-b856-fd3967e12425" - } - } - ], - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "item": [ - { - "sequence": 1, - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "702927004", - "display": "Urgent care clinic (procedure)" - } - ], - "text": "Urgent care clinic (procedure)" - }, - "encounter": [ - { - "reference": "urn:uuid:31c17645-917b-4a93-8351-f8082dc5ac4e" - } - ] - }, - { - "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:d77fe71b-1ef3-4187-8b33-a264a09d9c4d", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "d77fe71b-1ef3-4187-8b33-a264a09d9c4d", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-000000016c9c" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-000000016c9c" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "bab12743-0520-479b-89d2-a1aca8c4715e" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "2010-04-01T01:39:38-04:00", - "end": "2011-04-01T01:39:38-04:00" - }, - "created": "2010-04-01T01:39:38-04:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-000000016c9c" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:bab12743-0520-479b-89d2-a1aca8c4715e" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-000000016c9c" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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": "702927004", - "display": "Urgent care clinic (procedure)" - } - ], - "text": "Urgent care clinic (procedure)" - }, - "servicedPeriod": { - "start": "2010-04-01T01:24:38-04:00", - "end": "2010-04-01T01:39:38-04:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "20", - "display": "Urgent Care Facility" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:31c17645-917b-4a93-8351-f8082dc5ac4e" - } - ] - }, - { - "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": "2010-04-01T01:24:38-04:00", - "end": "2010-04-01T01:39:38-04:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "20", - "display": "Urgent Care Facility" - } - ] - }, - "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:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5", - "resource": { - "resourceType": "Encounter", - "id": "b5dbf510-069c-4db5-aa4a-6f5cca4f62f5", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710", - "display": "Dr. Shantae970 Cummerata161" - } - } - ], - "period": { - "start": "2011-11-24T00:24:38-05:00", - "end": "2011-11-24T00:39:38-05:00" - }, - "serviceProvider": { - "reference": "urn:uuid:54f6fc59-7709-310f-9249-1e92d0464b00", - "display": "PCP145391" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:06135771-d68c-49a3-a76c-bd67f244e9ba", - "resource": { - "resourceType": "Observation", - "id": "06135771-d68c-49a3-a76c-bd67f244e9ba", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "valueQuantity": { - "value": 155.01680645430415, - "unit": "cm", - "system": "http://unitsofmeasure.org", - "code": "cm" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:9afc08b7-cced-4256-92c2-3bc88820eff5", - "resource": { - "resourceType": "Observation", - "id": "9afc08b7-cced-4256-92c2-3bc88820eff5", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "valueQuantity": { - "value": 2.5789023713849293, - "unit": "{score}", - "system": "http://unitsofmeasure.org", - "code": "{score}" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:f5bb1c0e-cc13-40ad-8ede-31298b5f2470", - "resource": { - "resourceType": "Observation", - "id": "f5bb1c0e-cc13-40ad-8ede-31298b5f2470", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "valueQuantity": { - "value": 65.79684973105927, - "unit": "kg", - "system": "http://unitsofmeasure.org", - "code": "kg" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:47218695-6cf7-45f6-be1f-e9ef32f49b01", - "resource": { - "resourceType": "Observation", - "id": "47218695-6cf7-45f6-be1f-e9ef32f49b01", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "valueQuantity": { - "value": 27.38088803859094, - "unit": "kg/m2", - "system": "http://unitsofmeasure.org", - "code": "kg/m2" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:b30d3a05-767e-40ee-81a0-bceef6b07a34", - "resource": { - "resourceType": "Observation", - "id": "b30d3a05-767e-40ee-81a0-bceef6b07a34", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "component": [ - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "8462-4", - "display": "Diastolic Blood Pressure" - } - ], - "text": "Diastolic Blood Pressure" - }, - "valueQuantity": { - "value": 72.98831814031367, - "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": 131.85005905322754, - "unit": "mm[Hg]", - "system": "http://unitsofmeasure.org", - "code": "mm[Hg]" - } - } - ] - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:92d29bf9-7185-4bb8-845c-ff21daa0731c", - "resource": { - "resourceType": "Observation", - "id": "92d29bf9-7185-4bb8-845c-ff21daa0731c", - "status": "final", - "category": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/observation-category", - "code": "laboratory", - "display": "laboratory" - } - ] - } - ], - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "2093-3", - "display": "Total Cholesterol" - } - ], - "text": "Total Cholesterol" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "valueQuantity": { - "value": 189.12126181004368, - "unit": "mg/dL", - "system": "http://unitsofmeasure.org", - "code": "mg/dL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:fed82905-ced9-4774-905b-2211d342dacf", - "resource": { - "resourceType": "Observation", - "id": "fed82905-ced9-4774-905b-2211d342dacf", - "status": "final", - "category": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/observation-category", - "code": "laboratory", - "display": "laboratory" - } - ] - } - ], - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "2571-8", - "display": "Triglycerides" - } - ], - "text": "Triglycerides" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "valueQuantity": { - "value": 110.93157888298342, - "unit": "mg/dL", - "system": "http://unitsofmeasure.org", - "code": "mg/dL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:03ccbed2-d2da-455b-8121-fb2974759051", - "resource": { - "resourceType": "Observation", - "id": "03ccbed2-d2da-455b-8121-fb2974759051", - "status": "final", - "category": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/observation-category", - "code": "laboratory", - "display": "laboratory" - } - ] - } - ], - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "18262-6", - "display": "Low Density Lipoprotein Cholesterol" - } - ], - "text": "Low Density Lipoprotein Cholesterol" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "valueQuantity": { - "value": 89.15392652380663, - "unit": "mg/dL", - "system": "http://unitsofmeasure.org", - "code": "mg/dL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:1e23261c-fa8b-4497-bcca-6110e490c0f4", - "resource": { - "resourceType": "Observation", - "id": "1e23261c-fa8b-4497-bcca-6110e490c0f4", - "status": "final", - "category": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/observation-category", - "code": "laboratory", - "display": "laboratory" - } - ] - } - ], - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "2085-9", - "display": "High Density Lipoprotein Cholesterol" - } - ], - "text": "High Density Lipoprotein Cholesterol" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "valueQuantity": { - "value": 77.78101950964036, - "unit": "mg/dL", - "system": "http://unitsofmeasure.org", - "code": "mg/dL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:31d999a0-f89a-4bfd-8cf5-c1fc6054784a", - "resource": { - "resourceType": "Observation", - "id": "31d999a0-f89a-4bfd-8cf5-c1fc6054784a", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "valueQuantity": { - "value": 9.963408128633784, - "unit": "10*3/uL", - "system": "http://unitsofmeasure.org", - "code": "10*3/uL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:3f22617b-498e-485d-9096-b195d90cbef2", - "resource": { - "resourceType": "Observation", - "id": "3f22617b-498e-485d-9096-b195d90cbef2", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "valueQuantity": { - "value": 3.953323310741711, - "unit": "10*6/uL", - "system": "http://unitsofmeasure.org", - "code": "10*6/uL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:1a16a45b-3f9e-43fc-91f8-85cbbb9674f1", - "resource": { - "resourceType": "Observation", - "id": "1a16a45b-3f9e-43fc-91f8-85cbbb9674f1", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "valueQuantity": { - "value": 14.656768990520666, - "unit": "g/dL", - "system": "http://unitsofmeasure.org", - "code": "g/dL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:c4c75eae-9b86-4642-b471-a24f72480c0b", - "resource": { - "resourceType": "Observation", - "id": "c4c75eae-9b86-4642-b471-a24f72480c0b", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "valueQuantity": { - "value": 48.44143477628018, - "unit": "%", - "system": "http://unitsofmeasure.org", - "code": "%" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:8b533527-2970-44a9-9516-9c6b56eb3a53", - "resource": { - "resourceType": "Observation", - "id": "8b533527-2970-44a9-9516-9c6b56eb3a53", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "valueQuantity": { - "value": 89.23779935011983, - "unit": "fL", - "system": "http://unitsofmeasure.org", - "code": "fL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:9c0e0441-a657-4372-ba1c-24a01ab0ffcd", - "resource": { - "resourceType": "Observation", - "id": "9c0e0441-a657-4372-ba1c-24a01ab0ffcd", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "valueQuantity": { - "value": 27.43081477867061, - "unit": "pg", - "system": "http://unitsofmeasure.org", - "code": "pg" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:e7c1564e-e4a8-448a-9ba3-eae24e61514f", - "resource": { - "resourceType": "Observation", - "id": "e7c1564e-e4a8-448a-9ba3-eae24e61514f", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "valueQuantity": { - "value": 33.15719128456441, - "unit": "g/dL", - "system": "http://unitsofmeasure.org", - "code": "g/dL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:0b9da397-a08a-4181-bab2-144957ce2dc3", - "resource": { - "resourceType": "Observation", - "id": "0b9da397-a08a-4181-bab2-144957ce2dc3", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "valueQuantity": { - "value": 44.015084388458064, - "unit": "fL", - "system": "http://unitsofmeasure.org", - "code": "fL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:ce35a31f-e2af-4510-be31-6ecf5bcaba49", - "resource": { - "resourceType": "Observation", - "id": "ce35a31f-e2af-4510-be31-6ecf5bcaba49", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "valueQuantity": { - "value": 210.6273154244719, - "unit": "10*3/uL", - "system": "http://unitsofmeasure.org", - "code": "10*3/uL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:78fd90eb-a447-4ed8-a1c2-6335d9974d91", - "resource": { - "resourceType": "Observation", - "id": "78fd90eb-a447-4ed8-a1c2-6335d9974d91", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "valueQuantity": { - "value": 268.67951473420686, - "unit": "fL", - "system": "http://unitsofmeasure.org", - "code": "fL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:cf37b6d7-243c-41bc-9ac1-50b62d0dbb91", - "resource": { - "resourceType": "Observation", - "id": "cf37b6d7-243c-41bc-9ac1-50b62d0dbb91", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "valueQuantity": { - "value": 11.230019304893485, - "unit": "fL", - "system": "http://unitsofmeasure.org", - "code": "fL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:e96f044a-4cd5-4892-8c7d-aa004fdd18d2", - "resource": { - "resourceType": "Observation", - "id": "e96f044a-4cd5-4892-8c7d-aa004fdd18d2", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "valueCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "8517006", - "display": "Former smoker" - } - ], - "text": "Former smoker" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:91fb533f-942b-44af-8c67-5ea322a27ef6", - "resource": { - "resourceType": "Immunization", - "id": "91fb533f-942b-44af-8c67-5ea322a27ef6", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "occurrenceDateTime": "2011-11-24T00:24:38-05:00", - "primarySource": true - }, - "request": { - "method": "POST", - "url": "Immunization" - } - }, - { - "fullUrl": "urn:uuid:cce6f3b0-ebbf-4d01-8c33-667be472ccc9", - "resource": { - "resourceType": "DiagnosticReport", - "id": "cce6f3b0-ebbf-4d01-8c33-667be472ccc9", - "status": "final", - "category": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0074", - "code": "LAB", - "display": "Laboratory" - } - ] - } - ], - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "57698-3", - "display": "Lipid Panel" - } - ], - "text": "Lipid Panel" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "result": [ - { - "reference": "urn:uuid:92d29bf9-7185-4bb8-845c-ff21daa0731c", - "display": "Total Cholesterol" - }, - { - "reference": "urn:uuid:fed82905-ced9-4774-905b-2211d342dacf", - "display": "Triglycerides" - }, - { - "reference": "urn:uuid:03ccbed2-d2da-455b-8121-fb2974759051", - "display": "Low Density Lipoprotein Cholesterol" - }, - { - "reference": "urn:uuid:1e23261c-fa8b-4497-bcca-6110e490c0f4", - "display": "High Density Lipoprotein Cholesterol" - } - ] - }, - "request": { - "method": "POST", - "url": "DiagnosticReport" - } - }, - { - "fullUrl": "urn:uuid:9f007049-35c6-4b31-8084-022d11181a05", - "resource": { - "resourceType": "DiagnosticReport", - "id": "9f007049-35c6-4b31-8084-022d11181a05", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - }, - "effectiveDateTime": "2011-11-24T00:24:38-05:00", - "issued": "2011-11-24T00:24:38.752-05:00", - "result": [ - { - "reference": "urn:uuid:31d999a0-f89a-4bfd-8cf5-c1fc6054784a", - "display": "Leukocytes [#/volume] in Blood by Automated count" - }, - { - "reference": "urn:uuid:3f22617b-498e-485d-9096-b195d90cbef2", - "display": "Erythrocytes [#/volume] in Blood by Automated count" - }, - { - "reference": "urn:uuid:1a16a45b-3f9e-43fc-91f8-85cbbb9674f1", - "display": "Hemoglobin [Mass/volume] in Blood" - }, - { - "reference": "urn:uuid:c4c75eae-9b86-4642-b471-a24f72480c0b", - "display": "Hematocrit [Volume Fraction] of Blood by Automated count" - }, - { - "reference": "urn:uuid:8b533527-2970-44a9-9516-9c6b56eb3a53", - "display": "MCV [Entitic volume] by Automated count" - }, - { - "reference": "urn:uuid:9c0e0441-a657-4372-ba1c-24a01ab0ffcd", - "display": "MCH [Entitic mass] by Automated count" - }, - { - "reference": "urn:uuid:e7c1564e-e4a8-448a-9ba3-eae24e61514f", - "display": "MCHC [Mass/volume] by Automated count" - }, - { - "reference": "urn:uuid:0b9da397-a08a-4181-bab2-144957ce2dc3", - "display": "Erythrocyte distribution width [Entitic volume] by Automated count" - }, - { - "reference": "urn:uuid:ce35a31f-e2af-4510-be31-6ecf5bcaba49", - "display": "Platelets [#/volume] in Blood by Automated count" - }, - { - "reference": "urn:uuid:78fd90eb-a447-4ed8-a1c2-6335d9974d91", - "display": "Platelet distribution width [Entitic volume] in Blood by Automated count" - }, - { - "reference": "urn:uuid:cf37b6d7-243c-41bc-9ac1-50b62d0dbb91", - "display": "Platelet mean volume [Entitic volume] in Blood by Automated count" - } - ] - }, - "request": { - "method": "POST", - "url": "DiagnosticReport" - } - }, - { - "fullUrl": "urn:uuid:7e580db2-ee89-4bef-a510-12f2ac002519", - "resource": { - "resourceType": "Claim", - "id": "7e580db2-ee89-4bef-a510-12f2ac002519", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "2011-11-24T00:24:38-05:00", - "end": "2011-11-24T00:39:38-05:00" - }, - "created": "2011-11-24T00:39:38-05:00", - "provider": { - "reference": "urn:uuid:54f6fc59-7709-310f-9249-1e92d0464b00", - "display": "PCP145391" - }, - "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:91fb533f-942b-44af-8c67-5ea322a27ef6" - } - } - ], - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "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:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - } - ] - }, - { - "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:a34c786d-48aa-4f06-b6ea-f043b45176ba", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "a34c786d-48aa-4f06-b6ea-f043b45176ba", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "7e580db2-ee89-4bef-a510-12f2ac002519" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "2011-11-24T00:39:38-05:00", - "end": "2012-11-24T00:39:38-05:00" - }, - "created": "2011-11-24T00:39:38-05:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:7e580db2-ee89-4bef-a510-12f2ac002519" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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": "2011-11-24T00:24:38-05:00", - "end": "2011-11-24T00:39:38-05:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "19", - "display": "Off Campus-Outpatient Hospital" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:b5dbf510-069c-4db5-aa4a-6f5cca4f62f5" - } - ] - }, - { - "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-11-24T00:24:38-05:00", - "end": "2011-11-24T00:39:38-05: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:8c31170c-62fc-4eb6-88a9-c92cb1966350", - "resource": { - "resourceType": "Encounter", - "id": "8c31170c-62fc-4eb6-88a9-c92cb1966350", - "status": "finished", - "class": { - "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", - "code": "AMB" - }, - "type": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "185349003", - "display": "Encounter for check up (procedure)" - } - ], - "text": "Encounter for check up (procedure)" - } - ], - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e", - "display": "Dr. Cedrick207 Lind531" - } - } - ], - "period": { - "start": "2012-05-10T01:24:38-04:00", - "end": "2012-05-10T01:39:38-04:00" - }, - "serviceProvider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:229dc440-7417-4bd3-902c-e626972aa508", - "resource": { - "resourceType": "Immunization", - "id": "229dc440-7417-4bd3-902c-e626972aa508", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:8c31170c-62fc-4eb6-88a9-c92cb1966350" - }, - "occurrenceDateTime": "2012-05-10T01:24:38-04:00", - "primarySource": true - }, - "request": { - "method": "POST", - "url": "Immunization" - } - }, - { - "fullUrl": "urn:uuid:d088c2b8-6235-46cc-99fa-595a2099b302", - "resource": { - "resourceType": "Claim", - "id": "d088c2b8-6235-46cc-99fa-595a2099b302", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "2012-05-10T01:24:38-04:00", - "end": "2012-05-10T01:39:38-04:00" - }, - "created": "2012-05-10T01:39:38-04:00", - "provider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - }, - "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:229dc440-7417-4bd3-902c-e626972aa508" - } - } - ], - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "item": [ - { - "sequence": 1, - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "185349003", - "display": "Encounter for check up (procedure)" - } - ], - "text": "Encounter for check up (procedure)" - }, - "encounter": [ - { - "reference": "urn:uuid:8c31170c-62fc-4eb6-88a9-c92cb1966350" - } - ] - }, - { - "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:1c1e10f9-aa1b-4b8f-8cda-fc941def3e69", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "1c1e10f9-aa1b-4b8f-8cda-fc941def3e69", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "d088c2b8-6235-46cc-99fa-595a2099b302" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "2012-05-10T01:39:38-04:00", - "end": "2013-05-10T01:39:38-04:00" - }, - "created": "2012-05-10T01:39:38-04:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:d088c2b8-6235-46cc-99fa-595a2099b302" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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": "185349003", - "display": "Encounter for check up (procedure)" - } - ], - "text": "Encounter for check up (procedure)" - }, - "servicedPeriod": { - "start": "2012-05-10T01:24:38-04:00", - "end": "2012-05-10T01:39:38-04:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "21", - "display": "Inpatient Hospital" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:8c31170c-62fc-4eb6-88a9-c92cb1966350" - } - ] - }, - { - "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-05-10T01:24:38-04:00", - "end": "2012-05-10T01:39:38-04:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "21", - "display": "Inpatient 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:443b45e3-bac2-47f4-b169-c47a1844a91d", - "resource": { - "resourceType": "Encounter", - "id": "443b45e3-bac2-47f4-b169-c47a1844a91d", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e", - "display": "Dr. Cedrick207 Lind531" - } - } - ], - "period": { - "start": "2012-05-06T01:24:38-04:00", - "end": "2012-05-06T01:39:38-04:00" - }, - "reasonCode": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "444814009", - "display": "Viral sinusitis (disorder)" - } - ] - } - ], - "serviceProvider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:df427f8b-43f3-48e6-8c0c-16c7a369cad4", - "resource": { - "resourceType": "Condition", - "id": "df427f8b-43f3-48e6-8c0c-16c7a369cad4", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:443b45e3-bac2-47f4-b169-c47a1844a91d" - }, - "onsetDateTime": "2012-05-06T01:24:38-04:00", - "abatementDateTime": "2012-05-20T01:24:38-04:00", - "recordedDate": "2012-05-06T01:24:38-04:00" - }, - "request": { - "method": "POST", - "url": "Condition" - } - }, - { - "fullUrl": "urn:uuid:b1637edf-bd6f-448a-b545-7f964cb05039", - "resource": { - "resourceType": "Observation", - "id": "b1637edf-bd6f-448a-b545-7f964cb05039", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:443b45e3-bac2-47f4-b169-c47a1844a91d" - }, - "effectiveDateTime": "2012-05-10T01:24:38-04:00", - "issued": "2012-05-10T01:24:38.752-04:00", - "valueQuantity": { - "value": 155.01680645430415, - "unit": "cm", - "system": "http://unitsofmeasure.org", - "code": "cm" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:8972edca-cd45-444c-841f-e57e31bfc436", - "resource": { - "resourceType": "Observation", - "id": "8972edca-cd45-444c-841f-e57e31bfc436", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:443b45e3-bac2-47f4-b169-c47a1844a91d" - }, - "effectiveDateTime": "2012-05-10T01:24:38-04:00", - "issued": "2012-05-10T01:24:38.752-04:00", - "valueQuantity": { - "value": 1.3611606013389705, - "unit": "{score}", - "system": "http://unitsofmeasure.org", - "code": "{score}" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:3b2b3fac-c1f4-4ef4-b924-ddea599ececb", - "resource": { - "resourceType": "Observation", - "id": "3b2b3fac-c1f4-4ef4-b924-ddea599ececb", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:443b45e3-bac2-47f4-b169-c47a1844a91d" - }, - "effectiveDateTime": "2012-05-10T01:24:38-04:00", - "issued": "2012-05-10T01:24:38.752-04:00", - "valueQuantity": { - "value": 65.79684973105927, - "unit": "kg", - "system": "http://unitsofmeasure.org", - "code": "kg" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:24bbf580-0dda-4cae-b31a-7c090af87860", - "resource": { - "resourceType": "Observation", - "id": "24bbf580-0dda-4cae-b31a-7c090af87860", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:443b45e3-bac2-47f4-b169-c47a1844a91d" - }, - "effectiveDateTime": "2012-05-10T01:24:38-04:00", - "issued": "2012-05-10T01:24:38.752-04:00", - "valueQuantity": { - "value": 27.38088803859094, - "unit": "kg/m2", - "system": "http://unitsofmeasure.org", - "code": "kg/m2" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:53ed9ffd-5c35-4bfc-8076-e2fef2e3c47d", - "resource": { - "resourceType": "Observation", - "id": "53ed9ffd-5c35-4bfc-8076-e2fef2e3c47d", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:443b45e3-bac2-47f4-b169-c47a1844a91d" - }, - "effectiveDateTime": "2012-05-10T01:24:38-04:00", - "issued": "2012-05-10T01:24:38.752-04:00", - "component": [ - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "8462-4", - "display": "Diastolic Blood Pressure" - } - ], - "text": "Diastolic Blood Pressure" - }, - "valueQuantity": { - "value": 73.43063713020616, - "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": 124.97982289550339, - "unit": "mm[Hg]", - "system": "http://unitsofmeasure.org", - "code": "mm[Hg]" - } - } - ] - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:c797848a-46b5-43cd-89ca-b4551f1ac8e1", - "resource": { - "resourceType": "Observation", - "id": "c797848a-46b5-43cd-89ca-b4551f1ac8e1", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:443b45e3-bac2-47f4-b169-c47a1844a91d" - }, - "effectiveDateTime": "2012-05-10T01:24:38-04:00", - "issued": "2012-05-10T01:24:38.752-04:00", - "valueCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "8517006", - "display": "Former smoker" - } - ], - "text": "Former smoker" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:6031e4eb-32ee-4cd4-86db-05ef0b14992f", - "resource": { - "resourceType": "Claim", - "id": "6031e4eb-32ee-4cd4-86db-05ef0b14992f", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "2012-05-06T01:24:38-04:00", - "end": "2012-05-06T01:39:38-04:00" - }, - "created": "2012-05-06T01:39:38-04:00", - "provider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - }, - "priority": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/processpriority", - "code": "normal" - } - ] - }, - "diagnosis": [ - { - "sequence": 1, - "diagnosisReference": { - "reference": "urn:uuid:df427f8b-43f3-48e6-8c0c-16c7a369cad4" - } - } - ], - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "item": [ - { - "sequence": 1, - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "185345009", - "display": "Encounter for symptom" - } - ], - "text": "Encounter for symptom" - }, - "encounter": [ - { - "reference": "urn:uuid:443b45e3-bac2-47f4-b169-c47a1844a91d" - } - ] - }, - { - "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:059b2ec8-794c-4d39-ad71-5faf4b2f7d2f", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "059b2ec8-794c-4d39-ad71-5faf4b2f7d2f", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "6031e4eb-32ee-4cd4-86db-05ef0b14992f" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "2012-05-06T01:39:38-04:00", - "end": "2013-05-06T01:39:38-04:00" - }, - "created": "2012-05-06T01:39:38-04:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:6031e4eb-32ee-4cd4-86db-05ef0b14992f" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "diagnosis": [ - { - "sequence": 1, - "diagnosisReference": { - "reference": "urn:uuid:df427f8b-43f3-48e6-8c0c-16c7a369cad4" - }, - "type": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", - "code": "principal" - } - ] - } - ] - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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": "2012-05-06T01:24:38-04:00", - "end": "2012-05-06T01:39:38-04:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "21", - "display": "Inpatient Hospital" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:443b45e3-bac2-47f4-b169-c47a1844a91d" - } - ] - }, - { - "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": "2012-05-06T01:24:38-04:00", - "end": "2012-05-06T01:39:38-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:bbaa1361-3f33-4afe-83bb-5ed614b14dc5", - "resource": { - "resourceType": "Encounter", - "id": "bbaa1361-3f33-4afe-83bb-5ed614b14dc5", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710", - "display": "Dr. Shantae970 Cummerata161" - } - } - ], - "period": { - "start": "2013-11-28T00:24:38-05:00", - "end": "2013-11-28T00:39:38-05:00" - }, - "serviceProvider": { - "reference": "urn:uuid:54f6fc59-7709-310f-9249-1e92d0464b00", - "display": "PCP145391" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:ecd55c0b-fa06-472c-b30b-42d758f6b1bf", - "resource": { - "resourceType": "Observation", - "id": "ecd55c0b-fa06-472c-b30b-42d758f6b1bf", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:bbaa1361-3f33-4afe-83bb-5ed614b14dc5" - }, - "effectiveDateTime": "2013-11-28T00:24:38-05:00", - "issued": "2013-11-28T00:24:38.752-05:00", - "valueQuantity": { - "value": 155.01680645430415, - "unit": "cm", - "system": "http://unitsofmeasure.org", - "code": "cm" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:89656b69-eb88-4520-b251-5e7f7ac1d73b", - "resource": { - "resourceType": "Observation", - "id": "89656b69-eb88-4520-b251-5e7f7ac1d73b", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:bbaa1361-3f33-4afe-83bb-5ed614b14dc5" - }, - "effectiveDateTime": "2013-11-28T00:24:38-05:00", - "issued": "2013-11-28T00:24:38.752-05:00", - "valueQuantity": { - "value": 3.542390063459913, - "unit": "{score}", - "system": "http://unitsofmeasure.org", - "code": "{score}" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:cde549fa-9827-470f-b942-d619d6c50b0f", - "resource": { - "resourceType": "Observation", - "id": "cde549fa-9827-470f-b942-d619d6c50b0f", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:bbaa1361-3f33-4afe-83bb-5ed614b14dc5" - }, - "effectiveDateTime": "2013-11-28T00:24:38-05:00", - "issued": "2013-11-28T00:24:38.752-05:00", - "valueQuantity": { - "value": 65.79684973105927, - "unit": "kg", - "system": "http://unitsofmeasure.org", - "code": "kg" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:e439cc95-b372-40ea-95af-2e7b3734fbc3", - "resource": { - "resourceType": "Observation", - "id": "e439cc95-b372-40ea-95af-2e7b3734fbc3", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:bbaa1361-3f33-4afe-83bb-5ed614b14dc5" - }, - "effectiveDateTime": "2013-11-28T00:24:38-05:00", - "issued": "2013-11-28T00:24:38.752-05:00", - "valueQuantity": { - "value": 27.38088803859094, - "unit": "kg/m2", - "system": "http://unitsofmeasure.org", - "code": "kg/m2" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:5a56ee21-6689-453e-b435-fcaaef055385", - "resource": { - "resourceType": "Observation", - "id": "5a56ee21-6689-453e-b435-fcaaef055385", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:bbaa1361-3f33-4afe-83bb-5ed614b14dc5" - }, - "effectiveDateTime": "2013-11-28T00:24:38-05:00", - "issued": "2013-11-28T00:24:38.752-05:00", - "component": [ - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "8462-4", - "display": "Diastolic Blood Pressure" - } - ], - "text": "Diastolic Blood Pressure" - }, - "valueQuantity": { - "value": 80.1030955878793, - "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": 119.84972065684128, - "unit": "mm[Hg]", - "system": "http://unitsofmeasure.org", - "code": "mm[Hg]" - } - } - ] - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:c4973e7c-2f78-46e5-9287-745b2b9bb870", - "resource": { - "resourceType": "Observation", - "id": "c4973e7c-2f78-46e5-9287-745b2b9bb870", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:bbaa1361-3f33-4afe-83bb-5ed614b14dc5" - }, - "effectiveDateTime": "2013-11-28T00:24:38-05:00", - "issued": "2013-11-28T00:24:38.752-05:00", - "valueCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "8517006", - "display": "Former smoker" - } - ], - "text": "Former smoker" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:533f0cdf-6c30-4eee-9785-1f9be49027ba", - "resource": { - "resourceType": "Immunization", - "id": "533f0cdf-6c30-4eee-9785-1f9be49027ba", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:bbaa1361-3f33-4afe-83bb-5ed614b14dc5" - }, - "occurrenceDateTime": "2013-11-28T00:24:38-05:00", - "primarySource": true - }, - "request": { - "method": "POST", - "url": "Immunization" - } - }, - { - "fullUrl": "urn:uuid:3693fb32-090d-4897-8e2e-a1f66df31a89", - "resource": { - "resourceType": "Claim", - "id": "3693fb32-090d-4897-8e2e-a1f66df31a89", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "2013-11-28T00:24:38-05:00", - "end": "2013-11-28T00:39:38-05:00" - }, - "created": "2013-11-28T00:39:38-05:00", - "provider": { - "reference": "urn:uuid:54f6fc59-7709-310f-9249-1e92d0464b00", - "display": "PCP145391" - }, - "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:533f0cdf-6c30-4eee-9785-1f9be49027ba" - } - } - ], - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "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:bbaa1361-3f33-4afe-83bb-5ed614b14dc5" - } - ] - }, - { - "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:182d280b-56bb-49b3-9d2f-0d7475811af3", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "182d280b-56bb-49b3-9d2f-0d7475811af3", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "3693fb32-090d-4897-8e2e-a1f66df31a89" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "2013-11-28T00:39:38-05:00", - "end": "2014-11-28T00:39:38-05:00" - }, - "created": "2013-11-28T00:39:38-05:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:3693fb32-090d-4897-8e2e-a1f66df31a89" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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": "2013-11-28T00:24:38-05:00", - "end": "2013-11-28T00:39:38-05:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "19", - "display": "Off Campus-Outpatient Hospital" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:bbaa1361-3f33-4afe-83bb-5ed614b14dc5" - } - ] - }, - { - "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-11-28T00:24:38-05:00", - "end": "2013-11-28T00:39:38-05: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:1659ef44-7978-42b5-8414-4fc908f847e4", - "resource": { - "resourceType": "Encounter", - "id": "1659ef44-7978-42b5-8414-4fc908f847e4", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710", - "display": "Dr. Shantae970 Cummerata161" - } - } - ], - "period": { - "start": "2015-11-05T00:24:38-05:00", - "end": "2015-11-05T00:39:38-05:00" - }, - "serviceProvider": { - "reference": "urn:uuid:54f6fc59-7709-310f-9249-1e92d0464b00", - "display": "PCP145391" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:b55d9784-444e-44a7-9e79-6bc11caad74e", - "resource": { - "resourceType": "Observation", - "id": "b55d9784-444e-44a7-9e79-6bc11caad74e", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:1659ef44-7978-42b5-8414-4fc908f847e4" - }, - "effectiveDateTime": "2015-11-05T00:24:38-05:00", - "issued": "2015-11-05T00:24:38.752-05:00", - "valueQuantity": { - "value": 155.01680645430415, - "unit": "cm", - "system": "http://unitsofmeasure.org", - "code": "cm" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:ca5491d9-d70b-4081-8dd2-e1ddc9990d8b", - "resource": { - "resourceType": "Observation", - "id": "ca5491d9-d70b-4081-8dd2-e1ddc9990d8b", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:1659ef44-7978-42b5-8414-4fc908f847e4" - }, - "effectiveDateTime": "2015-11-05T00:24:38-05:00", - "issued": "2015-11-05T00:24:38.752-05:00", - "valueQuantity": { - "value": 2.072250263933972, - "unit": "{score}", - "system": "http://unitsofmeasure.org", - "code": "{score}" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:2ca83951-ecfb-4219-bd43-ae90b456e40e", - "resource": { - "resourceType": "Observation", - "id": "2ca83951-ecfb-4219-bd43-ae90b456e40e", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:1659ef44-7978-42b5-8414-4fc908f847e4" - }, - "effectiveDateTime": "2015-11-05T00:24:38-05:00", - "issued": "2015-11-05T00:24:38.752-05:00", - "valueQuantity": { - "value": 65.79684973105927, - "unit": "kg", - "system": "http://unitsofmeasure.org", - "code": "kg" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:7219d461-04a0-4992-ac65-2b19444f906f", - "resource": { - "resourceType": "Observation", - "id": "7219d461-04a0-4992-ac65-2b19444f906f", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:1659ef44-7978-42b5-8414-4fc908f847e4" - }, - "effectiveDateTime": "2015-11-05T00:24:38-05:00", - "issued": "2015-11-05T00:24:38.752-05:00", - "valueQuantity": { - "value": 27.38088803859094, - "unit": "kg/m2", - "system": "http://unitsofmeasure.org", - "code": "kg/m2" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:ffce4c2f-a5eb-4455-9e1d-3ce884744fd4", - "resource": { - "resourceType": "Observation", - "id": "ffce4c2f-a5eb-4455-9e1d-3ce884744fd4", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:1659ef44-7978-42b5-8414-4fc908f847e4" - }, - "effectiveDateTime": "2015-11-05T00:24:38-05:00", - "issued": "2015-11-05T00:24:38.752-05:00", - "component": [ - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "8462-4", - "display": "Diastolic Blood Pressure" - } - ], - "text": "Diastolic Blood Pressure" - }, - "valueQuantity": { - "value": 72.84370330219258, - "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": 116.58483903330045, - "unit": "mm[Hg]", - "system": "http://unitsofmeasure.org", - "code": "mm[Hg]" - } - } - ] - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:800f8564-59a5-49c3-b2fe-f84e231b0e31", - "resource": { - "resourceType": "Observation", - "id": "800f8564-59a5-49c3-b2fe-f84e231b0e31", - "status": "final", - "category": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/observation-category", - "code": "laboratory", - "display": "laboratory" - } - ] - } - ], - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "2093-3", - "display": "Total Cholesterol" - } - ], - "text": "Total Cholesterol" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:1659ef44-7978-42b5-8414-4fc908f847e4" - }, - "effectiveDateTime": "2015-11-05T00:24:38-05:00", - "issued": "2015-11-05T00:24:38.752-05:00", - "valueQuantity": { - "value": 194.70322634025746, - "unit": "mg/dL", - "system": "http://unitsofmeasure.org", - "code": "mg/dL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:0dae0e54-ddd1-49ba-900b-6c0eaef0c23e", - "resource": { - "resourceType": "Observation", - "id": "0dae0e54-ddd1-49ba-900b-6c0eaef0c23e", - "status": "final", - "category": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/observation-category", - "code": "laboratory", - "display": "laboratory" - } - ] - } - ], - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "2571-8", - "display": "Triglycerides" - } - ], - "text": "Triglycerides" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:1659ef44-7978-42b5-8414-4fc908f847e4" - }, - "effectiveDateTime": "2015-11-05T00:24:38-05:00", - "issued": "2015-11-05T00:24:38.752-05:00", - "valueQuantity": { - "value": 116.72101146761173, - "unit": "mg/dL", - "system": "http://unitsofmeasure.org", - "code": "mg/dL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:e2a74651-b2a1-4124-bd2c-047cae6b9c72", - "resource": { - "resourceType": "Observation", - "id": "e2a74651-b2a1-4124-bd2c-047cae6b9c72", - "status": "final", - "category": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/observation-category", - "code": "laboratory", - "display": "laboratory" - } - ] - } - ], - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "18262-6", - "display": "Low Density Lipoprotein Cholesterol" - } - ], - "text": "Low Density Lipoprotein Cholesterol" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:1659ef44-7978-42b5-8414-4fc908f847e4" - }, - "effectiveDateTime": "2015-11-05T00:24:38-05:00", - "issued": "2015-11-05T00:24:38.752-05:00", - "valueQuantity": { - "value": 107.52292666005265, - "unit": "mg/dL", - "system": "http://unitsofmeasure.org", - "code": "mg/dL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:d0451c95-db66-464f-beb2-bf1a0b95323f", - "resource": { - "resourceType": "Observation", - "id": "d0451c95-db66-464f-beb2-bf1a0b95323f", - "status": "final", - "category": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/observation-category", - "code": "laboratory", - "display": "laboratory" - } - ] - } - ], - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "2085-9", - "display": "High Density Lipoprotein Cholesterol" - } - ], - "text": "High Density Lipoprotein Cholesterol" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:1659ef44-7978-42b5-8414-4fc908f847e4" - }, - "effectiveDateTime": "2015-11-05T00:24:38-05:00", - "issued": "2015-11-05T00:24:38.752-05:00", - "valueQuantity": { - "value": 63.83609738668246, - "unit": "mg/dL", - "system": "http://unitsofmeasure.org", - "code": "mg/dL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:18f296a3-56db-417d-8cc3-b3ef9edb0adc", - "resource": { - "resourceType": "Observation", - "id": "18f296a3-56db-417d-8cc3-b3ef9edb0adc", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:1659ef44-7978-42b5-8414-4fc908f847e4" - }, - "effectiveDateTime": "2015-11-05T00:24:38-05:00", - "issued": "2015-11-05T00:24:38.752-05:00", - "valueCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "8517006", - "display": "Former smoker" - } - ], - "text": "Former smoker" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:e8237a76-c44f-4dfd-ac58-5d92d7dc5d3a", - "resource": { - "resourceType": "Immunization", - "id": "e8237a76-c44f-4dfd-ac58-5d92d7dc5d3a", - "status": "completed", - "vaccineCode": { - "coding": [ - { - "system": "http://hl7.org/fhir/sid/cvx", - "code": "121", - "display": "zoster" - } - ], - "text": "zoster" - }, - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:1659ef44-7978-42b5-8414-4fc908f847e4" - }, - "occurrenceDateTime": "2015-11-05T00:24:38-05:00", - "primarySource": true - }, - "request": { - "method": "POST", - "url": "Immunization" - } - }, - { - "fullUrl": "urn:uuid:a33e2a40-fa20-4edc-bb07-a47ce42d89cf", - "resource": { - "resourceType": "Immunization", - "id": "a33e2a40-fa20-4edc-bb07-a47ce42d89cf", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:1659ef44-7978-42b5-8414-4fc908f847e4" - }, - "occurrenceDateTime": "2015-11-05T00:24:38-05:00", - "primarySource": true - }, - "request": { - "method": "POST", - "url": "Immunization" - } - }, - { - "fullUrl": "urn:uuid:39ca57f8-aa5c-4df4-8732-025f6808ad94", - "resource": { - "resourceType": "DiagnosticReport", - "id": "39ca57f8-aa5c-4df4-8732-025f6808ad94", - "status": "final", - "category": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0074", - "code": "LAB", - "display": "Laboratory" - } - ] - } - ], - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "57698-3", - "display": "Lipid Panel" - } - ], - "text": "Lipid Panel" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:1659ef44-7978-42b5-8414-4fc908f847e4" - }, - "effectiveDateTime": "2015-11-05T00:24:38-05:00", - "issued": "2015-11-05T00:24:38.752-05:00", - "result": [ - { - "reference": "urn:uuid:800f8564-59a5-49c3-b2fe-f84e231b0e31", - "display": "Total Cholesterol" - }, - { - "reference": "urn:uuid:0dae0e54-ddd1-49ba-900b-6c0eaef0c23e", - "display": "Triglycerides" - }, - { - "reference": "urn:uuid:e2a74651-b2a1-4124-bd2c-047cae6b9c72", - "display": "Low Density Lipoprotein Cholesterol" - }, - { - "reference": "urn:uuid:d0451c95-db66-464f-beb2-bf1a0b95323f", - "display": "High Density Lipoprotein Cholesterol" - } - ] - }, - "request": { - "method": "POST", - "url": "DiagnosticReport" - } - }, - { - "fullUrl": "urn:uuid:22a2e60b-39ad-4fad-8d5a-a158b7d162dc", - "resource": { - "resourceType": "Claim", - "id": "22a2e60b-39ad-4fad-8d5a-a158b7d162dc", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "2015-11-05T00:24:38-05:00", - "end": "2015-11-05T00:39:38-05:00" - }, - "created": "2015-11-05T00:39:38-05:00", - "provider": { - "reference": "urn:uuid:54f6fc59-7709-310f-9249-1e92d0464b00", - "display": "PCP145391" - }, - "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:e8237a76-c44f-4dfd-ac58-5d92d7dc5d3a" - } - }, - { - "sequence": 2, - "category": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claiminformationcategory", - "code": "info" - } - ] - }, - "valueReference": { - "reference": "urn:uuid:a33e2a40-fa20-4edc-bb07-a47ce42d89cf" - } - } - ], - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "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:1659ef44-7978-42b5-8414-4fc908f847e4" - } - ] - }, - { - "sequence": 2, - "informationSequence": [ - 1 - ], - "productOrService": { - "coding": [ - { - "system": "http://hl7.org/fhir/sid/cvx", - "code": "121", - "display": "zoster" - } - ], - "text": "zoster" - }, - "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" - } - } - ], - "total": { - "value": 129.16, - "currency": "USD" - } - }, - "request": { - "method": "POST", - "url": "Claim" - } - }, - { - "fullUrl": "urn:uuid:e88abc17-9e44-41fe-8080-4167c143060c", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "e88abc17-9e44-41fe-8080-4167c143060c", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "22a2e60b-39ad-4fad-8d5a-a158b7d162dc" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "2015-11-05T00:39:38-05:00", - "end": "2016-11-05T00:39:38-04:00" - }, - "created": "2015-11-05T00:39:38-05:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:22a2e60b-39ad-4fad-8d5a-a158b7d162dc" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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": "2015-11-05T00:24:38-05:00", - "end": "2015-11-05T00:39:38-05:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "19", - "display": "Off Campus-Outpatient Hospital" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:1659ef44-7978-42b5-8414-4fc908f847e4" - } - ] - }, - { - "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": "121", - "display": "zoster" - } - ], - "text": "zoster" - }, - "servicedPeriod": { - "start": "2015-11-05T00:24:38-05:00", - "end": "2015-11-05T00:39:38-05: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": "2015-11-05T00:24:38-05:00", - "end": "2015-11-05T00:39:38-05: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:ff36b67d-69de-4f37-8691-e8ceb607a5ec", - "resource": { - "resourceType": "Encounter", - "id": "ff36b67d-69de-4f37-8691-e8ceb607a5ec", - "status": "finished", - "class": { - "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", - "code": "EMER" - }, - "type": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "183478001", - "display": "Emergency hospital admission for asthma" - } - ], - "text": "Emergency hospital admission for asthma" - } - ], - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e", - "display": "Dr. Cedrick207 Lind531" - } - } - ], - "period": { - "start": "2016-02-12T00:24:38-05:00", - "end": "2016-02-12T01:24:38-05:00" - }, - "reasonCode": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "195967001", - "display": "Asthma" - } - ] - } - ], - "serviceProvider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:713d6566-ffc3-4c2e-8aef-73456cb0da76", - "resource": { - "resourceType": "Claim", - "id": "713d6566-ffc3-4c2e-8aef-73456cb0da76", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "2016-02-12T00:24:38-05:00", - "end": "2016-02-12T01:24:38-05:00" - }, - "created": "2016-02-12T01:24:38-05:00", - "provider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - }, - "priority": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/processpriority", - "code": "normal" - } - ] - }, - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "item": [ - { - "sequence": 1, - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "183478001", - "display": "Emergency hospital admission for asthma" - } - ], - "text": "Emergency hospital admission for asthma" - }, - "encounter": [ - { - "reference": "urn:uuid:ff36b67d-69de-4f37-8691-e8ceb607a5ec" - } - ] - } - ], - "total": { - "value": 129.16, - "currency": "USD" - } - }, - "request": { - "method": "POST", - "url": "Claim" - } - }, - { - "fullUrl": "urn:uuid:81e5aae4-1689-4698-938d-382ec3204a98", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "81e5aae4-1689-4698-938d-382ec3204a98", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "713d6566-ffc3-4c2e-8aef-73456cb0da76" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "2016-02-12T01:24:38-05:00", - "end": "2017-02-12T01:24:38-05:00" - }, - "created": "2016-02-12T01:24:38-05:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:713d6566-ffc3-4c2e-8aef-73456cb0da76" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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": "183478001", - "display": "Emergency hospital admission for asthma" - } - ], - "text": "Emergency hospital admission for asthma" - }, - "servicedPeriod": { - "start": "2016-02-12T00:24:38-05:00", - "end": "2016-02-12T01:24:38-05:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "20", - "display": "Urgent Care Facility" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:ff36b67d-69de-4f37-8691-e8ceb607a5ec" - } - ] - } - ], - "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:bc6f1a2e-44c9-488a-8034-68bac412bbe9", - "resource": { - "resourceType": "Encounter", - "id": "bc6f1a2e-44c9-488a-8034-68bac412bbe9", - "status": "finished", - "class": { - "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", - "code": "AMB" - }, - "type": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "394701000", - "display": "Asthma follow-up" - } - ], - "text": "Asthma follow-up" - } - ], - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e", - "display": "Dr. Cedrick207 Lind531" - } - } - ], - "period": { - "start": "2016-02-14T00:24:38-05:00", - "end": "2016-02-14T00:39:38-05:00" - }, - "reasonCode": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "195967001", - "display": "Asthma" - } - ] - } - ], - "serviceProvider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:d51f5212-baba-42f3-b965-a6d6dc8cee6f", - "resource": { - "resourceType": "Claim", - "id": "d51f5212-baba-42f3-b965-a6d6dc8cee6f", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "2016-02-14T00:24:38-05:00", - "end": "2016-02-14T00:39:38-05:00" - }, - "created": "2016-02-14T00:39:38-05:00", - "provider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - }, - "priority": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/processpriority", - "code": "normal" - } - ] - }, - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "item": [ - { - "sequence": 1, - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "394701000", - "display": "Asthma follow-up" - } - ], - "text": "Asthma follow-up" - }, - "encounter": [ - { - "reference": "urn:uuid:bc6f1a2e-44c9-488a-8034-68bac412bbe9" - } - ] - } - ], - "total": { - "value": 129.16, - "currency": "USD" - } - }, - "request": { - "method": "POST", - "url": "Claim" - } - }, - { - "fullUrl": "urn:uuid:a926aad6-9213-4fb4-aba5-7e2d8a22af1c", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "a926aad6-9213-4fb4-aba5-7e2d8a22af1c", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "d51f5212-baba-42f3-b965-a6d6dc8cee6f" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "2016-02-14T00:39:38-05:00", - "end": "2017-02-14T00:39:38-05:00" - }, - "created": "2016-02-14T00:39:38-05:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:d51f5212-baba-42f3-b965-a6d6dc8cee6f" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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": "394701000", - "display": "Asthma follow-up" - } - ], - "text": "Asthma follow-up" - }, - "servicedPeriod": { - "start": "2016-02-14T00:24:38-05:00", - "end": "2016-02-14T00:39:38-05:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "21", - "display": "Inpatient Hospital" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:bc6f1a2e-44c9-488a-8034-68bac412bbe9" - } - ] - } - ], - "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:094603d6-cc36-4ba5-8c27-3604aff7a089", - "resource": { - "resourceType": "Encounter", - "id": "094603d6-cc36-4ba5-8c27-3604aff7a089", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e", - "display": "Dr. Cedrick207 Lind531" - } - } - ], - "period": { - "start": "2016-03-29T01:24:38-04:00", - "end": "2016-03-29T01:39:38-04:00" - }, - "reasonCode": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "195662009", - "display": "Acute viral pharyngitis (disorder)" - } - ] - } - ], - "serviceProvider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:f3a2e527-f76b-497f-bb87-a33d441936db", - "resource": { - "resourceType": "Condition", - "id": "f3a2e527-f76b-497f-bb87-a33d441936db", - "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": "195662009", - "display": "Acute viral pharyngitis (disorder)" - } - ], - "text": "Acute viral pharyngitis (disorder)" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:094603d6-cc36-4ba5-8c27-3604aff7a089" - }, - "onsetDateTime": "2016-03-29T01:24:38-04:00", - "abatementDateTime": "2016-04-10T01:24:38-04:00", - "recordedDate": "2016-03-29T01:24:38-04:00" - }, - "request": { - "method": "POST", - "url": "Condition" - } - }, - { - "fullUrl": "urn:uuid:97363fc2-301e-48c1-8745-b1a33ea7aca6", - "resource": { - "resourceType": "Observation", - "id": "97363fc2-301e-48c1-8745-b1a33ea7aca6", - "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": "8331-1", - "display": "Oral temperature" - } - ], - "text": "Oral temperature" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:094603d6-cc36-4ba5-8c27-3604aff7a089" - }, - "effectiveDateTime": "2016-03-29T01:24:38-04:00", - "issued": "2016-03-29T01:24:38.752-04:00", - "valueQuantity": { - "value": 37.25583508874942, - "unit": "Cel", - "system": "http://unitsofmeasure.org", - "code": "Cel" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:245e62dc-91e5-4247-93cc-4c00092134ae", - "resource": { - "resourceType": "Claim", - "id": "245e62dc-91e5-4247-93cc-4c00092134ae", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "2016-03-29T01:24:38-04:00", - "end": "2016-03-29T01:39:38-04:00" - }, - "created": "2016-03-29T01:39:38-04:00", - "provider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - }, - "priority": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/processpriority", - "code": "normal" - } - ] - }, - "diagnosis": [ - { - "sequence": 1, - "diagnosisReference": { - "reference": "urn:uuid:f3a2e527-f76b-497f-bb87-a33d441936db" - } - } - ], - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "item": [ - { - "sequence": 1, - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "185345009", - "display": "Encounter for symptom" - } - ], - "text": "Encounter for symptom" - }, - "encounter": [ - { - "reference": "urn:uuid:094603d6-cc36-4ba5-8c27-3604aff7a089" - } - ] - }, - { - "sequence": 2, - "diagnosisSequence": [ - 1 - ], - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "195662009", - "display": "Acute viral pharyngitis (disorder)" - } - ], - "text": "Acute viral pharyngitis (disorder)" - } - } - ], - "total": { - "value": 129.16, - "currency": "USD" - } - }, - "request": { - "method": "POST", - "url": "Claim" - } - }, - { - "fullUrl": "urn:uuid:bf97f5fd-8886-4587-bfa1-bda0ffd7072e", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "bf97f5fd-8886-4587-bfa1-bda0ffd7072e", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "245e62dc-91e5-4247-93cc-4c00092134ae" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "2016-03-29T01:39:38-04:00", - "end": "2017-03-29T01:39:38-04:00" - }, - "created": "2016-03-29T01:39:38-04:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:245e62dc-91e5-4247-93cc-4c00092134ae" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "diagnosis": [ - { - "sequence": 1, - "diagnosisReference": { - "reference": "urn:uuid:f3a2e527-f76b-497f-bb87-a33d441936db" - }, - "type": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", - "code": "principal" - } - ] - } - ] - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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-03-29T01:24:38-04:00", - "end": "2016-03-29T01:39:38-04:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "21", - "display": "Inpatient Hospital" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:094603d6-cc36-4ba5-8c27-3604aff7a089" - } - ] - }, - { - "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": "195662009", - "display": "Acute viral pharyngitis (disorder)" - } - ], - "text": "Acute viral pharyngitis (disorder)" - }, - "servicedPeriod": { - "start": "2016-03-29T01:24:38-04:00", - "end": "2016-03-29T01:39:38-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:e9e51b72-0f7c-4f19-96de-943b0bcf0ce0", - "resource": { - "resourceType": "Encounter", - "id": "e9e51b72-0f7c-4f19-96de-943b0bcf0ce0", - "status": "finished", - "class": { - "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", - "code": "AMB" - }, - "type": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "702927004", - "display": "Urgent care clinic (procedure)" - } - ], - "text": "Urgent care clinic (procedure)" - } - ], - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-000000016c9c", - "display": "Dr. Jacquelyn628 Pouros728" - } - } - ], - "period": { - "start": "2016-04-07T01:24:38-04:00", - "end": "2016-04-07T01:39:38-04:00" - }, - "serviceProvider": { - "reference": "urn:uuid:f1313c7d-3148-335b-adc3-337f15567b82", - "display": "WINCHESTER HOSPITAL FAMILY MEDICAL CENTER" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:d9d54428-d2bd-4e6e-8489-6079bc8567f9", - "resource": { - "resourceType": "Immunization", - "id": "d9d54428-d2bd-4e6e-8489-6079bc8567f9", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e9e51b72-0f7c-4f19-96de-943b0bcf0ce0" - }, - "occurrenceDateTime": "2016-04-07T01:24:38-04:00", - "primarySource": true - }, - "request": { - "method": "POST", - "url": "Immunization" - } - }, - { - "fullUrl": "urn:uuid:37231dc2-e734-4236-bd6b-40af79bd012d", - "resource": { - "resourceType": "Claim", - "id": "37231dc2-e734-4236-bd6b-40af79bd012d", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "2016-04-07T01:24:38-04:00", - "end": "2016-04-07T01:39:38-04:00" - }, - "created": "2016-04-07T01:39:38-04:00", - "provider": { - "reference": "urn:uuid:f1313c7d-3148-335b-adc3-337f15567b82", - "display": "WINCHESTER HOSPITAL FAMILY MEDICAL CENTER" - }, - "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:d9d54428-d2bd-4e6e-8489-6079bc8567f9" - } - } - ], - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "item": [ - { - "sequence": 1, - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "702927004", - "display": "Urgent care clinic (procedure)" - } - ], - "text": "Urgent care clinic (procedure)" - }, - "encounter": [ - { - "reference": "urn:uuid:e9e51b72-0f7c-4f19-96de-943b0bcf0ce0" - } - ] - }, - { - "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:667510c2-4aaf-408b-a8c5-bb1f6febd5a7", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "667510c2-4aaf-408b-a8c5-bb1f6febd5a7", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-000000016c9c" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-000000016c9c" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "37231dc2-e734-4236-bd6b-40af79bd012d" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "2016-04-07T01:39:38-04:00", - "end": "2017-04-07T01:39:38-04:00" - }, - "created": "2016-04-07T01:39:38-04:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-000000016c9c" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:37231dc2-e734-4236-bd6b-40af79bd012d" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-000000016c9c" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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": "702927004", - "display": "Urgent care clinic (procedure)" - } - ], - "text": "Urgent care clinic (procedure)" - }, - "servicedPeriod": { - "start": "2016-04-07T01:24:38-04:00", - "end": "2016-04-07T01:39:38-04:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "20", - "display": "Urgent Care Facility" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:e9e51b72-0f7c-4f19-96de-943b0bcf0ce0" - } - ] - }, - { - "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-04-07T01:24:38-04:00", - "end": "2016-04-07T01:39:38-04:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "20", - "display": "Urgent Care Facility" - } - ] - }, - "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:8e8eed13-baa1-4060-9996-1970a3f26f43", - "resource": { - "resourceType": "Encounter", - "id": "8e8eed13-baa1-4060-9996-1970a3f26f43", - "status": "finished", - "class": { - "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", - "code": "AMB" - }, - "type": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "185349003", - "display": "Encounter for check up (procedure)" - } - ], - "text": "Encounter for check up (procedure)" - } - ], - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e", - "display": "Dr. Cedrick207 Lind531" - } - } - ], - "period": { - "start": "2016-04-14T01:24:38-04:00", - "end": "2016-04-14T01:39:38-04:00" - }, - "serviceProvider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:8a950bf2-f0d6-4a63-a55e-23299ed6add6", - "resource": { - "resourceType": "Observation", - "id": "8a950bf2-f0d6-4a63-a55e-23299ed6add6", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:8e8eed13-baa1-4060-9996-1970a3f26f43" - }, - "effectiveDateTime": "2016-04-14T01:24:38-04:00", - "issued": "2016-04-14T01:24:38.752-04:00", - "valueQuantity": { - "value": 155.01680645430415, - "unit": "cm", - "system": "http://unitsofmeasure.org", - "code": "cm" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:24fad327-95b7-40b7-b710-54d593746870", - "resource": { - "resourceType": "Observation", - "id": "24fad327-95b7-40b7-b710-54d593746870", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:8e8eed13-baa1-4060-9996-1970a3f26f43" - }, - "effectiveDateTime": "2016-04-14T01:24:38-04:00", - "issued": "2016-04-14T01:24:38.752-04:00", - "valueQuantity": { - "value": 3.7099253661720883, - "unit": "{score}", - "system": "http://unitsofmeasure.org", - "code": "{score}" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:6d8b787f-3b14-4d7b-b39c-cb0d7bb5d6bf", - "resource": { - "resourceType": "Observation", - "id": "6d8b787f-3b14-4d7b-b39c-cb0d7bb5d6bf", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:8e8eed13-baa1-4060-9996-1970a3f26f43" - }, - "effectiveDateTime": "2016-04-14T01:24:38-04:00", - "issued": "2016-04-14T01:24:38.752-04:00", - "valueQuantity": { - "value": 65.79684973105927, - "unit": "kg", - "system": "http://unitsofmeasure.org", - "code": "kg" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:b8c136a2-4029-4ccc-a501-c80921d31493", - "resource": { - "resourceType": "Observation", - "id": "b8c136a2-4029-4ccc-a501-c80921d31493", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:8e8eed13-baa1-4060-9996-1970a3f26f43" - }, - "effectiveDateTime": "2016-04-14T01:24:38-04:00", - "issued": "2016-04-14T01:24:38.752-04:00", - "valueQuantity": { - "value": 27.38088803859094, - "unit": "kg/m2", - "system": "http://unitsofmeasure.org", - "code": "kg/m2" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:a71ecd18-3f86-4ed3-b692-6ee552b2086d", - "resource": { - "resourceType": "Observation", - "id": "a71ecd18-3f86-4ed3-b692-6ee552b2086d", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:8e8eed13-baa1-4060-9996-1970a3f26f43" - }, - "effectiveDateTime": "2016-04-14T01:24:38-04:00", - "issued": "2016-04-14T01:24:38.752-04:00", - "component": [ - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "8462-4", - "display": "Diastolic Blood Pressure" - } - ], - "text": "Diastolic Blood Pressure" - }, - "valueQuantity": { - "value": 82.22722074638124, - "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": 104.96520788119946, - "unit": "mm[Hg]", - "system": "http://unitsofmeasure.org", - "code": "mm[Hg]" - } - } - ] - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:b10e8169-b19b-4fb0-92e4-cb8f546dcf1f", - "resource": { - "resourceType": "Observation", - "id": "b10e8169-b19b-4fb0-92e4-cb8f546dcf1f", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:8e8eed13-baa1-4060-9996-1970a3f26f43" - }, - "effectiveDateTime": "2016-04-14T01:24:38-04:00", - "issued": "2016-04-14T01:24:38.752-04:00", - "valueCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "8517006", - "display": "Former smoker" - } - ], - "text": "Former smoker" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:162816af-04f2-488e-b5e4-621e41f527b9", - "resource": { - "resourceType": "Claim", - "id": "162816af-04f2-488e-b5e4-621e41f527b9", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "2016-04-14T01:24:38-04:00", - "end": "2016-04-14T01:39:38-04:00" - }, - "created": "2016-04-14T01:39:38-04:00", - "provider": { - "reference": "urn:uuid:f1fbcbfb-fcfa-3bd2-b7f4-df20f1b3c3a4", - "display": "LAWRENCE GENERAL HOSPITAL" - }, - "priority": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/processpriority", - "code": "normal" - } - ] - }, - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "item": [ - { - "sequence": 1, - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "185349003", - "display": "Encounter for check up (procedure)" - } - ], - "text": "Encounter for check up (procedure)" - }, - "encounter": [ - { - "reference": "urn:uuid:8e8eed13-baa1-4060-9996-1970a3f26f43" - } - ] - } - ], - "total": { - "value": 129.16, - "currency": "USD" - } - }, - "request": { - "method": "POST", - "url": "Claim" - } - }, - { - "fullUrl": "urn:uuid:6feb342c-38e9-4398-b648-f0dc2c3be985", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "6feb342c-38e9-4398-b648-f0dc2c3be985", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "162816af-04f2-488e-b5e4-621e41f527b9" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "2016-04-14T01:39:38-04:00", - "end": "2017-04-14T01:39:38-04:00" - }, - "created": "2016-04-14T01:39:38-04:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:162816af-04f2-488e-b5e4-621e41f527b9" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000001e" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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": "185349003", - "display": "Encounter for check up (procedure)" - } - ], - "text": "Encounter for check up (procedure)" - }, - "servicedPeriod": { - "start": "2016-04-14T01:24:38-04:00", - "end": "2016-04-14T01:39:38-04:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "21", - "display": "Inpatient Hospital" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:8e8eed13-baa1-4060-9996-1970a3f26f43" - } - ] - } - ], - "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:f91eb13c-7f69-4d94-adf3-0b8739ab981f", - "resource": { - "resourceType": "Encounter", - "id": "f91eb13c-7f69-4d94-adf3-0b8739ab981f", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710", - "display": "Dr. Shantae970 Cummerata161" - } - } - ], - "period": { - "start": "2016-11-10T00:24:38-05:00", - "end": "2016-11-10T00:39:38-05:00" - }, - "serviceProvider": { - "reference": "urn:uuid:54f6fc59-7709-310f-9249-1e92d0464b00", - "display": "PCP145391" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:a0437fb1-36f1-4631-8bc2-1af03c66f7e6", - "resource": { - "resourceType": "Observation", - "id": "a0437fb1-36f1-4631-8bc2-1af03c66f7e6", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:f91eb13c-7f69-4d94-adf3-0b8739ab981f" - }, - "effectiveDateTime": "2016-11-10T00:24:38-05:00", - "issued": "2016-11-10T00:24:38.752-05:00", - "valueQuantity": { - "value": 155.01680645430415, - "unit": "cm", - "system": "http://unitsofmeasure.org", - "code": "cm" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:a5dbb235-0be1-4a89-a7fe-1f47387b35b9", - "resource": { - "resourceType": "Observation", - "id": "a5dbb235-0be1-4a89-a7fe-1f47387b35b9", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:f91eb13c-7f69-4d94-adf3-0b8739ab981f" - }, - "effectiveDateTime": "2016-11-10T00:24:38-05:00", - "issued": "2016-11-10T00:24:38.752-05:00", - "valueQuantity": { - "value": 2.9070699112198977, - "unit": "{score}", - "system": "http://unitsofmeasure.org", - "code": "{score}" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:6b0457cc-3542-4640-9b47-dee818155d4c", - "resource": { - "resourceType": "Observation", - "id": "6b0457cc-3542-4640-9b47-dee818155d4c", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:f91eb13c-7f69-4d94-adf3-0b8739ab981f" - }, - "effectiveDateTime": "2016-11-10T00:24:38-05:00", - "issued": "2016-11-10T00:24:38.752-05:00", - "valueQuantity": { - "value": 65.79684973105927, - "unit": "kg", - "system": "http://unitsofmeasure.org", - "code": "kg" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:6db34aae-f20a-4321-92a3-98312cfb81f9", - "resource": { - "resourceType": "Observation", - "id": "6db34aae-f20a-4321-92a3-98312cfb81f9", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:f91eb13c-7f69-4d94-adf3-0b8739ab981f" - }, - "effectiveDateTime": "2016-11-10T00:24:38-05:00", - "issued": "2016-11-10T00:24:38.752-05:00", - "valueQuantity": { - "value": 27.38088803859094, - "unit": "kg/m2", - "system": "http://unitsofmeasure.org", - "code": "kg/m2" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:b3fff94c-541b-42a5-8990-44293b5b584a", - "resource": { - "resourceType": "Observation", - "id": "b3fff94c-541b-42a5-8990-44293b5b584a", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:f91eb13c-7f69-4d94-adf3-0b8739ab981f" - }, - "effectiveDateTime": "2016-11-10T00:24:38-05:00", - "issued": "2016-11-10T00:24:38.752-05:00", - "component": [ - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "8462-4", - "display": "Diastolic Blood Pressure" - } - ], - "text": "Diastolic Blood Pressure" - }, - "valueQuantity": { - "value": 75.42960548136595, - "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": 122.12981598307161, - "unit": "mm[Hg]", - "system": "http://unitsofmeasure.org", - "code": "mm[Hg]" - } - } - ] - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:c06c907b-76ab-4739-bdee-08898e209f1f", - "resource": { - "resourceType": "Observation", - "id": "c06c907b-76ab-4739-bdee-08898e209f1f", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:f91eb13c-7f69-4d94-adf3-0b8739ab981f" - }, - "effectiveDateTime": "2016-11-10T00:24:38-05:00", - "issued": "2016-11-10T00:24:38.752-05:00", - "valueCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "8517006", - "display": "Former smoker" - } - ], - "text": "Former smoker" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:202468e4-5a03-4a44-ba69-d943886c7b15", - "resource": { - "resourceType": "Immunization", - "id": "202468e4-5a03-4a44-ba69-d943886c7b15", - "status": "completed", - "vaccineCode": { - "coding": [ - { - "system": "http://hl7.org/fhir/sid/cvx", - "code": "121", - "display": "zoster" - } - ], - "text": "zoster" - }, - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:f91eb13c-7f69-4d94-adf3-0b8739ab981f" - }, - "occurrenceDateTime": "2016-11-10T00:24:38-05:00", - "primarySource": true - }, - "request": { - "method": "POST", - "url": "Immunization" - } - }, - { - "fullUrl": "urn:uuid:23780537-c98c-401a-bfce-78f888e756c3", - "resource": { - "resourceType": "Immunization", - "id": "23780537-c98c-401a-bfce-78f888e756c3", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:f91eb13c-7f69-4d94-adf3-0b8739ab981f" - }, - "occurrenceDateTime": "2016-11-10T00:24:38-05:00", - "primarySource": true - }, - "request": { - "method": "POST", - "url": "Immunization" - } - }, - { - "fullUrl": "urn:uuid:a29c0494-706e-4a1e-b607-e190d1229de0", - "resource": { - "resourceType": "Immunization", - "id": "a29c0494-706e-4a1e-b607-e190d1229de0", - "status": "completed", - "vaccineCode": { - "coding": [ - { - "system": "http://hl7.org/fhir/sid/cvx", - "code": "113", - "display": "Td (adult) preservative free" - } - ], - "text": "Td (adult) preservative free" - }, - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:f91eb13c-7f69-4d94-adf3-0b8739ab981f" - }, - "occurrenceDateTime": "2016-11-10T00:24:38-05:00", - "primarySource": true - }, - "request": { - "method": "POST", - "url": "Immunization" - } - }, - { - "fullUrl": "urn:uuid:76cdad55-7e37-4f8b-82fd-fabbe1b84d86", - "resource": { - "resourceType": "Claim", - "id": "76cdad55-7e37-4f8b-82fd-fabbe1b84d86", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "2016-11-10T00:24:38-05:00", - "end": "2016-11-10T00:39:38-05:00" - }, - "created": "2016-11-10T00:39:38-05:00", - "provider": { - "reference": "urn:uuid:54f6fc59-7709-310f-9249-1e92d0464b00", - "display": "PCP145391" - }, - "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:202468e4-5a03-4a44-ba69-d943886c7b15" - } - }, - { - "sequence": 2, - "category": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claiminformationcategory", - "code": "info" - } - ] - }, - "valueReference": { - "reference": "urn:uuid:23780537-c98c-401a-bfce-78f888e756c3" - } - }, - { - "sequence": 3, - "category": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claiminformationcategory", - "code": "info" - } - ] - }, - "valueReference": { - "reference": "urn:uuid:a29c0494-706e-4a1e-b607-e190d1229de0" - } - } - ], - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "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:f91eb13c-7f69-4d94-adf3-0b8739ab981f" - } - ] - }, - { - "sequence": 2, - "informationSequence": [ - 1 - ], - "productOrService": { - "coding": [ - { - "system": "http://hl7.org/fhir/sid/cvx", - "code": "121", - "display": "zoster" - } - ], - "text": "zoster" - }, - "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": "113", - "display": "Td (adult) preservative free" - } - ], - "text": "Td (adult) preservative free" - }, - "net": { - "value": 140.52, - "currency": "USD" - } - } - ], - "total": { - "value": 129.16, - "currency": "USD" - } - }, - "request": { - "method": "POST", - "url": "Claim" - } - }, - { - "fullUrl": "urn:uuid:f3ece524-256a-453d-9fef-9d38421bc553", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "f3ece524-256a-453d-9fef-9d38421bc553", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "76cdad55-7e37-4f8b-82fd-fabbe1b84d86" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "2016-11-10T00:39:38-05:00", - "end": "2017-11-10T00:39:38-05:00" - }, - "created": "2016-11-10T00:39:38-05:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:76cdad55-7e37-4f8b-82fd-fabbe1b84d86" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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": "2016-11-10T00:24:38-05:00", - "end": "2016-11-10T00:39:38-05:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "19", - "display": "Off Campus-Outpatient Hospital" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:f91eb13c-7f69-4d94-adf3-0b8739ab981f" - } - ] - }, - { - "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": "121", - "display": "zoster" - } - ], - "text": "zoster" - }, - "servicedPeriod": { - "start": "2016-11-10T00:24:38-05:00", - "end": "2016-11-10T00:39:38-05: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": "2016-11-10T00:24:38-05:00", - "end": "2016-11-10T00:39:38-05: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": "113", - "display": "Td (adult) preservative free" - } - ], - "text": "Td (adult) preservative free" - }, - "servicedPeriod": { - "start": "2016-11-10T00:24:38-05:00", - "end": "2016-11-10T00:39:38-05: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": 337.24800000000005, - "currency": "USD" - } - } - }, - "request": { - "method": "POST", - "url": "ExplanationOfBenefit" - } - }, - { - "fullUrl": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837", - "resource": { - "resourceType": "Encounter", - "id": "e4e9898a-8b74-4140-b477-8833a119f837", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710", - "display": "Dr. Shantae970 Cummerata161" - } - } - ], - "period": { - "start": "2017-11-16T00:24:38-05:00", - "end": "2017-11-16T00:54:38-05:00" - }, - "serviceProvider": { - "reference": "urn:uuid:54f6fc59-7709-310f-9249-1e92d0464b00", - "display": "PCP145391" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:301a8211-48d6-40b6-b353-dde369bdb61c", - "resource": { - "resourceType": "Observation", - "id": "301a8211-48d6-40b6-b353-dde369bdb61c", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - }, - "effectiveDateTime": "2017-11-16T00:24:38-05:00", - "issued": "2017-11-16T00:24:38.752-05:00", - "valueQuantity": { - "value": 155.01680645430415, - "unit": "cm", - "system": "http://unitsofmeasure.org", - "code": "cm" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:5cbc32a6-2296-4fc9-9cc0-73edd0ab84de", - "resource": { - "resourceType": "Observation", - "id": "5cbc32a6-2296-4fc9-9cc0-73edd0ab84de", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - }, - "effectiveDateTime": "2017-11-16T00:24:38-05:00", - "issued": "2017-11-16T00:24:38.752-05:00", - "valueQuantity": { - "value": 2.481255645341747, - "unit": "{score}", - "system": "http://unitsofmeasure.org", - "code": "{score}" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:2dc94d37-acee-4de2-8bed-9cc290183679", - "resource": { - "resourceType": "Observation", - "id": "2dc94d37-acee-4de2-8bed-9cc290183679", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - }, - "effectiveDateTime": "2017-11-16T00:24:38-05:00", - "issued": "2017-11-16T00:24:38.752-05:00", - "valueQuantity": { - "value": 65.79684973105927, - "unit": "kg", - "system": "http://unitsofmeasure.org", - "code": "kg" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:c3b3d836-7fdf-40f6-a1f2-906485ca0840", - "resource": { - "resourceType": "Observation", - "id": "c3b3d836-7fdf-40f6-a1f2-906485ca0840", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - }, - "effectiveDateTime": "2017-11-16T00:24:38-05:00", - "issued": "2017-11-16T00:24:38.752-05:00", - "valueQuantity": { - "value": 27.38088803859094, - "unit": "kg/m2", - "system": "http://unitsofmeasure.org", - "code": "kg/m2" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:42f61715-b8a6-4427-bb33-784d317aebc0", - "resource": { - "resourceType": "Observation", - "id": "42f61715-b8a6-4427-bb33-784d317aebc0", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - }, - "effectiveDateTime": "2017-11-16T00:24:38-05:00", - "issued": "2017-11-16T00:24:38.752-05:00", - "component": [ - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "8462-4", - "display": "Diastolic Blood Pressure" - } - ], - "text": "Diastolic Blood Pressure" - }, - "valueQuantity": { - "value": 79.17286180026619, - "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": 115.02102510870571, - "unit": "mm[Hg]", - "system": "http://unitsofmeasure.org", - "code": "mm[Hg]" - } - } - ] - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:502adfed-d94e-487f-8e53-de1942d02a48", - "resource": { - "resourceType": "Observation", - "id": "502adfed-d94e-487f-8e53-de1942d02a48", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - }, - "effectiveDateTime": "2017-11-16T00:24:38-05:00", - "issued": "2017-11-16T00:24:38.752-05:00", - "valueQuantity": { - "value": 4.8536148008758175, - "unit": "10*3/uL", - "system": "http://unitsofmeasure.org", - "code": "10*3/uL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:25bae0ad-d855-417d-b139-a17de67820c1", - "resource": { - "resourceType": "Observation", - "id": "25bae0ad-d855-417d-b139-a17de67820c1", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - }, - "effectiveDateTime": "2017-11-16T00:24:38-05:00", - "issued": "2017-11-16T00:24:38.752-05:00", - "valueQuantity": { - "value": 4.352730111870313, - "unit": "10*6/uL", - "system": "http://unitsofmeasure.org", - "code": "10*6/uL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:527a4ebf-88ce-4f9b-9c0d-7040d2e4cf88", - "resource": { - "resourceType": "Observation", - "id": "527a4ebf-88ce-4f9b-9c0d-7040d2e4cf88", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - }, - "effectiveDateTime": "2017-11-16T00:24:38-05:00", - "issued": "2017-11-16T00:24:38.752-05:00", - "valueQuantity": { - "value": 14.430972827914175, - "unit": "g/dL", - "system": "http://unitsofmeasure.org", - "code": "g/dL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:29a835b5-89e5-4347-8a1e-d25560644a36", - "resource": { - "resourceType": "Observation", - "id": "29a835b5-89e5-4347-8a1e-d25560644a36", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - }, - "effectiveDateTime": "2017-11-16T00:24:38-05:00", - "issued": "2017-11-16T00:24:38.752-05:00", - "valueQuantity": { - "value": 48.211447825793854, - "unit": "%", - "system": "http://unitsofmeasure.org", - "code": "%" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:82d6ffac-0cd8-49d1-8ba2-29782f870cb2", - "resource": { - "resourceType": "Observation", - "id": "82d6ffac-0cd8-49d1-8ba2-29782f870cb2", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - }, - "effectiveDateTime": "2017-11-16T00:24:38-05:00", - "issued": "2017-11-16T00:24:38.752-05:00", - "valueQuantity": { - "value": 92.14681288834502, - "unit": "fL", - "system": "http://unitsofmeasure.org", - "code": "fL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:978bb3ac-b3a8-45c7-8b36-45ec5b111d6b", - "resource": { - "resourceType": "Observation", - "id": "978bb3ac-b3a8-45c7-8b36-45ec5b111d6b", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - }, - "effectiveDateTime": "2017-11-16T00:24:38-05:00", - "issued": "2017-11-16T00:24:38.752-05:00", - "valueQuantity": { - "value": 32.348447496902125, - "unit": "pg", - "system": "http://unitsofmeasure.org", - "code": "pg" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:68f19561-ec1f-4f8c-b398-fc9d9bd36e0f", - "resource": { - "resourceType": "Observation", - "id": "68f19561-ec1f-4f8c-b398-fc9d9bd36e0f", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - }, - "effectiveDateTime": "2017-11-16T00:24:38-05:00", - "issued": "2017-11-16T00:24:38.752-05:00", - "valueQuantity": { - "value": 35.287986999768975, - "unit": "g/dL", - "system": "http://unitsofmeasure.org", - "code": "g/dL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:f276bb9b-35c3-470d-8984-c5a4bf5bbea7", - "resource": { - "resourceType": "Observation", - "id": "f276bb9b-35c3-470d-8984-c5a4bf5bbea7", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - }, - "effectiveDateTime": "2017-11-16T00:24:38-05:00", - "issued": "2017-11-16T00:24:38.752-05:00", - "valueQuantity": { - "value": 39.44326306635944, - "unit": "fL", - "system": "http://unitsofmeasure.org", - "code": "fL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:b5a8cfa8-bed5-46ae-9f9f-7d9c38da21e8", - "resource": { - "resourceType": "Observation", - "id": "b5a8cfa8-bed5-46ae-9f9f-7d9c38da21e8", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - }, - "effectiveDateTime": "2017-11-16T00:24:38-05:00", - "issued": "2017-11-16T00:24:38.752-05:00", - "valueQuantity": { - "value": 418.0016492722819, - "unit": "10*3/uL", - "system": "http://unitsofmeasure.org", - "code": "10*3/uL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:619114d1-e141-4eee-b69a-47f4e54f7408", - "resource": { - "resourceType": "Observation", - "id": "619114d1-e141-4eee-b69a-47f4e54f7408", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - }, - "effectiveDateTime": "2017-11-16T00:24:38-05:00", - "issued": "2017-11-16T00:24:38.752-05:00", - "valueQuantity": { - "value": 318.2642148107422, - "unit": "fL", - "system": "http://unitsofmeasure.org", - "code": "fL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:8254a7c0-7d2d-4f9c-9cd3-4a2d3a7aebaf", - "resource": { - "resourceType": "Observation", - "id": "8254a7c0-7d2d-4f9c-9cd3-4a2d3a7aebaf", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - }, - "effectiveDateTime": "2017-11-16T00:24:38-05:00", - "issued": "2017-11-16T00:24:38.752-05:00", - "valueQuantity": { - "value": 10.58609485122474, - "unit": "fL", - "system": "http://unitsofmeasure.org", - "code": "fL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:95fb6e40-82bc-4a14-8a5f-b8983d47b828", - "resource": { - "resourceType": "Observation", - "id": "95fb6e40-82bc-4a14-8a5f-b8983d47b828", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - }, - "effectiveDateTime": "2017-11-16T00:24:38-05:00", - "issued": "2017-11-16T00:24:38.752-05:00", - "valueCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "8517006", - "display": "Former smoker" - } - ], - "text": "Former smoker" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:74bbd7ed-5a74-4c5c-80b3-ab0bdf0c52e2", - "resource": { - "resourceType": "Procedure", - "id": "74bbd7ed-5a74-4c5c-80b3-ab0bdf0c52e2", - "status": "completed", - "code": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "430193006", - "display": "Medication Reconciliation (procedure)" - } - ], - "text": "Medication Reconciliation (procedure)" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - }, - "performedPeriod": { - "start": "2017-11-16T00:24:38-05:00", - "end": "2017-11-16T00:39:38-05:00" - } - }, - "request": { - "method": "POST", - "url": "Procedure" - } - }, - { - "fullUrl": "urn:uuid:c5e95b03-3c3f-41f8-9b12-996b3c0b4bdf", - "resource": { - "resourceType": "Immunization", - "id": "c5e95b03-3c3f-41f8-9b12-996b3c0b4bdf", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - }, - "occurrenceDateTime": "2017-11-16T00:24:38-05:00", - "primarySource": true - }, - "request": { - "method": "POST", - "url": "Immunization" - } - }, - { - "fullUrl": "urn:uuid:1475ea5d-a585-43ce-a16e-530084063ee6", - "resource": { - "resourceType": "DiagnosticReport", - "id": "1475ea5d-a585-43ce-a16e-530084063ee6", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - }, - "effectiveDateTime": "2017-11-16T00:24:38-05:00", - "issued": "2017-11-16T00:24:38.752-05:00", - "result": [ - { - "reference": "urn:uuid:502adfed-d94e-487f-8e53-de1942d02a48", - "display": "Leukocytes [#/volume] in Blood by Automated count" - }, - { - "reference": "urn:uuid:25bae0ad-d855-417d-b139-a17de67820c1", - "display": "Erythrocytes [#/volume] in Blood by Automated count" - }, - { - "reference": "urn:uuid:527a4ebf-88ce-4f9b-9c0d-7040d2e4cf88", - "display": "Hemoglobin [Mass/volume] in Blood" - }, - { - "reference": "urn:uuid:29a835b5-89e5-4347-8a1e-d25560644a36", - "display": "Hematocrit [Volume Fraction] of Blood by Automated count" - }, - { - "reference": "urn:uuid:82d6ffac-0cd8-49d1-8ba2-29782f870cb2", - "display": "MCV [Entitic volume] by Automated count" - }, - { - "reference": "urn:uuid:978bb3ac-b3a8-45c7-8b36-45ec5b111d6b", - "display": "MCH [Entitic mass] by Automated count" - }, - { - "reference": "urn:uuid:68f19561-ec1f-4f8c-b398-fc9d9bd36e0f", - "display": "MCHC [Mass/volume] by Automated count" - }, - { - "reference": "urn:uuid:f276bb9b-35c3-470d-8984-c5a4bf5bbea7", - "display": "Erythrocyte distribution width [Entitic volume] by Automated count" - }, - { - "reference": "urn:uuid:b5a8cfa8-bed5-46ae-9f9f-7d9c38da21e8", - "display": "Platelets [#/volume] in Blood by Automated count" - }, - { - "reference": "urn:uuid:619114d1-e141-4eee-b69a-47f4e54f7408", - "display": "Platelet distribution width [Entitic volume] in Blood by Automated count" - }, - { - "reference": "urn:uuid:8254a7c0-7d2d-4f9c-9cd3-4a2d3a7aebaf", - "display": "Platelet mean volume [Entitic volume] in Blood by Automated count" - } - ] - }, - "request": { - "method": "POST", - "url": "DiagnosticReport" - } - }, - { - "fullUrl": "urn:uuid:e31bf98d-2e5d-4d5f-8585-c5d809e025e6", - "resource": { - "resourceType": "Claim", - "id": "e31bf98d-2e5d-4d5f-8585-c5d809e025e6", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "2017-11-16T00:24:38-05:00", - "end": "2017-11-16T00:54:38-05:00" - }, - "created": "2017-11-16T00:54:38-05:00", - "provider": { - "reference": "urn:uuid:54f6fc59-7709-310f-9249-1e92d0464b00", - "display": "PCP145391" - }, - "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:c5e95b03-3c3f-41f8-9b12-996b3c0b4bdf" - } - } - ], - "procedure": [ - { - "sequence": 1, - "procedureReference": { - "reference": "urn:uuid:74bbd7ed-5a74-4c5c-80b3-ab0bdf0c52e2" - } - } - ], - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "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:e4e9898a-8b74-4140-b477-8833a119f837" - } - ] - }, - { - "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, - "procedureSequence": [ - 1 - ], - "productOrService": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "430193006", - "display": "Medication Reconciliation (procedure)" - } - ], - "text": "Medication Reconciliation (procedure)" - }, - "net": { - "value": 511.82, - "currency": "USD" - } - } - ], - "total": { - "value": 129.16, - "currency": "USD" - } - }, - "request": { - "method": "POST", - "url": "Claim" - } - }, - { - "fullUrl": "urn:uuid:c189c230-f45e-4855-9488-5ab17801322a", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "c189c230-f45e-4855-9488-5ab17801322a", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "e31bf98d-2e5d-4d5f-8585-c5d809e025e6" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "2017-11-16T00:54:38-05:00", - "end": "2018-11-16T00:54:38-05:00" - }, - "created": "2017-11-16T00:54:38-05:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:e31bf98d-2e5d-4d5f-8585-c5d809e025e6" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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-11-16T00:24:38-05:00", - "end": "2017-11-16T00:54:38-05:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "19", - "display": "Off Campus-Outpatient Hospital" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:e4e9898a-8b74-4140-b477-8833a119f837" - } - ] - }, - { - "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-11-16T00:24:38-05:00", - "end": "2017-11-16T00:54:38-05: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, - "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": "430193006", - "display": "Medication Reconciliation (procedure)" - } - ], - "text": "Medication Reconciliation (procedure)" - }, - "servicedPeriod": { - "start": "2017-11-16T00:24:38-05:00", - "end": "2017-11-16T00:54:38-05:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "19", - "display": "Off Campus-Outpatient Hospital" - } - ] - }, - "net": { - "value": 511.82, - "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": 102.364, - "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": 409.456, - "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": 511.82, - "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": 511.82, - "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": 521.8720000000001, - "currency": "USD" - } - } - }, - "request": { - "method": "POST", - "url": "ExplanationOfBenefit" - } - }, - { - "fullUrl": "urn:uuid:ddce7eb9-3b5e-484b-961e-f47914854bd2", - "resource": { - "resourceType": "Encounter", - "id": "ddce7eb9-3b5e-484b-961e-f47914854bd2", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Ms. Alesha810 Marks830" - }, - "participant": [ - { - "individual": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710", - "display": "Dr. Shantae970 Cummerata161" - } - } - ], - "period": { - "start": "2018-11-22T00:24:38-05:00", - "end": "2018-11-22T00:39:38-05:00" - }, - "serviceProvider": { - "reference": "urn:uuid:54f6fc59-7709-310f-9249-1e92d0464b00", - "display": "PCP145391" - } - }, - "request": { - "method": "POST", - "url": "Encounter" - } - }, - { - "fullUrl": "urn:uuid:c0c77f66-bc64-460f-8d7e-bf6c7c8d044d", - "resource": { - "resourceType": "Observation", - "id": "c0c77f66-bc64-460f-8d7e-bf6c7c8d044d", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:ddce7eb9-3b5e-484b-961e-f47914854bd2" - }, - "effectiveDateTime": "2018-11-22T00:24:38-05:00", - "issued": "2018-11-22T00:24:38.752-05:00", - "valueQuantity": { - "value": 155.01680645430415, - "unit": "cm", - "system": "http://unitsofmeasure.org", - "code": "cm" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:66daa3de-187c-4c78-a1d0-262f65afea48", - "resource": { - "resourceType": "Observation", - "id": "66daa3de-187c-4c78-a1d0-262f65afea48", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:ddce7eb9-3b5e-484b-961e-f47914854bd2" - }, - "effectiveDateTime": "2018-11-22T00:24:38-05:00", - "issued": "2018-11-22T00:24:38.752-05:00", - "valueQuantity": { - "value": 0.43073343370131845, - "unit": "{score}", - "system": "http://unitsofmeasure.org", - "code": "{score}" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:ded6f5a5-6079-4d7e-9b6d-2098853be4c6", - "resource": { - "resourceType": "Observation", - "id": "ded6f5a5-6079-4d7e-9b6d-2098853be4c6", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:ddce7eb9-3b5e-484b-961e-f47914854bd2" - }, - "effectiveDateTime": "2018-11-22T00:24:38-05:00", - "issued": "2018-11-22T00:24:38.752-05:00", - "valueQuantity": { - "value": 65.79684973105927, - "unit": "kg", - "system": "http://unitsofmeasure.org", - "code": "kg" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:c245c731-c53d-43d3-85a2-7999ab359899", - "resource": { - "resourceType": "Observation", - "id": "c245c731-c53d-43d3-85a2-7999ab359899", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:ddce7eb9-3b5e-484b-961e-f47914854bd2" - }, - "effectiveDateTime": "2018-11-22T00:24:38-05:00", - "issued": "2018-11-22T00:24:38.752-05:00", - "valueQuantity": { - "value": 27.38088803859094, - "unit": "kg/m2", - "system": "http://unitsofmeasure.org", - "code": "kg/m2" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:475b8086-234d-4d13-b1cc-b56001514008", - "resource": { - "resourceType": "Observation", - "id": "475b8086-234d-4d13-b1cc-b56001514008", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:ddce7eb9-3b5e-484b-961e-f47914854bd2" - }, - "effectiveDateTime": "2018-11-22T00:24:38-05:00", - "issued": "2018-11-22T00:24:38.752-05:00", - "component": [ - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "8462-4", - "display": "Diastolic Blood Pressure" - } - ], - "text": "Diastolic Blood Pressure" - }, - "valueQuantity": { - "value": 76.15928475258472, - "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": 109.29940925015008, - "unit": "mm[Hg]", - "system": "http://unitsofmeasure.org", - "code": "mm[Hg]" - } - } - ] - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:b779ba4a-353b-48ac-934b-70b27835b1ad", - "resource": { - "resourceType": "Observation", - "id": "b779ba4a-353b-48ac-934b-70b27835b1ad", - "status": "final", - "category": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/observation-category", - "code": "laboratory", - "display": "laboratory" - } - ] - } - ], - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "2093-3", - "display": "Total Cholesterol" - } - ], - "text": "Total Cholesterol" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:ddce7eb9-3b5e-484b-961e-f47914854bd2" - }, - "effectiveDateTime": "2018-11-22T00:24:38-05:00", - "issued": "2018-11-22T00:24:38.752-05:00", - "valueQuantity": { - "value": 189.5461446255375, - "unit": "mg/dL", - "system": "http://unitsofmeasure.org", - "code": "mg/dL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:c2955df2-1363-40e2-a6a9-7ed6bb5a07e3", - "resource": { - "resourceType": "Observation", - "id": "c2955df2-1363-40e2-a6a9-7ed6bb5a07e3", - "status": "final", - "category": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/observation-category", - "code": "laboratory", - "display": "laboratory" - } - ] - } - ], - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "2571-8", - "display": "Triglycerides" - } - ], - "text": "Triglycerides" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:ddce7eb9-3b5e-484b-961e-f47914854bd2" - }, - "effectiveDateTime": "2018-11-22T00:24:38-05:00", - "issued": "2018-11-22T00:24:38.752-05:00", - "valueQuantity": { - "value": 147.2569551323221, - "unit": "mg/dL", - "system": "http://unitsofmeasure.org", - "code": "mg/dL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:419d6cfc-0652-4f5b-ace0-ce7e29245ea1", - "resource": { - "resourceType": "Observation", - "id": "419d6cfc-0652-4f5b-ace0-ce7e29245ea1", - "status": "final", - "category": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/observation-category", - "code": "laboratory", - "display": "laboratory" - } - ] - } - ], - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "18262-6", - "display": "Low Density Lipoprotein Cholesterol" - } - ], - "text": "Low Density Lipoprotein Cholesterol" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:ddce7eb9-3b5e-484b-961e-f47914854bd2" - }, - "effectiveDateTime": "2018-11-22T00:24:38-05:00", - "issued": "2018-11-22T00:24:38.752-05:00", - "valueQuantity": { - "value": 99.45316057404943, - "unit": "mg/dL", - "system": "http://unitsofmeasure.org", - "code": "mg/dL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:7fb19f5c-fcc5-452d-9bec-10ea25352db4", - "resource": { - "resourceType": "Observation", - "id": "7fb19f5c-fcc5-452d-9bec-10ea25352db4", - "status": "final", - "category": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/observation-category", - "code": "laboratory", - "display": "laboratory" - } - ] - } - ], - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "2085-9", - "display": "High Density Lipoprotein Cholesterol" - } - ], - "text": "High Density Lipoprotein Cholesterol" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:ddce7eb9-3b5e-484b-961e-f47914854bd2" - }, - "effectiveDateTime": "2018-11-22T00:24:38-05:00", - "issued": "2018-11-22T00:24:38.752-05:00", - "valueQuantity": { - "value": 60.64159302502363, - "unit": "mg/dL", - "system": "http://unitsofmeasure.org", - "code": "mg/dL" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:952d932f-2cc7-4853-9634-27c01dc2f13f", - "resource": { - "resourceType": "Observation", - "id": "952d932f-2cc7-4853-9634-27c01dc2f13f", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:ddce7eb9-3b5e-484b-961e-f47914854bd2" - }, - "effectiveDateTime": "2018-11-22T00:24:38-05:00", - "issued": "2018-11-22T00:24:38.752-05:00", - "valueCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "8517006", - "display": "Former smoker" - } - ], - "text": "Former smoker" - } - }, - "request": { - "method": "POST", - "url": "Observation" - } - }, - { - "fullUrl": "urn:uuid:4b1647ec-57a3-4a4f-aaf7-7e90d4185ccd", - "resource": { - "resourceType": "Immunization", - "id": "4b1647ec-57a3-4a4f-aaf7-7e90d4185ccd", - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:ddce7eb9-3b5e-484b-961e-f47914854bd2" - }, - "occurrenceDateTime": "2018-11-22T00:24:38-05:00", - "primarySource": true - }, - "request": { - "method": "POST", - "url": "Immunization" - } - }, - { - "fullUrl": "urn:uuid:b461dc4f-c53b-4c18-b916-575f98cd2ad5", - "resource": { - "resourceType": "DiagnosticReport", - "id": "b461dc4f-c53b-4c18-b916-575f98cd2ad5", - "status": "final", - "category": [ - { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0074", - "code": "LAB", - "display": "Laboratory" - } - ] - } - ], - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "57698-3", - "display": "Lipid Panel" - } - ], - "text": "Lipid Panel" - }, - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "encounter": { - "reference": "urn:uuid:ddce7eb9-3b5e-484b-961e-f47914854bd2" - }, - "effectiveDateTime": "2018-11-22T00:24:38-05:00", - "issued": "2018-11-22T00:24:38.752-05:00", - "result": [ - { - "reference": "urn:uuid:b779ba4a-353b-48ac-934b-70b27835b1ad", - "display": "Total Cholesterol" - }, - { - "reference": "urn:uuid:c2955df2-1363-40e2-a6a9-7ed6bb5a07e3", - "display": "Triglycerides" - }, - { - "reference": "urn:uuid:419d6cfc-0652-4f5b-ace0-ce7e29245ea1", - "display": "Low Density Lipoprotein Cholesterol" - }, - { - "reference": "urn:uuid:7fb19f5c-fcc5-452d-9bec-10ea25352db4", - "display": "High Density Lipoprotein Cholesterol" - } - ] - }, - "request": { - "method": "POST", - "url": "DiagnosticReport" - } - }, - { - "fullUrl": "urn:uuid:110639e9-7b4b-4e05-a7b2-26077c348977", - "resource": { - "resourceType": "Claim", - "id": "110639e9-7b4b-4e05-a7b2-26077c348977", - "status": "active", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claim-type", - "code": "institutional" - } - ] - }, - "use": "claim", - "patient": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9", - "display": "Alesha810 Marks830" - }, - "billablePeriod": { - "start": "2018-11-22T00:24:38-05:00", - "end": "2018-11-22T00:39:38-05:00" - }, - "created": "2018-11-22T00:39:38-05:00", - "provider": { - "reference": "urn:uuid:54f6fc59-7709-310f-9249-1e92d0464b00", - "display": "PCP145391" - }, - "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:4b1647ec-57a3-4a4f-aaf7-7e90d4185ccd" - } - } - ], - "insurance": [ - { - "sequence": 1, - "focal": true, - "coverage": { - "display": "Blue Cross Blue Shield" - } - } - ], - "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:ddce7eb9-3b5e-484b-961e-f47914854bd2" - } - ] - }, - { - "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:d00feb8d-243d-4636-9e21-fe47c398db8a", - "resource": { - "resourceType": "ExplanationOfBenefit", - "id": "d00feb8d-243d-4636-9e21-fe47c398db8a", - "contained": [ - { - "resourceType": "ServiceRequest", - "id": "referral", - "status": "completed", - "intent": "order", - "subject": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "requester": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "performer": [ - { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - } - ] - }, - { - "resourceType": "Coverage", - "id": "coverage", - "status": "active", - "type": { - "text": "Blue Cross Blue Shield" - }, - "beneficiary": { - "reference": "urn:uuid:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "payor": [ - { - "display": "Blue Cross Blue Shield" - } - ] - } - ], - "identifier": [ - { - "system": "https://bluebutton.cms.gov/resources/variables/clm_id", - "value": "110639e9-7b4b-4e05-a7b2-26077c348977" - }, - { - "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:c088b7af-fc41-43cc-ab80-4a9ab8d47cd9" - }, - "billablePeriod": { - "start": "2018-11-22T00:39:38-05:00", - "end": "2019-11-22T00:39:38-05:00" - }, - "created": "2018-11-22T00:39:38-05:00", - "insurer": { - "display": "Blue Cross Blue Shield" - }, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "referral": { - "reference": "#referral" - }, - "claim": { - "reference": "urn:uuid:110639e9-7b4b-4e05-a7b2-26077c348977" - }, - "outcome": "complete", - "careTeam": [ - { - "sequence": 1, - "provider": { - "reference": "urn:uuid:0000016d-3a85-4cca-0000-00000000c710" - }, - "role": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", - "code": "primary", - "display": "Primary Care Practitioner" - } - ] - } - } - ], - "insurance": [ - { - "focal": true, - "coverage": { - "reference": "#coverage", - "display": "Blue Cross Blue Shield" - } - } - ], - "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-11-22T00:24:38-05:00", - "end": "2018-11-22T00:39:38-05:00" - }, - "locationCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", - "code": "19", - "display": "Off Campus-Outpatient Hospital" - } - ] - }, - "encounter": [ - { - "reference": "urn:uuid:ddce7eb9-3b5e-484b-961e-f47914854bd2" - } - ] - }, - { - "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-11-22T00:24:38-05:00", - "end": "2018-11-22T00:39:38-05: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/frontend/src/lib/conduit/fhir/bluebutton_client.ts b/frontend/src/lib/conduit/fhir/bluebutton_client.ts deleted file mode 100644 index 16f67ce5..00000000 --- a/frontend/src/lib/conduit/fhir/bluebutton_client.ts +++ /dev/null @@ -1,26 +0,0 @@ -import {IClient} from '../interface'; -import {FHIR401Client} from './base/fhir401_r4_client'; -import {Source} from '../../models/database/source'; -import {IDatabaseRepository} from '../../database/interface'; -import {UpsertSummary} from '../../models/fasten/upsert-summary'; -import {ClientConfig} from '../../models/client/client-config'; - -export class BlueButtonClient extends FHIR401Client implements IClient { - constructor(source: Source, clientConfig: ClientConfig) { - super(source, clientConfig); - } - - /** - * BlueButton overrides the SyncAll function because Patient-everything operation is not available. - * @param db - * @constructor - */ - async SyncAll(db: IDatabaseRepository): Promise { - const supportedResources: string[] = [ - "ExplanationOfBenefit", - "Coverage", - ] - - return this.SyncAllByResourceName(db, supportedResources) - } -} diff --git a/frontend/src/lib/conduit/fhir/cigna_client.ts b/frontend/src/lib/conduit/fhir/cigna_client.ts deleted file mode 100644 index e5d02b6b..00000000 --- a/frontend/src/lib/conduit/fhir/cigna_client.ts +++ /dev/null @@ -1,11 +0,0 @@ -import {IClient} from '../interface'; -import {FHIR401Client} from './base/fhir401_r4_client'; -import {Source} from '../../models/database/source'; -import {ClientConfig} from '../../models/client/client-config'; - -export class CignaClient extends FHIR401Client implements IClient { - constructor(source: Source, clientConfig: ClientConfig) { - super(source, clientConfig); - } - -} diff --git a/frontend/src/lib/conduit/fhir/platforms/careevolution_client.ts b/frontend/src/lib/conduit/fhir/platforms/careevolution_client.ts deleted file mode 100644 index 87321adb..00000000 --- a/frontend/src/lib/conduit/fhir/platforms/careevolution_client.ts +++ /dev/null @@ -1,13 +0,0 @@ -import {IClient} from '../../interface'; -import {FHIR401Client} from '../base/fhir401_r4_client'; -import {Source} from '../../../models/database/source'; -import {ClientConfig} from '../../../models/client/client-config'; - -export class CareEvolutionClient extends FHIR401Client implements IClient { - constructor(source: Source, clientConfig: ClientConfig) { - super(source, clientConfig); - //CareEvolution API requires the following Accept header for every request - this.headers.set("Accept","application/json+fhir") - } - -} diff --git a/frontend/src/lib/conduit/fhir/platforms/cerner_client.ts b/frontend/src/lib/conduit/fhir/platforms/cerner_client.ts deleted file mode 100644 index a690d131..00000000 --- a/frontend/src/lib/conduit/fhir/platforms/cerner_client.ts +++ /dev/null @@ -1,41 +0,0 @@ -import {IClient} from '../../interface'; -import {FHIR401Client} from '../base/fhir401_r4_client'; -import {Source} from '../../../models/database/source'; -import {IDatabaseRepository} from '../../../database/interface'; -import {UpsertSummary} from '../../../models/fasten/upsert-summary'; -import {ClientConfig} from '../../../models/client/client-config'; - -export class CernerClient extends FHIR401Client implements IClient { - constructor(source: Source, clientConfig: ClientConfig) { - super(source, clientConfig); - //Cerner API requires the following Accept header for every request - this.headers.set("Accept","application/json+fhir") - } - - /** - * Cerner overrides the SyncAll function because Patient-everything operation is not available. - * @param db - * @constructor - */ - async SyncAll(db: IDatabaseRepository): Promise { - const supportedResources: string[] = this.usCoreResources.concat([ - "Account", - "Appointment", - "Consent", - "FamilyMemberHistory", - "InsurancePlan", - "MedicationRequest", - "NutritionOrder", - "Person", - "Provenance", - "Questionnaire", - "QuestionnaireResponse", - "RelatedPerson", - "Schedule", - "ServiceRequest", - "Slot", - ]) - - return this.SyncAllByResourceName(db, supportedResources) - } -} diff --git a/frontend/src/lib/conduit/fhir/platforms/epic_client.ts b/frontend/src/lib/conduit/fhir/platforms/epic_client.ts deleted file mode 100644 index c02124a9..00000000 --- a/frontend/src/lib/conduit/fhir/platforms/epic_client.ts +++ /dev/null @@ -1,39 +0,0 @@ -import {IClient} from '../../interface'; -import {FHIR401Client} from '../base/fhir401_r4_client'; -import {Source} from '../../../models/database/source'; -import {IDatabaseRepository} from '../../../database/interface'; -import {UpsertSummary} from '../../../models/fasten/upsert-summary'; -import {ClientConfig} from '../../../models/client/client-config'; - -export class EpicClient extends FHIR401Client implements IClient { - constructor(source: Source, clientConfig: ClientConfig) { - super(source, clientConfig); - //Epic API requires the following Accept header for every request - this.headers.set("Accept","application/json+fhir") - } - - /** - * Epic overrides the SyncAll function because Patient-everything operation is not available. - * @param db - * @constructor - */ - async SyncAll(db: IDatabaseRepository): Promise { - const supportedResources: string[] = this.usCoreResources.concat([ - "Consent", - "FamilyMemberHistory", - "InsurancePlan", - "MedicationRequest", - "NutritionOrder", - "Person", - "Provenance", - "Questionnaire", - "QuestionnaireResponse", - "RelatedPerson", - "Schedule", - "ServiceRequest", - "Slot", - ]) - - return this.SyncAllByResourceName(db, supportedResources) - } -} diff --git a/frontend/src/lib/conduit/fhir/sandbox/athena_client.ts b/frontend/src/lib/conduit/fhir/sandbox/athena_client.ts deleted file mode 100644 index 7543311b..00000000 --- a/frontend/src/lib/conduit/fhir/sandbox/athena_client.ts +++ /dev/null @@ -1,23 +0,0 @@ -import {IClient} from '../../interface'; -import {FHIR401Client} from '../base/fhir401_r4_client'; -import {Source} from '../../../models/database/source'; -import {IDatabaseRepository} from '../../../database/interface'; -import {UpsertSummary} from '../../../models/fasten/upsert-summary'; -import {ClientConfig} from '../../../models/client/client-config'; - -export class AthenaClient extends FHIR401Client implements IClient { - constructor(source: Source, clientConfig: ClientConfig) { - super(source, clientConfig); - } - - /** - * Athena overrides the SyncAll function because Patient-everything operation is not available. - * @param db - * @constructor - */ - async SyncAll(db: IDatabaseRepository): Promise { - const supportedResources: string[] = this.usCoreResources - - return this.SyncAllByResourceName(db, supportedResources) - } -} diff --git a/frontend/src/lib/conduit/fhir/sandbox/healthit_client.ts b/frontend/src/lib/conduit/fhir/sandbox/healthit_client.ts deleted file mode 100644 index 03b077f8..00000000 --- a/frontend/src/lib/conduit/fhir/sandbox/healthit_client.ts +++ /dev/null @@ -1,39 +0,0 @@ -import {IClient} from '../../interface'; -import {FHIR401Client} from '../base/fhir401_r4_client'; -import {Source} from '../../../models/database/source'; -import {IDatabaseRepository} from '../../../database/interface'; -import {UpsertSummary} from '../../../models/fasten/upsert-summary'; -import {ClientConfig} from '../../../models/client/client-config'; - -export class HealthITClient extends FHIR401Client implements IClient { - constructor(source: Source, clientConfig: ClientConfig) { - super(source, clientConfig); - //HealthIT API requires the following Accept header for every request - this.headers.set("Accept","application/json+fhir") - } - - /** - * HealthIT overrides the SyncAll function because Patient-everything operation is not available. - * @param db - * @constructor - */ - async SyncAll(db: IDatabaseRepository): Promise { - const supportedResources: string[] = this.usCoreResources.concat([ - "Consent", - "FamilyMemberHistory", - "InsurancePlan", - "MedicationRequest", - "NutritionOrder", - "Person", - "Provenance", - "Questionnaire", - "QuestionnaireResponse", - "RelatedPerson", - "Schedule", - "ServiceRequest", - "Slot", - ]) - - return this.SyncAllByResourceName(db, supportedResources) - } -} diff --git a/frontend/src/lib/conduit/fhir/sandbox/logica_client.ts b/frontend/src/lib/conduit/fhir/sandbox/logica_client.ts deleted file mode 100644 index 225cddb1..00000000 --- a/frontend/src/lib/conduit/fhir/sandbox/logica_client.ts +++ /dev/null @@ -1,11 +0,0 @@ -import {IClient} from '../../interface'; -import {FHIR401Client} from '../base/fhir401_r4_client'; -import {Source} from '../../../models/database/source'; -import {IDatabaseRepository} from '../../../database/interface'; -import {ClientConfig} from '../../../models/client/client-config'; - -export class LogicaClient extends FHIR401Client implements IClient { - constructor(source: Source, clientConfig: ClientConfig) { - super(source, clientConfig); - } -} diff --git a/frontend/src/lib/conduit/interface.ts b/frontend/src/lib/conduit/interface.ts deleted file mode 100644 index c9c6b222..00000000 --- a/frontend/src/lib/conduit/interface.ts +++ /dev/null @@ -1,58 +0,0 @@ -import {IDatabaseRepository} from '../database/interface'; -import {UpsertSummary} from '../models/fasten/upsert-summary'; -import {Source} from '../models/database/source'; - -export interface IClient { - fhirVersion: string - source: Source - GetRequest(resourceSubpath: string): Promise - GetFhirVersion(): Promise - RefreshSourceToken(): Promise - - /** - * This function attempts to retrieve a Patient Bundle and sync all resources to the database - * @param db - * @constructor - */ - SyncAll(db: IDatabaseRepository): Promise - - - SyncAllByResourceName(db: IDatabaseRepository, resourceNames: string[]): Promise - - //Manual client ONLY functions - SyncAllFromBundleFile(db: IDatabaseRepository, bundleFile: any): Promise -} - -//This is the "raw" Fhir resource -export interface IResourceRaw { - resourceType: string - id?: string - meta?: IResourceMetaRaw -} -// This is the "raw" Fhir Bundle resource -export interface IResourceBundleRaw { - resourceType: string - id?: string - entry: IResourceBundleEntryRaw[] - total?: number - link?: IResourceBundleLinkRaw[] - meta?: IResourceMetaRaw -} - -export interface IResourceBundleLinkRaw { - id?: string - relation: string - url: string -} - -export interface IResourceBundleEntryRaw { - id?: string - fullUrl?: string - resource: IResourceRaw -} - -export interface IResourceMetaRaw { - id?: string - versionId?: string - lastUpdated: string -} diff --git a/frontend/src/lib/database/constants.ts b/frontend/src/lib/database/constants.ts deleted file mode 100644 index 5d727b2d..00000000 --- a/frontend/src/lib/database/constants.ts +++ /dev/null @@ -1,4 +0,0 @@ -export enum DocType { - Source = "source", - ResourceFhir = "resource_fhir" -} diff --git a/frontend/src/lib/database/interface.ts b/frontend/src/lib/database/interface.ts deleted file mode 100644 index 6c40c22f..00000000 --- a/frontend/src/lib/database/interface.ts +++ /dev/null @@ -1,49 +0,0 @@ -import {Source} from '../models/database/source'; -import {ResourceFhir} from '../models/database/resource_fhir'; -import {SourceSummary} from '../models/fasten/source-summary'; -import {Summary} from '../models/fasten/summary'; -import {User} from '../models/fasten/user'; -import {UpsertSummary} from '../models/fasten/upsert-summary'; -// import {SourceSummary} from '../../app/models/fasten/source-summary'; - -export interface IDatabaseDocument { - _id?: string - _rev?: string - doc_type: string - updated_at?: string - - populateId(): void - base64Id(): string -} - -export interface IDatabasePaginatedResponse { - offset: number, - total_rows: number, - rows: any[] -} -export interface IDatabaseRepository { - GetDB(skipEncryption?: boolean): any - Close(): void - - // CreateUser(*models.User) error - // GetUserByEmail(context.Context, string) (*models.User, error) - // GetCurrentUser(context.Context) *models.User - - UpsertSource(source: Source): Promise - GetSource(source_id: string): Promise - DeleteSource(source_id: string): Promise - GetSourceSummary(source_id: string): Promise - GetSources(): Promise - IsDatabasePopulated(): Promise - - // UpsertResource(context.Context, *models.ResourceFhir) error - // GetResourceBySourceType(context.Context, string, string) (*models.ResourceFhir, error) - // GetResourceBySourceId(context.Context, string, string) (*models.ResourceFhir, error) - // ListResources(context.Context, models.ListResourceQueryOptions) ([]models.ResourceFhir, error) - // GetPatientForSources(ctx context.Context) ([]models.ResourceFhir, error) - UpsertResource(resource: ResourceFhir): Promise - UpsertResources(resources: ResourceFhir[]): Promise - GetResource(resource_id: string): Promise - GetResources(): Promise - GetResourcesForSource(source_id: string, source_resource_type?: string): Promise -} diff --git a/frontend/src/lib/database/plugins/crypto.ts b/frontend/src/lib/database/plugins/crypto.ts deleted file mode 100644 index b081c471..00000000 --- a/frontend/src/lib/database/plugins/crypto.ts +++ /dev/null @@ -1,159 +0,0 @@ -// This is a Typescript module that recreates the functionality defined in https://github.com/calvinmetcalf/crypto-pouch/blob/master/index.js -// This file only exists because the PouchDB crypto plugin must work in both the browser and web-worker environment (where `window` is -// undefined and causes errors). -// Also, crypto-pouch does not support storing encrypted data in the remote database by default, which I'm attempting to do by commenting out the -// NO_COUCH error. -// -// We've attempted to use the Typescript Module Plugin/Augmentation pattern to modify the global `pouchdb` object, however that -// failed for a variety of reasons, so instead we're using a PouchdbCrypto class with static methods to re-implement the crypto logic -// -// -// See: -// - https://github.com/calvinmetcalf/crypto-pouch/blob/master/index.js -// - https://www.typescriptlang.org/docs/handbook/declaration-files/templates/module-plugin-d-ts.html -// - https://www.typescriptlang.org/docs/handbook/declaration-merging.html -// - https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-plugin-d-ts.html -// - https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html -// - https://stackoverflow.com/questions/35074713/extending-typescript-global-object-in-node-js -// - https://github.com/Microsoft/TypeScript/issues/15818 - -import * as Crypt from 'garbados-crypt'; -import { openDB, deleteDB, wrap, unwrap } from 'idb'; - -// const Crypt = require() - -const LOCAL_ID = '_local/crypto' -const IGNORE = ['_id', '_rev', '_deleted', '_conflicts'] - -// const NO_COUCH = 'crypto-pouch does not work with pouchdb\'s http adapter. Use a local adapter instead.' - -export class PouchdbCryptoOptions { - ignore?: string[] -} - -export class PouchdbCryptConfig { - username: string - key: string - config: string -} - - -export class PouchdbCrypto { - private static async localIdb(){ - const dbPromise = openDB('crypto-store', 1, { - upgrade(db) { - db.createObjectStore('crypto'); - }, - }); - - return await dbPromise - } - - - public static async CryptConfig(key: string, username): Promise{ - const _crypt = new Crypt(key) - let exportString = await _crypt.export() - return {username: username, key: key, config: exportString} - } - - public static async StoreCryptConfig(cryptConfig: PouchdbCryptConfig) { - const localDb = await PouchdbCrypto.localIdb() - await localDb.put('crypto', JSON.stringify(cryptConfig), `encryption_data_${cryptConfig.username}`) - } - - public static async RetrieveCryptConfig(currentUser: string): Promise{ - const localDb = await PouchdbCrypto.localIdb() - let cryptConfigStr = await localDb.get('crypto',`encryption_data_${currentUser}`) - if(!cryptConfigStr){ - throw new Error("crypto configuration not set") - } - return JSON.parse(cryptConfigStr) as PouchdbCryptConfig - } - public static async DeleteCryptConfig(currentUser: string): Promise{ - const localDb = await PouchdbCrypto.localIdb() - return await localDb.delete('crypto',`encryption_data_${currentUser}`) - } - - - public static async crypto(db, cryptConfig: PouchdbCryptConfig, options: PouchdbCryptoOptions = {}) { - // if (db.adapter === 'http') { - // throw new Error(NO_COUCH) - // } - // if (typeof password === 'object') { - // // handle `db.crypto({ password, ...options })` - // options = password - // password = password.password - // delete options.password - // } - // setup ignore list - db._ignore = IGNORE.concat(options.ignore || []) - - if(!cryptConfig || !cryptConfig.key || !cryptConfig.config){ - throw new Error("crypto configuration file is required") - } - - // setup crypto helper - const trySetup = async () => { - // try saving credentials to a local doc - try { - // // first we try to get saved creds from the local doc - // const localDb = await PouchdbCrypto.localIdb() - // let exportString = await localDb.get('crypto',`encryption_data_${db.name}`) - // if(!exportString){ - // // no existing encryption key found - // - // // do first-time setup - // db._crypt = new Crypt(password) - // let exportString = await db._crypt.export() - // await localDb.put('crypto', exportString, `encryption_data_${db.name}`) - // } else { - // - // } - - db._crypt = await Crypt.import(cryptConfig.key, cryptConfig.config) - - } catch (err) { - throw err - } - } - await trySetup() - // instrument document transforms - db.transform({ - incoming: async (doc) => { - // if no crypt, ex: after .removeCrypto(), just return the doc - if (!db._crypt) { - return doc - } - if (doc._attachments && !db._ignore.includes('_attachments')) { - throw new Error('Attachments cannot be encrypted. Use {ignore: "_attachments"} option') - } - let encrypted: any = {} - for (let key of db._ignore) { - // attach ignored fields to encrypted doc - if (key in doc) encrypted[key] = doc[key] - } - encrypted.payload = await db._crypt.encrypt(JSON.stringify(doc)) - return encrypted - }, - outgoing: async (doc) => { - return await this.decryptDocument(db, doc) - } - }) - return db - } - public static async decryptDocument(db, doc):Promise{ - // if no crypt, ex: after .removeCrypto(), just return the doc - if (!db._crypt) { return doc } - let decryptedString = await db._crypt.decrypt(doc.payload) - let decrypted = JSON.parse(decryptedString) - for (let key of db._ignore) { - // patch decrypted doc with ignored fields - if (key in doc) decrypted[key] = doc[key] - } - return decrypted - } - - public static removeCrypto(db) { - delete db._crypt - } -} diff --git a/frontend/src/lib/database/plugins/upsert.ts b/frontend/src/lib/database/plugins/upsert.ts deleted file mode 100644 index 6a80fc50..00000000 --- a/frontend/src/lib/database/plugins/upsert.ts +++ /dev/null @@ -1,101 +0,0 @@ -// This is a Typescript module that recreates the functionality defined in https://github.com/pouchdb/upsert/blob/master/index.js -// This file only exists because the PouchDB upsert plugin must work in both the browser and web-worker environment (where `window` is -// undefined and causes errors). -// -// We've attempted to use the Typescript Module Plugin/Augmentation pattern to modify the global `pouchdb` object, however that -// failed for a variety of reasons, so instead we're using a PouchdbUpsert class with static methods to re-implement the upsert logic -// -// See: -// - https://github.com/pouchdb/upsert/blob/master/index.js -// - https://www.typescriptlang.org/docs/handbook/declaration-files/templates/module-plugin-d-ts.html -// - https://www.typescriptlang.org/docs/handbook/declaration-merging.html -// - https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-plugin-d-ts.html -// - https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html -// - https://stackoverflow.com/questions/35074713/extending-typescript-global-object-in-node-js -// - https://github.com/Microsoft/TypeScript/issues/15818 -export class PouchdbUpsert { - public static upsert(db, docId, diffFun, cb?) { - var promise = PouchdbUpsert.upsertInner(db, docId, diffFun); - if (typeof cb !== 'function') { - return promise; - } - promise.then(function(resp) { - cb(null, resp); - }, cb); - }; - - public static putIfNotExists(db, docId, doc, cb?) { - if (typeof docId !== 'string') { - cb = doc; - doc = docId; - docId = doc._id; - } - - var diffFun = function(existingDoc) { - if (existingDoc._rev) { - return false; // do nothing - } - return doc; - }; - - var promise = PouchdbUpsert.upsertInner(db, docId, diffFun); - if (typeof cb !== 'function') { - return promise; - } - promise.then(function(resp) { - cb(null, resp); - }, cb); - }; - - /////////////////////////////////////////////////////////////////////////////////////// - // private methods - /////////////////////////////////////////////////////////////////////////////////////// - // this is essentially the "update sugar" function from daleharvey/pouchdb#1388 - // the diffFun tells us what delta to apply to the doc. it either returns - // the doc, or false if it doesn't need to do an update after all - private static upsertInner(db, docId, diffFun) { - if (typeof docId !== 'string') { - return Promise.reject(new Error('doc id is required')); - } - - return db.get(docId).catch(function (err) { - /* istanbul ignore next */ - if (err.status !== 404) { - throw err; - } - return {}; - }).then(function (doc) { - // the user might change the _rev, so save it for posterity - var docRev = doc._rev; - var newDoc = diffFun(doc); - - if (!newDoc) { - // if the diffFun returns falsy, we short-circuit as - // an optimization - return { updated: false, rev: docRev, id: docId }; - } - - // users aren't allowed to modify these values, - // so reset them here - newDoc._id = docId; - newDoc._rev = docRev; - return PouchdbUpsert.tryAndPut(db, newDoc, diffFun); - }); - } - - private static tryAndPut(db, doc, diffFun) { - return db.put(doc).then((res) => { - return { - updated: true, - rev: res.rev, - id: doc._id - }; - }, (err) => { - /* istanbul ignore next */ - if (err.status !== 409) { - throw err; - } - return this.upsertInner(db, doc._id, diffFun); - }); - } -} diff --git a/frontend/src/lib/database/pouchdb_repository.spec.ts b/frontend/src/lib/database/pouchdb_repository.spec.ts deleted file mode 100644 index e717ebc6..00000000 --- a/frontend/src/lib/database/pouchdb_repository.spec.ts +++ /dev/null @@ -1,101 +0,0 @@ -import {IDatabaseRepository} from './interface'; -import {NewPouchdbRepositoryWebWorker} from './pouchdb_repository'; -import {SourceType} from '../models/database/source_types'; -import {Source} from '../models/database/source'; -import {DocType} from './constants'; -import * as PouchDB from 'pouchdb/dist/pouchdb'; -import { v4 as uuidv4 } from 'uuid'; -import {PouchdbCrypto} from './plugins/crypto'; - -describe('PouchdbRepository', () => { - let repository: IDatabaseRepository; - - beforeEach(async () => { - let current_user = uuidv4() as string - let cryptoConfig = await PouchdbCrypto.CryptConfig(current_user, current_user) - await PouchdbCrypto.StoreCryptConfig(cryptoConfig) - repository = NewPouchdbRepositoryWebWorker({current_user: current_user, auth_token: ""}, '/database', new PouchDB("PouchdbRepository" + current_user)); - }); - - afterEach(async () => { - if(repository){ - const db = await repository.GetDB() - db.destroy() //wipe the db. - } - }) - - - it('should be created', () => { - expect(repository).toBeTruthy(); - }); - - describe('CreateSource', () => { - it('should return an id', async () => { - const createdId = await repository.UpsertSource(new Source({ - patient: 'patient', - source_type: SourceType.Aetna, - })) - - expect(createdId.totalResources).toEqual(1); - expect(createdId.updatedResources[0]).toEqual("source:aetna:patient"); - }); - }) - - describe('GetSource', () => { - it('should return an source', async () => { - const createdResource = await repository.UpsertSource(new Source({ - patient: 'patient', - source_type: SourceType.Aetna, - access_token: 'hello-world', - })) - - const createdSource = await repository.GetSource(createdResource.updatedResources[0]) - - expect(createdSource.doc_type).toEqual(DocType.Source); - expect(createdSource.patient).toEqual('patient'); - expect(createdSource.source_type).toEqual(SourceType.Aetna); - expect(createdSource.access_token).toEqual('hello-world'); - }); - }) - - describe('DeleteSource', () => { - it('should delete a source', async () => { - const createdResource = await repository.UpsertSource(new Source({ - patient: 'patient-to-delete', - source_type: SourceType.Aetna, - access_token: 'hello-world', - })) - console.log(createdResource) - const deletedSource = await repository.DeleteSource(createdResource.updatedResources[0]) - - expect(deletedSource).toBeTruthy(); - }); - }) - - describe('GetSources', () => { - it('should return a list of sources', async () => { - await repository.UpsertSource(new Source({ - patient: 'patient1', - source_type: SourceType.Aetna, - access_token: 'hello-world1', - })) - - await repository.UpsertSource(new Source({ - patient: 'patient2', - source_type: SourceType.Aetna, - access_token: 'hello-world2', - })) - - await repository.UpsertSource(new Source({ - patient: 'patient3', - source_type: SourceType.Aetna, - access_token: 'hello-world3', - })) - - const sourcesWrapped = await repository.GetSources() - - expect(sourcesWrapped.total_rows).toEqual(3); - expect((sourcesWrapped.rows[0] as Source).patient).toEqual('patient1'); - }); - }) -}); diff --git a/frontend/src/lib/database/pouchdb_repository.ts b/frontend/src/lib/database/pouchdb_repository.ts deleted file mode 100644 index 6e575659..00000000 --- a/frontend/src/lib/database/pouchdb_repository.ts +++ /dev/null @@ -1,465 +0,0 @@ -import {Source} from '../models/database/source'; -import {IDatabasePaginatedResponse, IDatabaseDocument, IDatabaseRepository} from './interface'; -import {DocType} from './constants'; -import {ResourceFhir} from '../models/database/resource_fhir'; -import {ResourceTypeCounts, SourceSummary} from '../models/fasten/source-summary'; -import {Base64} from '../utils/base64'; -import {GetEndpointAbsolutePath} from '../utils/endpoint_absolute_path'; - -// PouchDB & plugins -import * as PouchDB from 'pouchdb/dist/pouchdb'; - -// import * as PouchCrypto from 'crypto-pouch'; -// PouchDB.plugin(PouchCrypto); - -import * as PouchTransform from 'transform-pouch'; -PouchDB.plugin(PouchTransform); - -import {PouchdbUpsert} from './plugins/upsert'; -import {UpsertSummary} from '../models/fasten/upsert-summary'; - -import {PouchdbCryptConfig, PouchdbCrypto, PouchdbCryptoOptions} from './plugins/crypto'; -import {utils} from 'protractor'; - -// !!!!!!!!!!!!!!!!WARNING!!!!!!!!!!!!!!!!!!!!! -// most pouchdb plugins seem to fail when used in a webworker. -// !!!!!!!!!!!!!!!!WARNING!!!!!!!!!!!!!!!!!!!!! -// import * as PouchUpsert from 'pouchdb-upsert'; -// PouchDB.plugin(PouchUpsert); -// import find from 'pouchdb-find'; -// PouchDB.plugin(find); -// PouchDB.debug.enable('pouchdb:find') - -// import * as rawUpsert from 'pouchdb-upsert'; -// const upsert: PouchDB.Plugin = (rawUpsert as any); -// PouchDB.plugin(upsert); - -// import {PouchdbUpsert} from './plugins/upsert'; -// const upsert = new PouchdbUpsert() -// console.log("typeof PouchdbUpsert",typeof upsert, upsert) -// PouchDB.plugin(upsert.default) - -// YOU MUST USE globalThis not window or self. -// YOU MUST NOT USE console.* as its not available in a webworker context - - -// this is required, otherwise PouchFind fails when looking for the global PouchDB variable - -/** - * This method is used to initialize the repository from Workers. - * Eventually this method should dyanmically dtermine the version of the repo to return from the env. - * @constructor - */ - -export function NewPouchdbRepositoryWebWorker(auth: {current_user: string, auth_token: string}, couchDbEndpointBase: string, localPouchDb?: PouchDB.Database): PouchdbRepository { - let pouchdbRepository = new PouchdbRepository(couchDbEndpointBase, localPouchDb) - pouchdbRepository.current_user = auth.current_user - pouchdbRepository._auth_token = auth.auth_token - return pouchdbRepository -} -export class PouchdbRepository implements IDatabaseRepository { - - // replicationHandler: any - remotePouchEndpoint: string // "http://localhost:5984" - pouchDb: PouchDB.Database - current_user: string - _auth_token: string - - //encryption configuration - cryptConfig: PouchdbCryptConfig = null - encryptionInitComplete: boolean = false - - // There are 3 different ways to initialize the Database - // - explicitly after signin/signup (not supported by this class, see FastenDbService) - // - explicitly during web-worker init - // - implicitly after Lighthouse redirect (not supported by this class, see FastenDbService) - // Three peices of information are required during intialization - // - couchdb endpoint (constant, see environment.couchdb_endpoint_base) - // - username - // - JWT token - constructor(couchDbEndpointBase: string, localPouchDb?: PouchDB.Database) { - // couchDbEndpointBase could be a relative or absolute path. - //if its absolute, we should pass it in, as-is - this.remotePouchEndpoint = GetEndpointAbsolutePath(globalThis.location, couchDbEndpointBase) - - - //setup PouchDB Plugins - //https://pouchdb.com/guides/mango-queries.html - this.pouchDb = null - - if(localPouchDb){ - console.warn("using local pouchdb, this should only be used for testing") - this.pouchDb = localPouchDb - } - } - - - // Teardown / deconfigure the existing database instance (if there is one). - // -- - // CAUTION: Subsequent calls to .GetDB() will fail until a new instance is configured - // with a call to .ConfigureForUser(). - public async Close(): Promise { - if (!this.pouchDb) { - return; - } - // Stop remote replication for existing database - // if(this.replicationHandler){ - // this.replicationHandler.cancel() - // } - - this.pouchDb.close(); - this.pouchDb = null; - return - } - - - /////////////////////////////////////////////////////////////////////////////////////// - // Source - - public async UpsertSource(source: Source): Promise { - return this.upsertDocument(source); - } - - public async GetSource(source_id: string): Promise { - return this.getDocument(source_id) - .then((doc) => { - return new Source(doc) - }) - } - - public async GetSources(): Promise { - return this.findDocumentByDocType(DocType.Source) - .then((docWrapper) => { - - docWrapper.rows = docWrapper.rows.map((result) => { - return new Source(result.doc) - }) - return docWrapper - }) - } - - public async GetSourceSummary(source_id: string): Promise { - const sourceSummary = new SourceSummary() - sourceSummary.source = await this.GetSource(source_id) - sourceSummary.patient = await this.findDocumentByPrefix(`${DocType.ResourceFhir}:${Base64.Encode(source_id)}:Patient`, true) - .then((paginatedResp) => new ResourceFhir(paginatedResp?.rows[0].doc)) - - sourceSummary.resource_type_counts = await this.findDocumentByPrefix(`${DocType.ResourceFhir}:${Base64.Encode(source_id)}`, false) - .then((paginatedResp) => { - const lookup: {[name: string]: ResourceTypeCounts} = {} - paginatedResp?.rows.forEach((resourceWrapper) => { - const resourceIdParts = resourceWrapper.id.split(':') - const resourceType = resourceIdParts[2] - - let currentResourceStats = lookup[resourceType] || { - count: 0, - source_id: Base64.Decode(resourceIdParts[1]), - resource_type: resourceType - } - currentResourceStats.count += 1 - lookup[resourceType] = currentResourceStats - }) - - const arr = [] - for(let key in lookup){ - arr.push(lookup[key]) - } - return arr - }) - return sourceSummary - } - - public async DeleteSource(source_id: string): Promise { - return this.deleteDocument(source_id) - } - - /////////////////////////////////////////////////////////////////////////////////////// - // Resource - - public async UpsertResource(resource: ResourceFhir): Promise { - return this.upsertDocument(resource); - } - - public async UpsertResources(resources: ResourceFhir[]): Promise { - return this.upsertBulk(resources); - } - - public async GetResource(resource_id: string): Promise { - return this.getDocument(resource_id) - .then((doc) => { - return new ResourceFhir(doc) - }) - } - - public async GetResources(): Promise { - return this.findDocumentByDocType(DocType.ResourceFhir) - .then((docWrapper) => { - - docWrapper.rows = docWrapper.rows.map((result) => { - return new ResourceFhir(result.doc) - }) - return docWrapper - }) - } - - public async GetResourcesForSource(source_id: string, source_resource_type?: string): Promise { - let prefix = `${DocType.ResourceFhir}:${Base64.Encode(source_id)}` - if(source_resource_type){ - prefix += `:${source_resource_type}` - } - - return this.findDocumentByPrefix(prefix, true) - .then((docWrapper) => { - - docWrapper.rows = docWrapper.rows.map((result) => { - return new ResourceFhir(result.doc) - }) - return docWrapper - }) - } - - /** - * given an raw connection to a database, determine how many records/resources are stored within - * @constructor - */ - public async IsDatabasePopulated(): Promise { - let resourceFhirCount = await this.findDocumentByPrefix(DocType.ResourceFhir, false, true) - .then((resp) => { - console.log("RESPONSE COUNT INFO", resp) - return resp.rows.length - }) - - if(resourceFhirCount > 0) {return true} - - - let sourceCount = await this.findDocumentByPrefix(DocType.Source, false, true) - .then((resp) => { - console.log("SOURCE COUNT INFO", resp) - - return resp.rows.length - }) - if(sourceCount > 0) {return true} - - return false - } - - - /////////////////////////////////////////////////////////////////////////////////////// - // CRUD Operators - // All functions below here will return the raw PouchDB responses, and may need to be wrapped in - // new ResourceFhir(result.doc) - /////////////////////////////////////////////////////////////////////////////////////// - public ResetDB(){ - this.pouchDb = null - this.encryptionInitComplete = false - } - // Get the active PouchDB instance. Throws an error if no PouchDB instance is - // available (ie, user has not yet been configured with call to .configureForUser()). - public async GetDB(skipEncryption: boolean = false): Promise { - await this.GetSessionDB() - - if(!this.pouchDb) { - throw(new Error( "Database is not available - please configure an instance." )); - } - - if(skipEncryption){ - //this allows the database to be queried, even when encryption has not been configured correctly - //this will only be used to take a count of documents in the database, so we can prompt the user for a encryption key, or generate a new one (for an empty db) - return this.pouchDb - } - - - //try to determine the crypto configuration using the currently logged in user. - this.cryptConfig = await PouchdbCrypto.RetrieveCryptConfig(this.current_user) - - if(!this.cryptConfig){ - throw new Error("crypto configuration not set.") - } - - if(!this.encryptionInitComplete){ - return PouchdbCrypto.crypto(this.pouchDb, this.cryptConfig, {ignore:[ - 'doc_type', - 'source_id', - 'source_resource_type', - 'source_resource_id', - ]}) - .then((encryptedPouchDb) => { - this.pouchDb = encryptedPouchDb - this.encryptionInitComplete = true - return this.pouchDb - }) - } else { - return this.pouchDb; - } - } - - - // update/insert a new document. Returns a promise of the generated id. - protected upsertDocument(newDoc: IDatabaseDocument) : Promise { - // make sure we always "populate" the ID for every document before submitting - newDoc.populateId() - - // NOTE: All friends are given the key-prefix of "friend:". This way, when we go - // to query for friends, we can limit the scope to keys with in this key-space. - - return this.GetDB() - .then((db) => { - return PouchdbUpsert.upsert(db, newDoc._id, (existingDoc: IDatabaseDocument) => { - //diffFunc - function that takes the existing doc as input and returns an updated doc. - // If this diffFunc returns falsey, then the update won't be performed (as an optimization). - // If the document does not already exist, then {} will be the input to diffFunc. - - const isExistingEmpty = Object.keys(existingDoc).length === 0 - if(isExistingEmpty){ - //always return new doc (and set update_at if not already set) - //if this is a ResourceFhir doc, see if theres a updatedDate already - if(newDoc.doc_type == DocType.ResourceFhir){ - newDoc.updated_at = newDoc.updated_at || (newDoc as any).meta?.updated_at - } - newDoc.updated_at = newDoc.updated_at || (new Date().toISOString()) - // console.log("merge, empty") - return newDoc - } - - if(newDoc.doc_type == DocType.ResourceFhir){ - - //for resourceFhir docs, we only care about comparing the resource_raw content - const existingContent = JSON.stringify((existingDoc as ResourceFhir).resource_raw) - const newContent = JSON.stringify((newDoc as ResourceFhir).resource_raw) - if(existingContent == newContent){ - return false //do not update - } else { - //theres a difference. Set the updated_at date if possible, otherwise use the current date - (newDoc as ResourceFhir).updated_at = (newDoc as any).meta?.updated_at || (new Date().toISOString()) - return newDoc - } - - } else if(newDoc.doc_type == DocType.Source){ - delete existingDoc._rev - const existingContent = JSON.stringify(existingDoc) - const newContent = JSON.stringify(newDoc) - if(existingContent == newContent){ - return false //do not update, content is the same for source object - } else { - //theres a difference. Set the updated_at date - (newDoc as Source).updated_at = (new Date().toISOString()) - return { ...existingDoc, ...newDoc }; - } - - - } else { - let errMsg = "unknown doc_type, cannot diff for upsert: " + newDoc.doc_type - console.error(errMsg) - throw new Error(errMsg) - } - }) - }) - .then(( result ): UpsertSummary => { - // // success, res is {rev: '1-xxx', updated: true, id: 'myDocId'} - const updateSummary = new UpsertSummary() - updateSummary.totalResources = 1 - - if(result.updated){ - updateSummary.updatedResources = [result.id] - } - return updateSummary; - }); - } - - protected async upsertBulk(docs: IDatabaseDocument[]): Promise { - //insert sequentially (not in parallel) - let finalUpsertSummary = new UpsertSummary() - - for (let doc of docs){ - doc.populateId(); - let upsertSummary = await this.upsertDocument(doc) - finalUpsertSummary.totalResources += upsertSummary.totalResources - finalUpsertSummary.updatedResources = finalUpsertSummary.updatedResources.concat(upsertSummary.updatedResources) - } - - return finalUpsertSummary - } - - protected getDocument(id: string): Promise { - return this.GetDB() - .then((db) => db.get(id)) - } - - - protected findDocumentByDocType(docType: DocType, includeDocs: boolean = true): Promise { - return this.findDocumentByPrefix(docType, includeDocs) - } - protected findDocumentByPrefix(prefix: string, includeDocs: boolean = true, skipEncryption: boolean = false): Promise { - return this.GetDB(skipEncryption) - .then((db) => { - return db.allDocs({ - include_docs: includeDocs, - startkey: `${prefix}:`, - endkey: `${prefix}:\uffff` - }) - }) - - } - - protected async deleteDocument(id: string): Promise { - const docToDelete = await this.getDocument(id) - return this.GetDB() - .then((db) => db.remove(docToDelete)) - .then((result) => { - return result.ok - }) - } - - /////////////////////////////////////////////////////////////////////////////////////// - // Sync private/protected methods - /////////////////////////////////////////////////////////////////////////////////////// - /** - * Try to get PouchDB database using session information - * This method is overridden in PouchDB Service, as session information is inaccessible in web-worker - * @constructor - */ - public async GetSessionDB(): Promise { - if(this.pouchDb){ - console.log("Session DB already exists..") - return this.pouchDb - } - - if(!this.current_user){ - throw new Error("current user is required when initializing pouchdb within web-worker") - } - if(!this._auth_token){ - throw new Error("auth token is required when initializing pouchdb within web-worker") - } - let auth_token = this._auth_token - - // add JWT bearer token header to all requests - // https://stackoverflow.com/questions/62129654/how-to-handle-jwt-authentication-with-rxdb - this.pouchDb = new PouchDB(this.getRemoteUserDb(this.current_user), { - skip_setup: true, - fetch: function (url, opts) { - opts.headers.set('Authorization', `Bearer ${auth_token}`) - return PouchDB.fetch(url, opts); - } - }) - return this.pouchDb - } - - protected getRemoteUserDb(username: string){ - return `${this.remotePouchEndpoint}/userdb-${this.toHex(username)}` - } - // protected enableSync(userIdentifier: string){ - // this.replicationHandler = this.localPouchDb.sync(this.getRemoteUserDb(userIdentifier), {live: true, retry: true}) - // return - // } - - - private toHex(s: string) { - // utf8 to latin1 - s = unescape(encodeURIComponent(s)) - let h = '' - for (let i = 0; i < s.length; i++) { - h += s.charCodeAt(i).toString(16) - } - return h - } -} diff --git a/frontend/src/lib/models/client/client-config.ts b/frontend/src/lib/models/client/client-config.ts deleted file mode 100644 index 53ad0d72..00000000 --- a/frontend/src/lib/models/client/client-config.ts +++ /dev/null @@ -1,6 +0,0 @@ -import {LighthouseSourceMetadata} from '../lighthouse/lighthouse-source-metadata'; -import {SourceType} from '../database/source_types'; - -export class ClientConfig { - fasten_api_endpoint_base: string -} diff --git a/frontend/src/lib/models/database/resource_fhir.ts b/frontend/src/lib/models/database/resource_fhir.ts deleted file mode 100644 index 5cc0eb94..00000000 --- a/frontend/src/lib/models/database/resource_fhir.ts +++ /dev/null @@ -1,36 +0,0 @@ -import {DocType} from '../../database/constants'; -import {IResourceRaw} from '../../conduit/interface'; -import {Base64} from '../../utils/base64'; - -export class ResourceFhir { - _id?: string - _rev?: string - doc_type: DocType = DocType.ResourceFhir - updated_at?: string - - fhir_version: string = "" - source_id: string = "" - source_resource_type: string = "" - source_resource_id: string = "" - - resource_raw?: IResourceRaw - - constructor(object?: any) { - if(object){ - object.doc_type = DocType.ResourceFhir - return Object.assign(this, object) - } else{ - this.doc_type = DocType.ResourceFhir - return this - } - } - - populateId(){ - //TODO: source_id should be base64 encoded (otherwise we get nested : chars) - this._id = `${this.doc_type}:${Base64.Encode(this.source_id)}:${this.source_resource_type}:${this.source_resource_id}` - } - base64Id(): string { - this.populateId() - return Base64.Encode(this._id) - } -} diff --git a/frontend/src/lib/models/database/source.ts b/frontend/src/lib/models/database/source.ts deleted file mode 100644 index 021a2d98..00000000 --- a/frontend/src/lib/models/database/source.ts +++ /dev/null @@ -1,32 +0,0 @@ -import {LighthouseSourceMetadata} from '../lighthouse/lighthouse-source-metadata'; -import {SourceType} from './source_types'; -import {DocType} from '../../../lib/database/constants'; -import {Base64} from '../../utils/base64'; - -export class Source extends LighthouseSourceMetadata{ - _id?: string - _rev?: string - doc_type: string - updated_at?: string - - source_type: SourceType - patient: string - access_token: string - refresh_token?: string - id_token?: string - expires_at: number //seconds since epoch - - constructor(object: any) { - super() - object.doc_type = DocType.Source - return Object.assign(this, object) - } - - populateId(){ - this._id = `${this.doc_type}:${this.source_type}:${this.patient}` - } - base64Id(): string { - this.populateId() - return Base64.Encode(this._id) - } -} diff --git a/frontend/src/lib/models/database/source_types.ts b/frontend/src/lib/models/database/source_types.ts deleted file mode 100644 index b92076df..00000000 --- a/frontend/src/lib/models/database/source_types.ts +++ /dev/null @@ -1,50 +0,0 @@ - - -export enum SourceType { - Manual = "manual", - - Athena = "athena", - HealthIT = "healthit", - Logica = "logica", - -//platforms - CareEvolution = "careevolution", - Cerner = "cerner", - Epic = "epic", - -//providers - Aetna = "aetna", - Amerigroup = "amerigroup", - AmerigroupMedicaid = "amerigroupmedicaid", - Anthem = "anthem", - AnthemBluecrossCA = "anthembluecrossca", - BlueButton = "bluebutton", - BluecrossBlueshieldKansasMedicare = "bcbskansasmedicare", - BluecrossBlueshieldKansas = "bcbskansas", - BluecrossBlueshieldNY = "bcbsny", - BlueMedicareAdvantage = "bluemedicareadvantage", - ClearHealthAlliance = "clearhealthalliance", - Cigna = "cigna", - DellChildrens = "dellchildrens", - EmpireBlue = "empireblue", - EmpireBlueMedicaid = "empirebluemedicaid", - HealthyBlueLA = "healthybluela", - HealthyBlueLAMedicaid = "healthybluelamedicaid", - HealthyBlueMO = "healthybluemo", - HealthyBlueMOMedicaid = "healthybluemomedicaid", - HealthyBlueNC = "healthybluenc", - HealthyBlueNCMedicaid = "healthybluencmedicaid", - HealthyBlueNE = "healthybluene", - HealthyBlueSC = "healthybluesc", - HighmarkWesternNY = "highmarkwesternny", - SimplyHealthcareMedicaid = "simplyhealthcaremedicaid", - SimplyHealthcareMedicare = "simplyhealthcaremedicare", - SummitCommunityCare = "summitcommunitycare", - UCSF = "ucsf-health", - Unicare = "unicare", - UnicareMA = "unicarema", - UnicareMedicaid = "unicaremedicaid", - Humana = "humana", - Kaiser = "kaiser", - UnitedHealthcare = "unitedhealthcare", -} diff --git a/frontend/src/lib/models/fasten/upsert-summary.ts b/frontend/src/lib/models/fasten/upsert-summary.ts deleted file mode 100644 index e37600fa..00000000 --- a/frontend/src/lib/models/fasten/upsert-summary.ts +++ /dev/null @@ -1,8 +0,0 @@ -import {Source} from '../database/source'; -import {ResourceFhir} from '../database/resource_fhir'; -import {ResourceTypeCounts} from './source-summary'; - -export class UpsertSummary { - updatedResources: string[] = [] - totalResources: number = 0 -} diff --git a/frontend/src/lib/models/lighthouse/authorize-claim.spec.ts b/frontend/src/lib/models/lighthouse/authorize-claim.spec.ts deleted file mode 100644 index 619e5cf2..00000000 --- a/frontend/src/lib/models/lighthouse/authorize-claim.spec.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { AuthorizeClaim } from './authorize-claim'; - -describe('AuthorizeClaim', () => { - it('should create an instance', () => { - expect(new AuthorizeClaim()).toBeTruthy(); - }); -}); diff --git a/frontend/src/lib/models/lighthouse/authorize-claim.ts b/frontend/src/lib/models/lighthouse/authorize-claim.ts deleted file mode 100644 index ffcde007..00000000 --- a/frontend/src/lib/models/lighthouse/authorize-claim.ts +++ /dev/null @@ -1,12 +0,0 @@ -export class AuthorizeClaim { - source_type: string - state: string - code?: string - ttl?: number - - access_token?: string - refresh_token?: string - id_token?: string - patient_id?: string - expires_at?: number -} diff --git a/frontend/src/lib/utils/base64.ts b/frontend/src/lib/utils/base64.ts index 92a2a62f..ffa0882c 100644 --- a/frontend/src/lib/utils/base64.ts +++ b/frontend/src/lib/utils/base64.ts @@ -1,12 +1,8 @@ export class Base64 { public static Encode(data: string): string { - return `b64.${btoa(data)}` + return btoa(data) } public static Decode(data: string): string { - const parts = data.split(".") - if(parts.length != 2){ - throw new Error(`invalid base64 encoded string: ${data}`) - } - return atob(parts[1]) + return atob(data) } } diff --git a/frontend/tsconfig.worker.json b/frontend/tsconfig.worker.json deleted file mode 100644 index 86d5c611..00000000 --- a/frontend/tsconfig.worker.json +++ /dev/null @@ -1,18 +0,0 @@ -/* To learn more about this file see: https://angular.io/config/tsconfig. */ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - //customizations - "skipLibCheck": true, //without this the "dom" and the "webworker" libs conflict - - "outDir": "./out-tsc/worker", - "lib": [ - "es2020", - "webworker", - ], - "types": [] - }, - "include": [ - "src/**/*.worker.ts" - ], -} diff --git a/go.mod b/go.mod index 0c76c6c2..5b2dbc6e 100644 --- a/go.mod +++ b/go.mod @@ -4,39 +4,52 @@ go 1.18 require ( github.com/analogj/go-util v0.0.0-20210417161720-39b497cca03b + github.com/fastenhealth/fasten-sources v0.0.3 github.com/gin-gonic/gin v1.8.1 - github.com/go-kivik/couchdb/v3 v3.3.0 - github.com/go-kivik/kivik/v3 v3.2.3 + github.com/glebarez/sqlite v1.5.0 github.com/golang-jwt/jwt/v4 v4.4.2 - github.com/golang/mock v1.4.4 + github.com/golang/mock v1.6.0 + github.com/google/uuid v1.3.0 github.com/sirupsen/logrus v1.9.0 github.com/spf13/viper v1.12.0 github.com/urfave/cli/v2 v2.11.2 + golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 + gorm.io/datatypes v1.0.7 + gorm.io/gorm v1.24.1 ) require ( github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/fastenhealth/gofhir-models v0.0.4 // indirect github.com/fatih/color v1.13.0 // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/gin-contrib/sse v0.1.0 // indirect + github.com/glebarez/go-sqlite v1.19.1 // indirect github.com/go-playground/locales v0.14.0 // indirect github.com/go-playground/universal-translator v0.18.0 // indirect github.com/go-playground/validator/v10 v10.10.0 // indirect + github.com/go-sql-driver/mysql v1.6.0 // indirect github.com/goccy/go-json v0.9.7 // indirect + github.com/golang/protobuf v1.5.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kvz/logstreamer v0.0.0-20150507115422-a635b98146f0 // indirect github.com/leodido/go-urn v1.2.1 // indirect github.com/magiconair/properties v1.8.6 // indirect github.com/mattn/go-colorable v0.1.12 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect + github.com/mattn/go-isatty v0.0.16 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.0.1 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/samber/lo v1.35.0 // indirect + github.com/seborama/govcr v4.5.0+incompatible // indirect github.com/spf13/afero v1.8.2 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect @@ -44,14 +57,22 @@ 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/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect - golang.org/x/net v0.0.0-20221004154528-8021a29435af // indirect - golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect - golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect - golang.org/x/text v0.3.7 // indirect - golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect + golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 // 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 + golang.org/x/text v0.4.0 // indirect + google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.0 // indirect gopkg.in/ini.v1 v1.66.4 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + gorm.io/driver/mysql v1.3.2 // indirect + modernc.org/libc v1.19.0 // indirect + modernc.org/mathutil v1.5.0 // indirect + modernc.org/memory v1.4.0 // indirect + modernc.org/sqlite v1.19.1 // indirect ) + +//replace github.com/fastenhealth/fasten-sources => ../fasten-sources diff --git a/go.sum b/go.sum index 5d74b49a..cda78cce 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,3 @@ -bou.ke/monkey v1.0.1/go.mod h1:FgHuK96Rv2Nlf+0u1OOVDpCMdsWyOFmeeketDHE7LIg= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -37,9 +36,11 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbLiiGY6sx7f9i+X3m1CHdd5c6Rdw= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJcghJGOYCgdezslRSVzqwLf/q+4Y2r/0= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2TzfVZ1pCb5vxm4BtZPUdYWe/Xo8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/analogj/go-util v0.0.0-20210417161720-39b497cca03b h1:Y/+MfmdKPPpVY7C6ggt/FpltFSitlpUtyJEdcQyFXQg= github.com/analogj/go-util v0.0.0-20210417161720-39b497cca03b/go.mod h1:bRSzJXgXnT5+Ihah7RSC7Cvp16UmoLn3wq6ROciS1Ow= @@ -51,23 +52,33 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/denisenkom/go-mssqldb v0.12.0 h1:VtrkII767ttSPNRfFekePK3sctr+joXgO58stqQbtUA= +github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= 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.3 h1:g07Lk59hiOWO2PhJoaP7eC0OIeIsxE50e6wH6sW96J4= +github.com/fastenhealth/fasten-sources v0.0.3/go.mod h1:f6N8wLHEPXbz1QvI+JDQzIz9u1xu0Lp/j0LxYFHkpBM= +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= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/flimzy/diff v0.1.5/go.mod h1:lFJtC7SPsK0EroDmGTSrdtWKAxOk3rO+q+e04LL05Hs= -github.com/flimzy/testy v0.1.17-0.20190521133342-95b386c3ece6/go.mod h1:3szguN8NXqgq9bt9Gu8TQVj698PJWmyx/VY1frwwKrM= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= @@ -75,17 +86,15 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= +github.com/glebarez/go-sqlite v1.19.1 h1:o2XhjyR8CQ2m84+bVz10G0cabmG0tY4sIMiCbrcUTrY= +github.com/glebarez/go-sqlite v1.19.1/go.mod h1:9AykawGIyIcxoSfpYWiX1SgTNHTNsa/FVc75cDkbp4M= +github.com/glebarez/sqlite v1.5.0 h1:+8LAEpmywqresSoGlqjjT+I9m4PseIM3NcerIJ/V7mk= +github.com/glebarez/sqlite v1.5.0/go.mod h1:0wzXzTvfVJIN2GqRhCdMbnYd+m+aH5/QV7B30rM6NgY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kivik/couchdb/v3 v3.3.0 h1:xipDIw66Sqei550OzSXWlLmJ9y01fMbBLkX0F/snjnw= -github.com/go-kivik/couchdb/v3 v3.3.0/go.mod h1:idTUN/G5HGE+YP2EgW+dvZ5ODkdhvddcU7ZzFZfwN6Q= -github.com/go-kivik/kivik/v3 v3.0.1/go.mod h1:7tmQDvkta/pcijpUjLMsQ9HJUELiKD5zm6jQ3Gb9cxE= -github.com/go-kivik/kivik/v3 v3.2.0/go.mod h1:chqVuHKAU9j2C7qL0cAH2FCO26oL+0B4aIBeCRMnLa8= -github.com/go-kivik/kivik/v3 v3.2.3 h1:ZFGR3hMDa+AUmPUCQxq4da3+3C4awdFQwdOtjLS+MxM= -github.com/go-kivik/kivik/v3 v3.2.3/go.mod h1:chqVuHKAU9j2C7qL0cAH2FCO26oL+0B4aIBeCRMnLa8= -github.com/go-kivik/kiviktest/v3 v3.0.4 h1:mHX/9gpz5VdSOOOs7sN0/6iLK6jQcLiYbteEd33cKNo= -github.com/go-kivik/kiviktest/v3 v3.0.4/go.mod h1:sqsz3M2sJxTxAUdOj+2SU21y4phcpYc0FJIn+hbf1D0= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= @@ -94,10 +103,19 @@ github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/j github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.10.0 h1:I7mrTYv78z8k8VXa/qJlOlEXn/nBh+BF8dHX5nt/dr0= github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= +github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA= +github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188 h1:+eHOFJl1BaXrQxKX+T06f78590z4qA2ZzBTqahsKSE4= +github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -108,8 +126,9 @@ github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFU github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -125,6 +144,8 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -135,6 +156,7 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= @@ -154,29 +176,85 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/gopherjs/gopherjs v0.0.0-20180825215210-0210a2f0f73c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 h1:l5lAOZEym3oK3SQ2HBHWsJUfbNBiTXJDeW2QDxw9AQ0= -github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= +github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= +github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= +github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= +github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= +github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= +github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= +github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= +github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.11.0 h1:HiHArx4yFbwl91X3qqIHtUFoiIfLNJXCQRsnzkiwwaQ= +github.com/jackc/pgconn v1.11.0/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= +github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= +github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= +github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A= +github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= +github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.2.0 h1:r7JypeP2D3onoQTCxWdTpCtJ4D+qpKr0TxvoyMhZ5ns= +github.com/jackc/pgproto3/v2 v2.2.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= +github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= +github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= +github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= +github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= +github.com/jackc/pgtype v1.10.0 h1:ILnBWrRMSXGczYvmkYD6PsYyVFUNLTnIUJHHDLmqk38= +github.com/jackc/pgtype v1.10.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= +github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= +github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= +github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= +github.com/jackc/pgx/v4 v4.15.0 h1:B7dTkXsdILD3MF987WGGCcg+tvLW6bZJdEcqVFeU//w= +github.com/jackc/pgx/v4 v4.15.0/go.mod h1:D/zyOyXiaM1TmVWnOM18p0xdDtdakRBa0RsVGI3U3bw= +github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.2.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= +github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= @@ -184,16 +262,29 @@ github.com/kvz/logstreamer v0.0.0-20150507115422-a635b98146f0 h1:3tLzEnUizyN9YLW github.com/kvz/logstreamer v0.0.0-20150507115422-a635b98146f0/go.mod h1:8/LTPeDLaklcUjgSQBHbhBF1ibKAFxzS5o+H7USfMSA= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.6/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/mattn/go-sqlite3 v1.14.15 h1:vfoHhTN1af61xCRSWzFIWzx2YskyMTwHLrExkBOjvxI= +github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= @@ -203,33 +294,39 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/otiai10/copy v1.0.2/go.mod h1:c7RpqBkwMom4bYTSkLSym4VSJz/XtncWRAj/J4PEIMY= -github.com/otiai10/copy v1.7.0 h1:hVoPiN+t+7d2nzzwMiDHPSOogsWAStewq3TwU05+clE= -github.com/otiai10/copy v1.7.0/go.mod h1:rmRl6QPdJj6EiUqXQ/4Nn2lLXoNQjFCQbbNrxgc/t3U= -github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= -github.com/otiai10/curr v0.0.0-20190513014714-f5a3d24e5776/go.mod h1:3HNVkVOU7vZeFXocWuvtcS0XSFLcf2XUSDHkq9t1jU4= -github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= -github.com/otiai10/mint v1.2.4/go.mod h1:d+b7n/0R3tdyUYYylALXpWQ/kTN+QobSq/4SRGBkR3M= -github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= -github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= +github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= +github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= +github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/samber/lo v1.35.0 h1:GlT8CV1GE+v97Y7MLF1wXvX6mjoxZ+hi61tj/ZcQwY0= +github.com/samber/lo v1.35.0/go.mod h1:HLeWcJRRyLKp3+/XBJvOrerCQn9mhdKMHyd7IRlgeQ8= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/seborama/govcr v4.5.0+incompatible h1:XvdHtXi0d4cUAn+0aWolvwfS3nmhNC8Z+yMQwn/M64I= +github.com/seborama/govcr v4.5.0+incompatible/go.mod h1:EgcISudCCYDLzbiAImJ8i7kk4+wTA44Kp+j4S0LhASI= +github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= @@ -243,16 +340,19 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/subosito/gotenv v1.3.0 h1:mjC+YW8QpAdXibNi+vNWgzmgBH4+5l5dCXv8cNysBLI= github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= +github.com/thoas/go-funk v0.9.1 h1:O549iLZqPpTUQ10ykd26sZhzD+rmR5pWhuElrhbC20M= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= @@ -264,24 +364,41 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -gitlab.com/flimzy/testy v0.0.3/go.mod h1:YObF4cq711ubd/3U0ydRQQVz7Cnq/ChgJpVwNr/AJac= -gitlab.com/flimzy/testy v0.9.1 h1:c255KNz+9lqkMAmC4TYngLP1mOkBJ30KziNgz9r7apk= -gitlab.com/flimzy/testy v0.9.1/go.mod h1:4Yy2aelUY6IgRmd3jHgGWewZLNMQZWQTlwyuMW642Mc= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -294,6 +411,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 h1:3MTrJm4PyNL9NBqvYDSj3DHl46qQakyfqfWo4jgfaEM= +golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -317,6 +436,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -329,6 +449,7 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -345,12 +466,14 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20221004154528-8021a29435af h1:wv66FM3rLZGPdxpYL+ApnDe2HzHcTFta3z5nsc13wI4= -golang.org/x/net v0.0.0-20221004154528-8021a29435af/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -360,6 +483,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.2.0 h1:GtQkldQ9m7yvzCL1V+LrYow3Khe0eJH0w7RbX/VbaIU= +golang.org/x/oauth2 v0.2.0/go.mod h1:Cwn6afJ8jrQwYMxQDTpISoXmXW9I6qF6vDeuuoX3Ibs= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -370,18 +495,24 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -405,18 +536,24 @@ golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -424,8 +561,9 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -436,14 +574,18 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -451,6 +593,7 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -471,17 +614,19 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -507,6 +652,7 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -571,6 +717,7 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -578,15 +725,32 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4= gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gorm.io/datatypes v1.0.7 h1:8NhJN4+annFjwV1WufDhFiPjdUvV1lSGUdg1UCjQIWY= +gorm.io/datatypes v1.0.7/go.mod h1:l9qkCuy0CdzDEop9HKUdcnC9gHC2sRlaFtHkTzsZRqg= +gorm.io/driver/mysql v1.3.2 h1:QJryWiqQ91EvZ0jZL48NOpdlPdMjdip1hQ8bTgo4H7I= +gorm.io/driver/mysql v1.3.2/go.mod h1:ChK6AHbHgDCFZyJp0F+BmVGb06PSIoh9uVYKAlRbb2U= +gorm.io/driver/postgres v1.3.4 h1:evZ7plF+Bp+Lr1mO5NdPvd6M/N98XtwHixGB+y7fdEQ= +gorm.io/driver/postgres v1.3.4/go.mod h1:y0vEuInFKJtijuSGu9e5bs5hzzSzPK+LancpKpvbRBw= +gorm.io/driver/sqlite v1.3.1 h1:bwfE+zTEWklBYoEodIOIBwuWHpnx52Z9zJFW5F33WLk= +gorm.io/driver/sqlite v1.3.1/go.mod h1:wJx0hJspfycZ6myN38x1O/AqLtNS6c5o9TndewFbELg= +gorm.io/driver/sqlserver v1.3.1 h1:F5t6ScMzOgy1zukRTIZgLZwKahgt3q1woAILVolKpOI= +gorm.io/driver/sqlserver v1.3.1/go.mod h1:w25Vrx2BG+CJNUu/xKbFhaKlGxT/nzRkhWCCoptX8tQ= +gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/gorm v1.23.6/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/gorm v1.24.0/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= +gorm.io/gorm v1.24.1 h1:CgvzRniUdG67hBAzsxDGOAuq4Te1osVMYsa1eQbd4fs= +gorm.io/gorm v1.24.1/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -594,6 +758,38 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +modernc.org/cc/v3 v3.36.2/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.37.0/go.mod h1:vtL+3mdHx/wcj3iEGz84rQa8vEqR6XM84v5Lcvfph20= +modernc.org/cc/v3 v3.38.1/go.mod h1:vtL+3mdHx/wcj3iEGz84rQa8vEqR6XM84v5Lcvfph20= +modernc.org/ccgo/v3 v3.0.0-20220904174949-82d86e1b6d56/go.mod h1:YSXjPL62P2AMSxBphRHPn7IkzhVHqkvOnRKAKh+W6ZI= +modernc.org/ccgo/v3 v3.0.0-20220910160915-348f15de615a/go.mod h1:8p47QxPkdugex9J4n9P2tLZ9bK01yngIVp00g4nomW0= +modernc.org/ccgo/v3 v3.16.9/go.mod h1:zNMzC9A9xeNUepy6KuZBbugn3c0Mc9TeiJO4lgvkJDo= +modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= +modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= +modernc.org/libc v1.17.0/go.mod h1:XsgLldpP4aWlPlsjqKRdHPqCxCjISdHfM/yeWC5GyW0= +modernc.org/libc v1.17.4/go.mod h1:WNg2ZH56rDEwdropAJeZPQkXmDwh+JCA1s/htl6r2fA= +modernc.org/libc v1.18.0/go.mod h1:vj6zehR5bfc98ipowQOM2nIDUZnVew/wNC/2tOGS+q0= +modernc.org/libc v1.19.0 h1:bXyVhGQg6KIClTr8FMVIDPl7jtbcs7aS5WP7vLDaxPs= +modernc.org/libc v1.19.0/go.mod h1:ZRfIaEkgrYgZDl6pa4W39HgN5G/yDW+NRmNKZBDFrk0= +modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.2.0/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/memory v1.3.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/memory v1.4.0 h1:crykUfNSnMAXaOJnnxcSzbUGMqkLWjklJKkBK2nwZwk= +modernc.org/memory v1.4.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sqlite v1.19.1 h1:8xmS5oLnZtAK//vnd4aTVj8VOeTAccEFOtUnIzfSw+4= +modernc.org/sqlite v1.19.1/go.mod h1:UfQ83woKMaPW/ZBruK0T7YaFCrI+IE0LeWVY6pmnVms= +modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= +modernc.org/tcl v1.14.0/go.mod h1:gQ7c1YPMvryCHCcmf8acB6VPabE59QBeuRQLL7cTUlM= +modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/z v1.6.0/go.mod h1:hVdgNMh8ggTuRG1rGU8x+xGRFfiQUIAw0ZqlPy8+HyQ= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=