From 3fe72918fdc547e0a5ab33339f1225624811325e Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Wed, 23 Aug 2023 12:24:08 -0700 Subject: [PATCH] adding ability to count by wildcard (source_resource_type). internal fields like `id`, `source_id`, `source_resource_id` and `source_resource_type` are now queryable via keyword type. --- .../pkg/database/sqlite_repository_query.go | 16 ++- .../sqlite_repository_query_sql_test.go | 107 ++++++++++++++++++ .../database/sqlite_repository_query_test.go | 6 + backend/pkg/models/database/fhir_account.go | 29 +++-- .../pkg/models/database/fhir_adverse_event.go | 41 ++++--- .../database/fhir_allergy_intolerance.go | 45 ++++---- .../pkg/models/database/fhir_appointment.go | 49 ++++---- backend/pkg/models/database/fhir_binary.go | 17 ++- backend/pkg/models/database/fhir_care_plan.go | 5 + backend/pkg/models/database/fhir_care_team.go | 31 ++--- backend/pkg/models/database/fhir_claim.go | 49 ++++---- .../models/database/fhir_claim_response.go | 37 +++--- .../pkg/models/database/fhir_composition.go | 49 ++++---- backend/pkg/models/database/fhir_condition.go | 57 +++++----- backend/pkg/models/database/fhir_consent.go | 45 ++++---- backend/pkg/models/database/fhir_coverage.go | 35 +++--- .../fhir_coverage_eligibility_request.go | 29 +++-- .../fhir_coverage_eligibility_response.go | 33 +++--- backend/pkg/models/database/fhir_device.go | 37 +++--- .../models/database/fhir_device_request.go | 5 + .../models/database/fhir_diagnostic_report.go | 47 ++++---- .../models/database/fhir_document_manifest.go | 39 ++++--- .../database/fhir_document_reference.go | 59 +++++----- backend/pkg/models/database/fhir_encounter.go | 59 +++++----- backend/pkg/models/database/fhir_endpoint.go | 29 +++-- .../database/fhir_enrollment_request.go | 23 ++-- .../database/fhir_enrollment_response.go | 23 ++-- .../database/fhir_explanation_of_benefit.go | 49 ++++---- .../database/fhir_family_member_history.go | 5 + backend/pkg/models/database/fhir_goal.go | 31 ++--- .../pkg/models/database/fhir_imaging_study.go | 49 ++++---- .../pkg/models/database/fhir_immunization.go | 47 ++++---- .../models/database/fhir_insurance_plan.go | 43 +++---- backend/pkg/models/database/fhir_location.go | 43 +++---- backend/pkg/models/database/fhir_media.go | 39 ++++--- .../pkg/models/database/fhir_medication.go | 35 +++--- .../fhir_medication_administration.go | 41 ++++--- .../database/fhir_medication_dispense.go | 43 +++---- .../database/fhir_medication_request.go | 5 + .../database/fhir_medication_statement.go | 37 +++--- .../models/database/fhir_nutrition_order.go | 5 + .../pkg/models/database/fhir_observation.go | 5 + .../pkg/models/database/fhir_organization.go | 41 ++++--- .../database/fhir_organization_affiliation.go | 5 + backend/pkg/models/database/fhir_patient.go | 61 +++++----- backend/pkg/models/database/fhir_person.go | 53 +++++---- .../pkg/models/database/fhir_practitioner.go | 51 +++++---- .../models/database/fhir_practitioner_role.go | 43 +++---- backend/pkg/models/database/fhir_procedure.go | 5 + .../pkg/models/database/fhir_provenance.go | 35 +++--- .../pkg/models/database/fhir_questionnaire.go | 51 +++++---- .../database/fhir_questionnaire_response.go | 37 +++--- .../models/database/fhir_related_person.go | 49 ++++---- backend/pkg/models/database/fhir_schedule.go | 31 ++--- .../models/database/fhir_service_request.go | 5 + backend/pkg/models/database/fhir_slot.go | 33 +++--- backend/pkg/models/database/fhir_specimen.go | 37 +++--- .../database/fhir_vision_prescription.go | 27 +++-- backend/pkg/models/database/generate.go | 7 ++ .../pkg/web/handler/dashboard/default.json | 12 +- .../app/pipes/dataset-latest-entry.pipe.ts | 64 +++++++---- .../dual-gauges-widget.component.html | 2 +- .../dual-gauges-widget.component.ts | 3 +- 63 files changed, 1277 insertions(+), 853 deletions(-) diff --git a/backend/pkg/database/sqlite_repository_query.go b/backend/pkg/database/sqlite_repository_query.go index 84238418..b524286e 100644 --- a/backend/pkg/database/sqlite_repository_query.go +++ b/backend/pkg/database/sqlite_repository_query.go @@ -27,6 +27,9 @@ const ( SearchParameterTypeQuantity SearchParameterType = "quantity" SearchParameterTypeComposite SearchParameterType = "composite" SearchParameterTypeSpecial SearchParameterType = "special" + + SearchParameterTypeKeyword SearchParameterType = "keyword" //this is a literal/string primitive. + ) const TABLE_ALIAS = "fhir" @@ -148,6 +151,12 @@ func (sr *SqliteRepository) sqlQueryResources(ctx context.Context, query models. //populate the group by and order by clause with the count by values query.Aggregations.OrderBy = "count(*) DESC" query.Aggregations.GroupBy = query.Aggregations.CountBy + + if query.Aggregations.GroupBy == "*" { + //we need to get the count of all resources, so we need to remove the group by clause and replace it by + // `source_resource_type` which will be the same for all resources + query.Aggregations.GroupBy = "source_resource_type" + } } //process order by clause @@ -322,7 +331,7 @@ func ProcessSearchParameterValue(searchParameter SearchParameter, searchValueWit SecondaryValues: map[string]interface{}{}, Value: searchValueWithPrefix, } - if (searchParameter.Type == SearchParameterTypeString || searchParameter.Type == SearchParameterTypeUri) && len(searchParameterValue.Value.(string)) == 0 { + if (searchParameter.Type == SearchParameterTypeString || searchParameter.Type == SearchParameterTypeUri || searchParameter.Type == SearchParameterTypeKeyword) && len(searchParameterValue.Value.(string)) == 0 { return searchParameterValue, fmt.Errorf("invalid search parameter value: (%s=%s)", searchParameter.Name, searchParameterValue.Value) } @@ -533,6 +542,9 @@ func SearchCodeToWhereClause(searchParam SearchParameter, searchParamValue Searc } return fmt.Sprintf("(%s)", clause), searchClauseNamedParams, nil + case SearchParameterTypeKeyword: + //setup the clause + return fmt.Sprintf("(%s = @%s)", searchParam.Name, NamedParameterWithSuffix(searchParam.Name, namedParameterSuffix)), searchClauseNamedParams, nil case SearchParameterTypeReference: return "", nil, fmt.Errorf("search parameter type %s not supported", searchParam.Type) } @@ -593,7 +605,7 @@ func ProcessAggregationParameter(aggregationFieldWithProperty string, searchPara } //primitive types should not have a modifier, we need to throw an error - if aggregationParameter.Type == SearchParameterTypeNumber || aggregationParameter.Type == SearchParameterTypeUri { + if aggregationParameter.Type == SearchParameterTypeNumber || aggregationParameter.Type == SearchParameterTypeUri || aggregationParameter.Type == SearchParameterTypeKeyword { if len(aggregationParameter.Modifier) > 0 { return aggregationParameter, fmt.Errorf("primitive aggregation parameter %s cannot have a property (%s)", aggregationParameter.Name, aggregationParameter.Modifier) } diff --git a/backend/pkg/database/sqlite_repository_query_sql_test.go b/backend/pkg/database/sqlite_repository_query_sql_test.go index 743a802b..348e4567 100644 --- a/backend/pkg/database/sqlite_repository_query_sql_test.go +++ b/backend/pkg/database/sqlite_repository_query_sql_test.go @@ -180,6 +180,41 @@ func (suite *RepositorySqlTestSuite) TestQueryResources_SQL_WithPrimitiveOrderBy }) } +func (suite *RepositorySqlTestSuite) TestQueryResources_SQL_WithKeywordOrderByAggregation() { + //setup + sqliteRepo := suite.TestRepository.(*SqliteRepository) + sqliteRepo.GormClient = sqliteRepo.GormClient.Session(&gorm.Session{DryRun: true}) + + //test + authContext := context.WithValue(context.Background(), pkg.ContextKeyTypeAuthUsername, "test_username") + + sqlQuery, err := sqliteRepo.sqlQueryResources(authContext, models.QueryResource{ + Select: []string{}, + Where: map[string]interface{}{}, + From: "CarePlan", + Aggregations: &models.QueryResourceAggregations{OrderBy: "id"}, + }) + require.NoError(suite.T(), err) + var results []map[string]interface{} + statement := sqlQuery.Find(&results).Statement + sqlString := statement.SQL.String() + sqlParams := statement.Vars + + //assert + require.NoError(suite.T(), err) + require.Equal(suite.T(), + strings.Join([]string{ + "SELECT fhir.*", + "FROM fhir_care_plan as fhir", + "WHERE (user_id = ?)", + "GROUP BY `fhir`.`id`", + "ORDER BY fhir.id ASC", + }, " "), sqlString) + require.Equal(suite.T(), sqlParams, []interface{}{ + "00000000-0000-0000-0000-000000000000", + }) +} + func (suite *RepositorySqlTestSuite) TestQueryResources_SQL_WithComplexOrderByAggregation() { //setup sqliteRepo := suite.TestRepository.(*SqliteRepository) @@ -254,6 +289,78 @@ func (suite *RepositorySqlTestSuite) TestQueryResources_SQL_WithPrimitiveCountBy }) } +func (suite *RepositorySqlTestSuite) TestQueryResources_SQL_WithKeywordCountByAggregation() { + //setup + sqliteRepo := suite.TestRepository.(*SqliteRepository) + sqliteRepo.GormClient = sqliteRepo.GormClient.Session(&gorm.Session{DryRun: true}) + + //test + authContext := context.WithValue(context.Background(), pkg.ContextKeyTypeAuthUsername, "test_username") + + sqlQuery, err := sqliteRepo.sqlQueryResources(authContext, models.QueryResource{ + Select: []string{}, + Where: map[string]interface{}{ + "activityCode": "test_code", + }, + From: "CarePlan", + Aggregations: &models.QueryResourceAggregations{CountBy: "source_resource_type"}, + }) + require.NoError(suite.T(), err) + var results []map[string]interface{} + statement := sqlQuery.Find(&results).Statement + sqlString := statement.SQL.String() + sqlParams := statement.Vars + + //assert + require.NoError(suite.T(), err) + require.Equal(suite.T(), + strings.Join([]string{ + "SELECT fhir.source_resource_type as label, count(*) as value", + "FROM fhir_care_plan as fhir, json_each(fhir.activityCode) as activityCodeJson", + "WHERE ((activityCodeJson.value ->> '$.code' = ?)) AND (user_id = ?)", + "GROUP BY `fhir`.`source_resource_type`", + "ORDER BY count(*) DESC", + }, " "), sqlString) + require.Equal(suite.T(), sqlParams, []interface{}{ + "test_code", "00000000-0000-0000-0000-000000000000", + }) +} + +func (suite *RepositorySqlTestSuite) TestQueryResources_SQL_WithWildcardCountByAggregation() { + //setup + sqliteRepo := suite.TestRepository.(*SqliteRepository) + sqliteRepo.GormClient = sqliteRepo.GormClient.Session(&gorm.Session{DryRun: true}) + + //test + authContext := context.WithValue(context.Background(), pkg.ContextKeyTypeAuthUsername, "test_username") + + sqlQuery, err := sqliteRepo.sqlQueryResources(authContext, models.QueryResource{ + Select: []string{}, + Where: map[string]interface{}{}, + From: "CarePlan", + Aggregations: &models.QueryResourceAggregations{CountBy: "*"}, + }) + require.NoError(suite.T(), err) + var results []map[string]interface{} + statement := sqlQuery.Find(&results).Statement + sqlString := statement.SQL.String() + sqlParams := statement.Vars + + //assert + require.NoError(suite.T(), err) + require.Equal(suite.T(), + strings.Join([]string{ + "SELECT fhir.source_resource_type as label, count(*) as value", + "FROM fhir_care_plan as fhir", + "WHERE (user_id = ?)", + "GROUP BY `fhir`.`source_resource_type`", + "ORDER BY count(*) DESC", + }, " "), sqlString) + require.Equal(suite.T(), sqlParams, []interface{}{ + "00000000-0000-0000-0000-000000000000", + }) +} + func (suite *RepositorySqlTestSuite) TestQueryResources_SQL_WithComplexCountByAggregation() { //setup sqliteRepo := suite.TestRepository.(*SqliteRepository) diff --git a/backend/pkg/database/sqlite_repository_query_test.go b/backend/pkg/database/sqlite_repository_query_test.go index 9da213f3..21fdbdef 100644 --- a/backend/pkg/database/sqlite_repository_query_test.go +++ b/backend/pkg/database/sqlite_repository_query_test.go @@ -28,6 +28,7 @@ func TestProcessSearchParameter(t *testing.T) { {"unknown:doesntmatter", map[string]string{"test": "string"}, SearchParameter{}, true}, //unknown search parameter shoudl throw error {"unknown", map[string]string{"test": "string"}, SearchParameter{}, true}, //unknown search parameter shoudl throw error {"test", map[string]string{"test": "faketype"}, SearchParameter{Type: "faketype", Name: "test", Modifier: ""}, false}, + {"id", map[string]string{"id": "keyword"}, SearchParameter{Type: "keyword", Name: "id", Modifier: ""}, false}, {"given", map[string]string{"given": "string"}, SearchParameter{Type: "string", Name: "given", Modifier: ""}, false}, {"given:contains", map[string]string{"given": "string"}, SearchParameter{Type: "string", Name: "given", Modifier: "contains"}, false}, @@ -112,6 +113,8 @@ func TestProcessSearchParameterValue(t *testing.T) { {SearchParameter{Type: "quantity", Name: "valueQuantity", Modifier: ""}, "ap5.4|http://unitsofmeasure.org|mg|additional", SearchParameterValue{Value: float64(5.4), Prefix: "ap", SecondaryValues: map[string]interface{}{"valueQuantitySystem": "http://unitsofmeasure.org", "valueQuantityCode": "mg|additional"}}, false}, {SearchParameter{Type: "quantity", Name: "valueQuantity", Modifier: ""}, "5.4||", SearchParameterValue{Value: float64(5.4), Prefix: "", SecondaryValues: map[string]interface{}{}}, false}, {SearchParameter{Type: "quantity", Name: "valueQuantity", Modifier: ""}, "", SearchParameterValue{}, true}, + + {SearchParameter{Type: "keyword", Name: "id", Modifier: ""}, "1234", SearchParameterValue{Value: "1234", SecondaryValues: map[string]interface{}{}}, false}, } //test && assert @@ -155,6 +158,8 @@ func TestSearchCodeToWhereClause(t *testing.T) { {SearchParameter{Type: "token", Name: "code", Modifier: ""}, SearchParameterValue{Value: "ha125", Prefix: "", SecondaryValues: map[string]interface{}{"codeSystem": "http://acme.org/conditions/codes"}}, "0_0", "(codeJson.value ->> '$.code' = @code_0_0 AND codeJson.value ->> '$.system' = @codeSystem_0_0)", map[string]interface{}{"code_0_0": "ha125", "codeSystem_0_0": "http://acme.org/conditions/codes"}, false}, {SearchParameter{Type: "token", Name: "code", Modifier: ""}, SearchParameterValue{Value: "ha125", Prefix: "", SecondaryValues: map[string]interface{}{}}, "0_0", "(codeJson.value ->> '$.code' = @code_0_0)", map[string]interface{}{"code_0_0": "ha125"}, false}, {SearchParameter{Type: "token", Name: "identifier", Modifier: "otype"}, SearchParameterValue{Value: "MR|446053", Prefix: "", SecondaryValues: map[string]interface{}{"identifierSystem": "http://terminology.hl7.org/CodeSystem/v2-0203"}}, "0_0", "(identifierJson.value ->> '$.code' = @identifier_0_0 AND identifierJson.value ->> '$.system' = @identifierSystem_0_0)", map[string]interface{}{"identifier_0_0": "MR|446053", "identifierSystem_0_0": "http://terminology.hl7.org/CodeSystem/v2-0203"}, false}, + + {SearchParameter{Type: "keyword", Name: "id", Modifier: ""}, SearchParameterValue{Value: "1234", Prefix: "", SecondaryValues: map[string]interface{}{}}, "0_0", "(id = @id_0_0)", map[string]interface{}{"id_0_0": "1234"}, false}, } //test && assert @@ -181,6 +186,7 @@ func TestSearchCodeToFromClause(t *testing.T) { }{ {SearchParameter{Type: "number", Name: "probability", Modifier: ""}, "", false}, {SearchParameter{Type: "date", Name: "issueDate", Modifier: ""}, "", false}, + {SearchParameter{Type: "keyword", Name: "id", Modifier: ""}, "", false}, {SearchParameter{Type: "token", Name: "hello", Modifier: ""}, "json_each(fhir.hello) as helloJson", false}, } diff --git a/backend/pkg/models/database/fhir_account.go b/backend/pkg/models/database/fhir_account.go index 7d95c402..d3a101a3 100644 --- a/backend/pkg/models/database/fhir_account.go +++ b/backend/pkg/models/database/fhir_account.go @@ -54,18 +54,23 @@ type FhirAccount struct { func (s *FhirAccount) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "name": "string", - "owner": "reference", - "period": "date", - "profile": "reference", - "status": "token", - "subject": "reference", - "tag": "token", - "text": "string", - "type": "special", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "name": "string", + "owner": "reference", + "period": "date", + "profile": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "subject": "reference", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_adverse_event.go b/backend/pkg/models/database/fhir_adverse_event.go index c407f898..c125baa1 100644 --- a/backend/pkg/models/database/fhir_adverse_event.go +++ b/backend/pkg/models/database/fhir_adverse_event.go @@ -72,24 +72,29 @@ type FhirAdverseEvent struct { func (s *FhirAdverseEvent) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "actuality": "token", - "category": "token", - "date": "date", - "event": "token", - "language": "token", - "lastUpdated": "date", - "location": "reference", - "profile": "reference", - "recorder": "reference", - "resultingcondition": "reference", - "seriousness": "token", - "severity": "token", - "study": "reference", - "subject": "reference", - "substance": "reference", - "tag": "token", - "text": "string", - "type": "special", + "actuality": "token", + "category": "token", + "date": "date", + "event": "token", + "id": "keyword", + "language": "token", + "lastUpdated": "date", + "location": "reference", + "profile": "reference", + "recorder": "reference", + "resultingcondition": "reference", + "seriousness": "token", + "severity": "token", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "study": "reference", + "subject": "reference", + "substance": "reference", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_allergy_intolerance.go b/backend/pkg/models/database/fhir_allergy_intolerance.go index 78acf877..b8bb04e8 100644 --- a/backend/pkg/models/database/fhir_allergy_intolerance.go +++ b/backend/pkg/models/database/fhir_allergy_intolerance.go @@ -148,26 +148,31 @@ type FhirAllergyIntolerance struct { func (s *FhirAllergyIntolerance) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "asserter": "reference", - "category": "token", - "clinicalStatus": "token", - "code": "token", - "criticality": "token", - "date": "date", - "identifier": "token", - "language": "token", - "lastDate": "date", - "lastUpdated": "date", - "manifestation": "token", - "onset": "date", - "profile": "reference", - "recorder": "reference", - "route": "token", - "severity": "token", - "tag": "token", - "text": "string", - "type": "special", - "verificationStatus": "token", + "asserter": "reference", + "category": "token", + "clinicalStatus": "token", + "code": "token", + "criticality": "token", + "date": "date", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastDate": "date", + "lastUpdated": "date", + "manifestation": "token", + "onset": "date", + "profile": "reference", + "recorder": "reference", + "route": "token", + "severity": "token", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "tag": "token", + "text": "string", + "type": "special", + "verificationStatus": "token", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_appointment.go b/backend/pkg/models/database/fhir_appointment.go index 7dcca1b5..abbb229f 100644 --- a/backend/pkg/models/database/fhir_appointment.go +++ b/backend/pkg/models/database/fhir_appointment.go @@ -84,28 +84,33 @@ type FhirAppointment struct { func (s *FhirAppointment) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "actor": "reference", - "appointmentType": "token", - "basedOn": "reference", - "date": "date", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "location": "reference", - "partStatus": "token", - "practitioner": "reference", - "profile": "reference", - "reasonCode": "token", - "reasonReference": "reference", - "serviceCategory": "token", - "serviceType": "token", - "slot": "reference", - "specialty": "token", - "status": "token", - "supportingInfo": "reference", - "tag": "token", - "text": "string", - "type": "special", + "actor": "reference", + "appointmentType": "token", + "basedOn": "reference", + "date": "date", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "location": "reference", + "partStatus": "token", + "practitioner": "reference", + "profile": "reference", + "reasonCode": "token", + "reasonReference": "reference", + "serviceCategory": "token", + "serviceType": "token", + "slot": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "specialty": "token", + "status": "token", + "supportingInfo": "reference", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_binary.go b/backend/pkg/models/database/fhir_binary.go index ff8aefe0..e0d259c9 100644 --- a/backend/pkg/models/database/fhir_binary.go +++ b/backend/pkg/models/database/fhir_binary.go @@ -36,12 +36,17 @@ type FhirBinary struct { func (s *FhirBinary) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "language": "token", - "lastUpdated": "date", - "profile": "reference", - "tag": "token", - "text": "string", - "type": "special", + "id": "keyword", + "language": "token", + "lastUpdated": "date", + "profile": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_care_plan.go b/backend/pkg/models/database/fhir_care_plan.go index 282b54fc..c385a666 100644 --- a/backend/pkg/models/database/fhir_care_plan.go +++ b/backend/pkg/models/database/fhir_care_plan.go @@ -156,6 +156,7 @@ func (s *FhirCarePlan) GetSearchParameters() map[string]string { "date": "date", "encounter": "reference", "goal": "reference", + "id": "keyword", "identifier": "token", "instantiatesCanonical": "reference", "instantiatesUri": "uri", @@ -166,6 +167,10 @@ func (s *FhirCarePlan) GetSearchParameters() map[string]string { "performer": "reference", "profile": "reference", "replaces": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", "status": "token", "subject": "reference", "tag": "token", diff --git a/backend/pkg/models/database/fhir_care_team.go b/backend/pkg/models/database/fhir_care_team.go index 6355b4c4..262c9da8 100644 --- a/backend/pkg/models/database/fhir_care_team.go +++ b/backend/pkg/models/database/fhir_care_team.go @@ -110,19 +110,24 @@ type FhirCareTeam struct { func (s *FhirCareTeam) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "category": "token", - "date": "date", - "encounter": "reference", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "participant": "reference", - "profile": "reference", - "status": "token", - "subject": "reference", - "tag": "token", - "text": "string", - "type": "special", + "category": "token", + "date": "date", + "encounter": "reference", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "participant": "reference", + "profile": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "subject": "reference", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_claim.go b/backend/pkg/models/database/fhir_claim.go index 483a8534..38d4cb53 100644 --- a/backend/pkg/models/database/fhir_claim.go +++ b/backend/pkg/models/database/fhir_claim.go @@ -84,28 +84,33 @@ type FhirClaim struct { func (s *FhirClaim) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "careTeam": "reference", - "created": "date", - "detailUdi": "reference", - "encounter": "reference", - "enterer": "reference", - "facility": "reference", - "identifier": "token", - "insurer": "reference", - "itemUdi": "reference", - "language": "token", - "lastUpdated": "date", - "payee": "reference", - "priority": "token", - "procedureUdi": "reference", - "profile": "reference", - "provider": "reference", - "status": "token", - "subdetailUdi": "reference", - "tag": "token", - "text": "string", - "type": "special", - "use": "token", + "careTeam": "reference", + "created": "date", + "detailUdi": "reference", + "encounter": "reference", + "enterer": "reference", + "facility": "reference", + "id": "keyword", + "identifier": "token", + "insurer": "reference", + "itemUdi": "reference", + "language": "token", + "lastUpdated": "date", + "payee": "reference", + "priority": "token", + "procedureUdi": "reference", + "profile": "reference", + "provider": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "subdetailUdi": "reference", + "tag": "token", + "text": "string", + "type": "special", + "use": "token", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_claim_response.go b/backend/pkg/models/database/fhir_claim_response.go index 5c161023..c33cc01d 100644 --- a/backend/pkg/models/database/fhir_claim_response.go +++ b/backend/pkg/models/database/fhir_claim_response.go @@ -66,22 +66,27 @@ type FhirClaimResponse struct { func (s *FhirClaimResponse) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "created": "date", - "disposition": "string", - "identifier": "token", - "insurer": "reference", - "language": "token", - "lastUpdated": "date", - "outcome": "token", - "paymentDate": "date", - "profile": "reference", - "request": "reference", - "requestor": "reference", - "status": "token", - "tag": "token", - "text": "string", - "type": "special", - "use": "token", + "created": "date", + "disposition": "string", + "id": "keyword", + "identifier": "token", + "insurer": "reference", + "language": "token", + "lastUpdated": "date", + "outcome": "token", + "paymentDate": "date", + "profile": "reference", + "request": "reference", + "requestor": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "tag": "token", + "text": "string", + "type": "special", + "use": "token", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_composition.go b/backend/pkg/models/database/fhir_composition.go index 6b4961d5..307a3a15 100644 --- a/backend/pkg/models/database/fhir_composition.go +++ b/backend/pkg/models/database/fhir_composition.go @@ -152,28 +152,33 @@ type FhirComposition struct { func (s *FhirComposition) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "attester": "reference", - "author": "reference", - "category": "token", - "confidentiality": "token", - "context": "token", - "date": "date", - "encounter": "reference", - "entry": "reference", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "period": "date", - "profile": "reference", - "relatedId": "token", - "relatedRef": "reference", - "section": "token", - "status": "token", - "subject": "reference", - "tag": "token", - "text": "string", - "title": "string", - "type": "special", + "attester": "reference", + "author": "reference", + "category": "token", + "confidentiality": "token", + "context": "token", + "date": "date", + "encounter": "reference", + "entry": "reference", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "period": "date", + "profile": "reference", + "relatedId": "token", + "relatedRef": "reference", + "section": "token", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "subject": "reference", + "tag": "token", + "text": "string", + "title": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_condition.go b/backend/pkg/models/database/fhir_condition.go index 53b967c2..13d7b4a5 100644 --- a/backend/pkg/models/database/fhir_condition.go +++ b/backend/pkg/models/database/fhir_condition.go @@ -146,32 +146,37 @@ type FhirCondition struct { func (s *FhirCondition) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "abatementAge": "quantity", - "abatementDate": "date", - "abatementString": "string", - "asserter": "reference", - "bodySite": "token", - "category": "token", - "clinicalStatus": "token", - "code": "token", - "encounter": "reference", - "evidence": "token", - "evidenceDetail": "reference", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "onsetAge": "quantity", - "onsetDate": "date", - "onsetInfo": "string", - "profile": "reference", - "recordedDate": "date", - "severity": "token", - "stage": "token", - "subject": "reference", - "tag": "token", - "text": "string", - "type": "special", - "verificationStatus": "token", + "abatementAge": "quantity", + "abatementDate": "date", + "abatementString": "string", + "asserter": "reference", + "bodySite": "token", + "category": "token", + "clinicalStatus": "token", + "code": "token", + "encounter": "reference", + "evidence": "token", + "evidenceDetail": "reference", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "onsetAge": "quantity", + "onsetDate": "date", + "onsetInfo": "string", + "profile": "reference", + "recordedDate": "date", + "severity": "token", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "stage": "token", + "subject": "reference", + "tag": "token", + "text": "string", + "type": "special", + "verificationStatus": "token", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_consent.go b/backend/pkg/models/database/fhir_consent.go index 69f6fb16..167c9a7c 100644 --- a/backend/pkg/models/database/fhir_consent.go +++ b/backend/pkg/models/database/fhir_consent.go @@ -131,26 +131,31 @@ type FhirConsent struct { func (s *FhirConsent) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "action": "token", - "actor": "reference", - "category": "token", - "consentor": "reference", - "data": "reference", - "date": "date", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "organization": "reference", - "period": "date", - "profile": "reference", - "purpose": "token", - "scope": "token", - "securityLabel": "token", - "sourceReference": "reference", - "status": "token", - "tag": "token", - "text": "string", - "type": "special", + "action": "token", + "actor": "reference", + "category": "token", + "consentor": "reference", + "data": "reference", + "date": "date", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "organization": "reference", + "period": "date", + "profile": "reference", + "purpose": "token", + "scope": "token", + "securityLabel": "token", + "sourceReference": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_coverage.go b/backend/pkg/models/database/fhir_coverage.go index 6f57d864..b1d8e546 100644 --- a/backend/pkg/models/database/fhir_coverage.go +++ b/backend/pkg/models/database/fhir_coverage.go @@ -63,21 +63,26 @@ type FhirCoverage struct { func (s *FhirCoverage) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "beneficiary": "reference", - "classType": "token", - "classValue": "string", - "dependent": "string", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "payor": "reference", - "policyHolder": "reference", - "profile": "reference", - "status": "token", - "subscriber": "reference", - "tag": "token", - "text": "string", - "type": "special", + "beneficiary": "reference", + "classType": "token", + "classValue": "string", + "dependent": "string", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "payor": "reference", + "policyHolder": "reference", + "profile": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "subscriber": "reference", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_coverage_eligibility_request.go b/backend/pkg/models/database/fhir_coverage_eligibility_request.go index 96166e01..574d7a88 100644 --- a/backend/pkg/models/database/fhir_coverage_eligibility_request.go +++ b/backend/pkg/models/database/fhir_coverage_eligibility_request.go @@ -54,18 +54,23 @@ type FhirCoverageEligibilityRequest struct { func (s *FhirCoverageEligibilityRequest) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "created": "date", - "enterer": "reference", - "facility": "reference", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "profile": "reference", - "provider": "reference", - "status": "token", - "tag": "token", - "text": "string", - "type": "special", + "created": "date", + "enterer": "reference", + "facility": "reference", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "profile": "reference", + "provider": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_coverage_eligibility_response.go b/backend/pkg/models/database/fhir_coverage_eligibility_response.go index 73ff2a9a..f8fdae01 100644 --- a/backend/pkg/models/database/fhir_coverage_eligibility_response.go +++ b/backend/pkg/models/database/fhir_coverage_eligibility_response.go @@ -60,20 +60,25 @@ type FhirCoverageEligibilityResponse struct { func (s *FhirCoverageEligibilityResponse) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "created": "date", - "disposition": "string", - "identifier": "token", - "insurer": "reference", - "language": "token", - "lastUpdated": "date", - "outcome": "token", - "profile": "reference", - "request": "reference", - "requestor": "reference", - "status": "token", - "tag": "token", - "text": "string", - "type": "special", + "created": "date", + "disposition": "string", + "id": "keyword", + "identifier": "token", + "insurer": "reference", + "language": "token", + "lastUpdated": "date", + "outcome": "token", + "profile": "reference", + "request": "reference", + "requestor": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_device.go b/backend/pkg/models/database/fhir_device.go index 3bb5e67a..a40011bd 100644 --- a/backend/pkg/models/database/fhir_device.go +++ b/backend/pkg/models/database/fhir_device.go @@ -66,22 +66,27 @@ type FhirDevice struct { func (s *FhirDevice) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "deviceName": "string", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "location": "reference", - "manufacturer": "string", - "model": "string", - "organization": "reference", - "profile": "reference", - "status": "token", - "tag": "token", - "text": "string", - "type": "special", - "udiCarrier": "string", - "udiDi": "string", - "url": "uri", + "deviceName": "string", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "location": "reference", + "manufacturer": "string", + "model": "string", + "organization": "reference", + "profile": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "tag": "token", + "text": "string", + "type": "special", + "udiCarrier": "string", + "udiDi": "string", + "url": "uri", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_device_request.go b/backend/pkg/models/database/fhir_device_request.go index 9f1ae2d3..1d0710e3 100644 --- a/backend/pkg/models/database/fhir_device_request.go +++ b/backend/pkg/models/database/fhir_device_request.go @@ -159,6 +159,7 @@ func (s *FhirDeviceRequest) GetSearchParameters() map[string]string { "encounter": "reference", "eventDate": "date", "groupIdentifier": "token", + "id": "keyword", "identifier": "token", "instantiatesCanonical": "reference", "instantiatesUri": "uri", @@ -170,6 +171,10 @@ func (s *FhirDeviceRequest) GetSearchParameters() map[string]string { "priorRequest": "reference", "profile": "reference", "requester": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", "status": "token", "subject": "reference", "tag": "token", diff --git a/backend/pkg/models/database/fhir_diagnostic_report.go b/backend/pkg/models/database/fhir_diagnostic_report.go index 395f5dbf..2c04feab 100644 --- a/backend/pkg/models/database/fhir_diagnostic_report.go +++ b/backend/pkg/models/database/fhir_diagnostic_report.go @@ -166,27 +166,32 @@ type FhirDiagnosticReport struct { func (s *FhirDiagnosticReport) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "basedOn": "reference", - "category": "token", - "code": "token", - "conclusion": "token", - "date": "date", - "encounter": "reference", - "identifier": "token", - "issued": "date", - "language": "token", - "lastUpdated": "date", - "media": "reference", - "performer": "reference", - "profile": "reference", - "result": "reference", - "resultsInterpreter": "reference", - "specimen": "reference", - "status": "token", - "subject": "reference", - "tag": "token", - "text": "string", - "type": "special", + "basedOn": "reference", + "category": "token", + "code": "token", + "conclusion": "token", + "date": "date", + "encounter": "reference", + "id": "keyword", + "identifier": "token", + "issued": "date", + "language": "token", + "lastUpdated": "date", + "media": "reference", + "performer": "reference", + "profile": "reference", + "result": "reference", + "resultsInterpreter": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "specimen": "reference", + "status": "token", + "subject": "reference", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_document_manifest.go b/backend/pkg/models/database/fhir_document_manifest.go index 20e81224..8a1544c4 100644 --- a/backend/pkg/models/database/fhir_document_manifest.go +++ b/backend/pkg/models/database/fhir_document_manifest.go @@ -102,23 +102,28 @@ type FhirDocumentManifest struct { func (s *FhirDocumentManifest) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "author": "reference", - "created": "date", - "description": "string", - "identifier": "token", - "item": "reference", - "language": "token", - "lastUpdated": "date", - "profile": "reference", - "recipient": "reference", - "relatedId": "token", - "relatedRef": "reference", - "source": "uri", - "status": "token", - "subject": "reference", - "tag": "token", - "text": "string", - "type": "special", + "author": "reference", + "created": "date", + "description": "string", + "id": "keyword", + "identifier": "token", + "item": "reference", + "language": "token", + "lastUpdated": "date", + "profile": "reference", + "recipient": "reference", + "relatedId": "token", + "relatedRef": "reference", + "source": "uri", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "subject": "reference", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_document_reference.go b/backend/pkg/models/database/fhir_document_reference.go index cab56e15..188b34ba 100644 --- a/backend/pkg/models/database/fhir_document_reference.go +++ b/backend/pkg/models/database/fhir_document_reference.go @@ -147,33 +147,38 @@ type FhirDocumentReference struct { func (s *FhirDocumentReference) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "authenticator": "reference", - "author": "reference", - "category": "token", - "contenttype": "token", - "custodian": "reference", - "date": "date", - "description": "string", - "encounter": "reference", - "event": "token", - "facility": "token", - "format": "token", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "location": "uri", - "period": "date", - "profile": "reference", - "related": "reference", - "relatesto": "reference", - "relation": "token", - "securityLabel": "token", - "setting": "token", - "status": "token", - "subject": "reference", - "tag": "token", - "text": "string", - "type": "special", + "authenticator": "reference", + "author": "reference", + "category": "token", + "contenttype": "token", + "custodian": "reference", + "date": "date", + "description": "string", + "encounter": "reference", + "event": "token", + "facility": "token", + "format": "token", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "location": "uri", + "period": "date", + "profile": "reference", + "related": "reference", + "relatesto": "reference", + "relation": "token", + "securityLabel": "token", + "setting": "token", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "subject": "reference", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_encounter.go b/backend/pkg/models/database/fhir_encounter.go index 34a6566d..684cd884 100644 --- a/backend/pkg/models/database/fhir_encounter.go +++ b/backend/pkg/models/database/fhir_encounter.go @@ -152,33 +152,38 @@ type FhirEncounter struct { func (s *FhirEncounter) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "account": "reference", - "appointment": "reference", - "basedOn": "reference", - "class": "token", - "date": "date", - "diagnosis": "reference", - "episodeOfCare": "reference", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "length": "quantity", - "location": "reference", - "locationPeriod": "date", - "partOf": "reference", - "participant": "reference", - "participantType": "token", - "practitioner": "reference", - "profile": "reference", - "reasonCode": "token", - "reasonReference": "reference", - "serviceProvider": "reference", - "specialArrangement": "token", - "status": "token", - "subject": "reference", - "tag": "token", - "text": "string", - "type": "special", + "account": "reference", + "appointment": "reference", + "basedOn": "reference", + "class": "token", + "date": "date", + "diagnosis": "reference", + "episodeOfCare": "reference", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "length": "quantity", + "location": "reference", + "locationPeriod": "date", + "partOf": "reference", + "participant": "reference", + "participantType": "token", + "practitioner": "reference", + "profile": "reference", + "reasonCode": "token", + "reasonReference": "reference", + "serviceProvider": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "specialArrangement": "token", + "status": "token", + "subject": "reference", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_endpoint.go b/backend/pkg/models/database/fhir_endpoint.go index bab3254b..675ac877 100644 --- a/backend/pkg/models/database/fhir_endpoint.go +++ b/backend/pkg/models/database/fhir_endpoint.go @@ -54,18 +54,23 @@ type FhirEndpoint struct { func (s *FhirEndpoint) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "connectionType": "token", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "name": "string", - "organization": "reference", - "payloadType": "token", - "profile": "reference", - "status": "token", - "tag": "token", - "text": "string", - "type": "special", + "connectionType": "token", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "name": "string", + "organization": "reference", + "payloadType": "token", + "profile": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_enrollment_request.go b/backend/pkg/models/database/fhir_enrollment_request.go index 77b6bcb1..178e5736 100644 --- a/backend/pkg/models/database/fhir_enrollment_request.go +++ b/backend/pkg/models/database/fhir_enrollment_request.go @@ -45,15 +45,20 @@ type FhirEnrollmentRequest struct { func (s *FhirEnrollmentRequest) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "profile": "reference", - "status": "token", - "subject": "reference", - "tag": "token", - "text": "string", - "type": "special", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "profile": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "subject": "reference", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_enrollment_response.go b/backend/pkg/models/database/fhir_enrollment_response.go index a83f35e4..c53681c7 100644 --- a/backend/pkg/models/database/fhir_enrollment_response.go +++ b/backend/pkg/models/database/fhir_enrollment_response.go @@ -45,15 +45,20 @@ type FhirEnrollmentResponse struct { func (s *FhirEnrollmentResponse) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "profile": "reference", - "request": "reference", - "status": "token", - "tag": "token", - "text": "string", - "type": "special", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "profile": "reference", + "request": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_explanation_of_benefit.go b/backend/pkg/models/database/fhir_explanation_of_benefit.go index 20e4a567..e2b6d24c 100644 --- a/backend/pkg/models/database/fhir_explanation_of_benefit.go +++ b/backend/pkg/models/database/fhir_explanation_of_benefit.go @@ -84,28 +84,33 @@ type FhirExplanationOfBenefit struct { func (s *FhirExplanationOfBenefit) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "careTeam": "reference", - "claim": "reference", - "coverage": "reference", - "created": "date", - "detailUdi": "reference", - "disposition": "string", - "encounter": "reference", - "enterer": "reference", - "facility": "reference", - "identifier": "token", - "itemUdi": "reference", - "language": "token", - "lastUpdated": "date", - "payee": "reference", - "procedureUdi": "reference", - "profile": "reference", - "provider": "reference", - "status": "token", - "subdetailUdi": "reference", - "tag": "token", - "text": "string", - "type": "special", + "careTeam": "reference", + "claim": "reference", + "coverage": "reference", + "created": "date", + "detailUdi": "reference", + "disposition": "string", + "encounter": "reference", + "enterer": "reference", + "facility": "reference", + "id": "keyword", + "identifier": "token", + "itemUdi": "reference", + "language": "token", + "lastUpdated": "date", + "payee": "reference", + "procedureUdi": "reference", + "profile": "reference", + "provider": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "subdetailUdi": "reference", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_family_member_history.go b/backend/pkg/models/database/fhir_family_member_history.go index 18fe4025..0ee3c551 100644 --- a/backend/pkg/models/database/fhir_family_member_history.go +++ b/backend/pkg/models/database/fhir_family_member_history.go @@ -132,6 +132,7 @@ func (s *FhirFamilyMemberHistory) GetSearchParameters() map[string]string { searchParameters := map[string]string{ "code": "token", "date": "date", + "id": "keyword", "identifier": "token", "instantiatesCanonical": "reference", "instantiatesUri": "uri", @@ -140,6 +141,10 @@ func (s *FhirFamilyMemberHistory) GetSearchParameters() map[string]string { "profile": "reference", "relationship": "token", "sex": "token", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", "status": "token", "tag": "token", "text": "string", diff --git a/backend/pkg/models/database/fhir_goal.go b/backend/pkg/models/database/fhir_goal.go index 4c731cc4..a310a89a 100644 --- a/backend/pkg/models/database/fhir_goal.go +++ b/backend/pkg/models/database/fhir_goal.go @@ -90,19 +90,24 @@ type FhirGoal struct { func (s *FhirGoal) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "achievementStatus": "token", - "category": "token", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "lifecycleStatus": "token", - "profile": "reference", - "startDate": "date", - "subject": "reference", - "tag": "token", - "targetDate": "date", - "text": "string", - "type": "special", + "achievementStatus": "token", + "category": "token", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "lifecycleStatus": "token", + "profile": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "startDate": "date", + "subject": "reference", + "tag": "token", + "targetDate": "date", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_imaging_study.go b/backend/pkg/models/database/fhir_imaging_study.go index 87fb34ed..3df44484 100644 --- a/backend/pkg/models/database/fhir_imaging_study.go +++ b/backend/pkg/models/database/fhir_imaging_study.go @@ -117,28 +117,33 @@ type FhirImagingStudy struct { func (s *FhirImagingStudy) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "basedon": "reference", - "bodysite": "token", - "dicomClass": "token", - "encounter": "reference", - "endpoint": "reference", - "identifier": "token", - "instance": "token", - "interpreter": "reference", - "language": "token", - "lastUpdated": "date", - "modality": "token", - "performer": "reference", - "profile": "reference", - "reason": "token", - "referrer": "reference", - "series": "token", - "started": "date", - "status": "token", - "subject": "reference", - "tag": "token", - "text": "string", - "type": "special", + "basedon": "reference", + "bodysite": "token", + "dicomClass": "token", + "encounter": "reference", + "endpoint": "reference", + "id": "keyword", + "identifier": "token", + "instance": "token", + "interpreter": "reference", + "language": "token", + "lastUpdated": "date", + "modality": "token", + "performer": "reference", + "profile": "reference", + "reason": "token", + "referrer": "reference", + "series": "token", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "started": "date", + "status": "token", + "subject": "reference", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_immunization.go b/backend/pkg/models/database/fhir_immunization.go index de3f1ed8..6708b34f 100644 --- a/backend/pkg/models/database/fhir_immunization.go +++ b/backend/pkg/models/database/fhir_immunization.go @@ -134,27 +134,32 @@ type FhirImmunization struct { func (s *FhirImmunization) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "date": "date", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "location": "reference", - "lotNumber": "string", - "manufacturer": "reference", - "performer": "reference", - "profile": "reference", - "reaction": "reference", - "reactionDate": "date", - "reasonCode": "token", - "reasonReference": "reference", - "series": "string", - "status": "token", - "statusReason": "token", - "tag": "token", - "targetDisease": "token", - "text": "string", - "type": "special", - "vaccineCode": "token", + "date": "date", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "location": "reference", + "lotNumber": "string", + "manufacturer": "reference", + "performer": "reference", + "profile": "reference", + "reaction": "reference", + "reactionDate": "date", + "reasonCode": "token", + "reasonReference": "reference", + "series": "string", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "statusReason": "token", + "tag": "token", + "targetDisease": "token", + "text": "string", + "type": "special", + "vaccineCode": "token", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_insurance_plan.go b/backend/pkg/models/database/fhir_insurance_plan.go index 05a5f5c2..247df6c8 100644 --- a/backend/pkg/models/database/fhir_insurance_plan.go +++ b/backend/pkg/models/database/fhir_insurance_plan.go @@ -75,25 +75,30 @@ type FhirInsurancePlan struct { func (s *FhirInsurancePlan) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "address": "string", - "addressCity": "string", - "addressCountry": "string", - "addressPostalcode": "string", - "addressState": "string", - "addressUse": "token", - "administeredBy": "reference", - "endpoint": "reference", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "name": "string", - "ownedBy": "reference", - "phonetic": "string", - "profile": "reference", - "status": "token", - "tag": "token", - "text": "string", - "type": "special", + "address": "string", + "addressCity": "string", + "addressCountry": "string", + "addressPostalcode": "string", + "addressState": "string", + "addressUse": "token", + "administeredBy": "reference", + "endpoint": "reference", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "name": "string", + "ownedBy": "reference", + "phonetic": "string", + "profile": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_location.go b/backend/pkg/models/database/fhir_location.go index 3780ba94..c4ef1c6b 100644 --- a/backend/pkg/models/database/fhir_location.go +++ b/backend/pkg/models/database/fhir_location.go @@ -75,25 +75,30 @@ type FhirLocation struct { func (s *FhirLocation) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "address": "string", - "addressCity": "string", - "addressCountry": "string", - "addressPostalcode": "string", - "addressState": "string", - "addressUse": "token", - "endpoint": "reference", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "name": "string", - "operationalStatus": "token", - "organization": "reference", - "partof": "reference", - "profile": "reference", - "status": "token", - "tag": "token", - "text": "string", - "type": "special", + "address": "string", + "addressCity": "string", + "addressCountry": "string", + "addressPostalcode": "string", + "addressState": "string", + "addressUse": "token", + "endpoint": "reference", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "name": "string", + "operationalStatus": "token", + "organization": "reference", + "partof": "reference", + "profile": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_media.go b/backend/pkg/models/database/fhir_media.go index 50c74121..10e20bf1 100644 --- a/backend/pkg/models/database/fhir_media.go +++ b/backend/pkg/models/database/fhir_media.go @@ -69,23 +69,28 @@ type FhirMedia struct { func (s *FhirMedia) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "basedOn": "reference", - "created": "date", - "device": "reference", - "encounter": "reference", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "modality": "token", - "operator": "reference", - "profile": "reference", - "site": "token", - "status": "token", - "subject": "reference", - "tag": "token", - "text": "string", - "type": "special", - "view": "token", + "basedOn": "reference", + "created": "date", + "device": "reference", + "encounter": "reference", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "modality": "token", + "operator": "reference", + "profile": "reference", + "site": "token", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "subject": "reference", + "tag": "token", + "text": "string", + "type": "special", + "view": "token", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_medication.go b/backend/pkg/models/database/fhir_medication.go index 94c6951f..705793ee 100644 --- a/backend/pkg/models/database/fhir_medication.go +++ b/backend/pkg/models/database/fhir_medication.go @@ -80,21 +80,26 @@ type FhirMedication struct { func (s *FhirMedication) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "code": "token", - "expirationDate": "date", - "form": "token", - "identifier": "token", - "ingredient": "reference", - "ingredientCode": "token", - "language": "token", - "lastUpdated": "date", - "lotNumber": "token", - "manufacturer": "reference", - "profile": "reference", - "status": "token", - "tag": "token", - "text": "string", - "type": "special", + "code": "token", + "expirationDate": "date", + "form": "token", + "id": "keyword", + "identifier": "token", + "ingredient": "reference", + "ingredientCode": "token", + "language": "token", + "lastUpdated": "date", + "lotNumber": "token", + "manufacturer": "reference", + "profile": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_medication_administration.go b/backend/pkg/models/database/fhir_medication_administration.go index 1d4764d7..a126572d 100644 --- a/backend/pkg/models/database/fhir_medication_administration.go +++ b/backend/pkg/models/database/fhir_medication_administration.go @@ -136,24 +136,29 @@ type FhirMedicationAdministration struct { func (s *FhirMedicationAdministration) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "code": "token", - "context": "reference", - "device": "reference", - "effectiveTime": "date", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "medication": "reference", - "performer": "reference", - "profile": "reference", - "reasonGiven": "token", - "reasonNotGiven": "token", - "request": "reference", - "status": "token", - "subject": "reference", - "tag": "token", - "text": "string", - "type": "special", + "code": "token", + "context": "reference", + "device": "reference", + "effectiveTime": "date", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "medication": "reference", + "performer": "reference", + "profile": "reference", + "reasonGiven": "token", + "reasonNotGiven": "token", + "request": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "subject": "reference", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_medication_dispense.go b/backend/pkg/models/database/fhir_medication_dispense.go index e5af7596..b5aabe08 100644 --- a/backend/pkg/models/database/fhir_medication_dispense.go +++ b/backend/pkg/models/database/fhir_medication_dispense.go @@ -143,25 +143,30 @@ type FhirMedicationDispense struct { func (s *FhirMedicationDispense) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "code": "token", - "context": "reference", - "destination": "reference", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "medication": "reference", - "performer": "reference", - "prescription": "reference", - "profile": "reference", - "receiver": "reference", - "responsibleparty": "reference", - "status": "token", - "subject": "reference", - "tag": "token", - "text": "string", - "type": "special", - "whenhandedover": "date", - "whenprepared": "date", + "code": "token", + "context": "reference", + "destination": "reference", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "medication": "reference", + "performer": "reference", + "prescription": "reference", + "profile": "reference", + "receiver": "reference", + "responsibleparty": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "subject": "reference", + "tag": "token", + "text": "string", + "type": "special", + "whenhandedover": "date", + "whenprepared": "date", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_medication_request.go b/backend/pkg/models/database/fhir_medication_request.go index 8b23c806..a135ea16 100644 --- a/backend/pkg/models/database/fhir_medication_request.go +++ b/backend/pkg/models/database/fhir_medication_request.go @@ -158,6 +158,7 @@ func (s *FhirMedicationRequest) GetSearchParameters() map[string]string { "code": "token", "date": "date", "encounter": "reference", + "id": "keyword", "identifier": "token", "intendedDispenser": "reference", "intendedPerformer": "reference", @@ -169,6 +170,10 @@ func (s *FhirMedicationRequest) GetSearchParameters() map[string]string { "priority": "token", "profile": "reference", "requester": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", "status": "token", "subject": "reference", "tag": "token", diff --git a/backend/pkg/models/database/fhir_medication_statement.go b/backend/pkg/models/database/fhir_medication_statement.go index 3f8d70a7..198b2cb1 100644 --- a/backend/pkg/models/database/fhir_medication_statement.go +++ b/backend/pkg/models/database/fhir_medication_statement.go @@ -130,22 +130,27 @@ type FhirMedicationStatement struct { func (s *FhirMedicationStatement) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "category": "token", - "code": "token", - "context": "reference", - "effective": "date", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "medication": "reference", - "partOf": "reference", - "profile": "reference", - "source": "reference", - "status": "token", - "subject": "reference", - "tag": "token", - "text": "string", - "type": "special", + "category": "token", + "code": "token", + "context": "reference", + "effective": "date", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "medication": "reference", + "partOf": "reference", + "profile": "reference", + "source": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "subject": "reference", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_nutrition_order.go b/backend/pkg/models/database/fhir_nutrition_order.go index 4f58e019..ca87371f 100644 --- a/backend/pkg/models/database/fhir_nutrition_order.go +++ b/backend/pkg/models/database/fhir_nutrition_order.go @@ -121,6 +121,7 @@ func (s *FhirNutritionOrder) GetSearchParameters() map[string]string { "datetime": "date", "encounter": "reference", "formula": "token", + "id": "keyword", "identifier": "token", "instantiatesCanonical": "reference", "instantiatesUri": "uri", @@ -129,6 +130,10 @@ func (s *FhirNutritionOrder) GetSearchParameters() map[string]string { "oraldiet": "token", "profile": "reference", "provider": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", "status": "token", "supplement": "token", "tag": "token", diff --git a/backend/pkg/models/database/fhir_observation.go b/backend/pkg/models/database/fhir_observation.go index 6a832b12..88556010 100644 --- a/backend/pkg/models/database/fhir_observation.go +++ b/backend/pkg/models/database/fhir_observation.go @@ -226,6 +226,7 @@ func (s *FhirObservation) GetSearchParameters() map[string]string { "encounter": "reference", "focus": "reference", "hasMember": "reference", + "id": "keyword", "identifier": "token", "language": "token", "lastUpdated": "date", @@ -233,6 +234,10 @@ func (s *FhirObservation) GetSearchParameters() map[string]string { "partOf": "reference", "performer": "reference", "profile": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", "specimen": "reference", "status": "token", "subject": "reference", diff --git a/backend/pkg/models/database/fhir_organization.go b/backend/pkg/models/database/fhir_organization.go index 77add1a2..8c2fd306 100644 --- a/backend/pkg/models/database/fhir_organization.go +++ b/backend/pkg/models/database/fhir_organization.go @@ -72,24 +72,29 @@ type FhirOrganization struct { func (s *FhirOrganization) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "active": "token", - "address": "string", - "addressCity": "string", - "addressCountry": "string", - "addressPostalcode": "string", - "addressState": "string", - "addressUse": "token", - "endpoint": "reference", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "name": "string", - "partof": "reference", - "phonetic": "string", - "profile": "reference", - "tag": "token", - "text": "string", - "type": "special", + "active": "token", + "address": "string", + "addressCity": "string", + "addressCountry": "string", + "addressPostalcode": "string", + "addressState": "string", + "addressUse": "token", + "endpoint": "reference", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "name": "string", + "partof": "reference", + "phonetic": "string", + "profile": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_organization_affiliation.go b/backend/pkg/models/database/fhir_organization_affiliation.go index b8551be3..4f1c6d0b 100644 --- a/backend/pkg/models/database/fhir_organization_affiliation.go +++ b/backend/pkg/models/database/fhir_organization_affiliation.go @@ -82,6 +82,7 @@ func (s *FhirOrganizationAffiliation) GetSearchParameters() map[string]string { "date": "date", "email": "token", "endpoint": "reference", + "id": "keyword", "identifier": "token", "language": "token", "lastUpdated": "date", @@ -93,6 +94,10 @@ func (s *FhirOrganizationAffiliation) GetSearchParameters() map[string]string { "profile": "reference", "role": "token", "service": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", "specialty": "token", "tag": "token", "telecom": "token", diff --git a/backend/pkg/models/database/fhir_patient.go b/backend/pkg/models/database/fhir_patient.go index c8cd906e..19f2588b 100644 --- a/backend/pkg/models/database/fhir_patient.go +++ b/backend/pkg/models/database/fhir_patient.go @@ -198,34 +198,39 @@ type FhirPatient struct { func (s *FhirPatient) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "active": "token", - "address": "string", - "addressCity": "string", - "addressCountry": "string", - "addressPostalcode": "string", - "addressState": "string", - "addressUse": "token", - "birthdate": "date", - "deathDate": "date", - "deceased": "token", - "email": "token", - "family": "string", - "gender": "token", - "generalPractitioner": "reference", - "given": "string", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "link": "reference", - "name": "string", - "organization": "reference", - "phone": "token", - "phonetic": "string", - "profile": "reference", - "tag": "token", - "telecom": "token", - "text": "string", - "type": "special", + "active": "token", + "address": "string", + "addressCity": "string", + "addressCountry": "string", + "addressPostalcode": "string", + "addressState": "string", + "addressUse": "token", + "birthdate": "date", + "deathDate": "date", + "deceased": "token", + "email": "token", + "family": "string", + "gender": "token", + "generalPractitioner": "reference", + "given": "string", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "link": "reference", + "name": "string", + "organization": "reference", + "phone": "token", + "phonetic": "string", + "profile": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "tag": "token", + "telecom": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_person.go b/backend/pkg/models/database/fhir_person.go index 037e05de..1948bd69 100644 --- a/backend/pkg/models/database/fhir_person.go +++ b/backend/pkg/models/database/fhir_person.go @@ -176,30 +176,35 @@ type FhirPerson struct { func (s *FhirPerson) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "address": "string", - "addressCity": "string", - "addressCountry": "string", - "addressPostalcode": "string", - "addressState": "string", - "addressUse": "token", - "birthdate": "date", - "email": "token", - "gender": "token", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "link": "reference", - "name": "string", - "organization": "reference", - "phone": "token", - "phonetic": "string", - "practitioner": "reference", - "profile": "reference", - "relatedperson": "reference", - "tag": "token", - "telecom": "token", - "text": "string", - "type": "special", + "address": "string", + "addressCity": "string", + "addressCountry": "string", + "addressPostalcode": "string", + "addressState": "string", + "addressUse": "token", + "birthdate": "date", + "email": "token", + "gender": "token", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "link": "reference", + "name": "string", + "organization": "reference", + "phone": "token", + "phonetic": "string", + "practitioner": "reference", + "profile": "reference", + "relatedperson": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "tag": "token", + "telecom": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_practitioner.go b/backend/pkg/models/database/fhir_practitioner.go index cd42fc04..3ccedebd 100644 --- a/backend/pkg/models/database/fhir_practitioner.go +++ b/backend/pkg/models/database/fhir_practitioner.go @@ -177,29 +177,34 @@ type FhirPractitioner struct { func (s *FhirPractitioner) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "active": "token", - "address": "string", - "addressCity": "string", - "addressCountry": "string", - "addressPostalcode": "string", - "addressState": "string", - "addressUse": "token", - "communication": "token", - "email": "token", - "family": "string", - "gender": "token", - "given": "string", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "name": "string", - "phone": "token", - "phonetic": "string", - "profile": "reference", - "tag": "token", - "telecom": "token", - "text": "string", - "type": "special", + "active": "token", + "address": "string", + "addressCity": "string", + "addressCountry": "string", + "addressPostalcode": "string", + "addressState": "string", + "addressUse": "token", + "communication": "token", + "email": "token", + "family": "string", + "gender": "token", + "given": "string", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "name": "string", + "phone": "token", + "phonetic": "string", + "profile": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "tag": "token", + "telecom": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_practitioner_role.go b/backend/pkg/models/database/fhir_practitioner_role.go index e3a4a7f8..c60fd87e 100644 --- a/backend/pkg/models/database/fhir_practitioner_role.go +++ b/backend/pkg/models/database/fhir_practitioner_role.go @@ -99,25 +99,30 @@ type FhirPractitionerRole struct { func (s *FhirPractitionerRole) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "active": "token", - "date": "date", - "email": "token", - "endpoint": "reference", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "location": "reference", - "organization": "reference", - "phone": "token", - "practitioner": "reference", - "profile": "reference", - "role": "token", - "service": "reference", - "specialty": "token", - "tag": "token", - "telecom": "token", - "text": "string", - "type": "special", + "active": "token", + "date": "date", + "email": "token", + "endpoint": "reference", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "location": "reference", + "organization": "reference", + "phone": "token", + "practitioner": "reference", + "profile": "reference", + "role": "token", + "service": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "specialty": "token", + "tag": "token", + "telecom": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_procedure.go b/backend/pkg/models/database/fhir_procedure.go index 24f1946e..e217da8f 100644 --- a/backend/pkg/models/database/fhir_procedure.go +++ b/backend/pkg/models/database/fhir_procedure.go @@ -171,6 +171,7 @@ func (s *FhirProcedure) GetSearchParameters() map[string]string { "code": "token", "date": "date", "encounter": "reference", + "id": "keyword", "identifier": "token", "instantiatesCanonical": "reference", "instantiatesUri": "uri", @@ -182,6 +183,10 @@ func (s *FhirProcedure) GetSearchParameters() map[string]string { "profile": "reference", "reasonCode": "token", "reasonReference": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", "status": "token", "subject": "reference", "tag": "token", diff --git a/backend/pkg/models/database/fhir_provenance.go b/backend/pkg/models/database/fhir_provenance.go index 7c9ae5c0..02a08596 100644 --- a/backend/pkg/models/database/fhir_provenance.go +++ b/backend/pkg/models/database/fhir_provenance.go @@ -63,21 +63,26 @@ type FhirProvenance struct { func (s *FhirProvenance) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "agent": "reference", - "agentRole": "token", - "agentType": "token", - "entity": "reference", - "language": "token", - "lastUpdated": "date", - "location": "reference", - "profile": "reference", - "recorded": "date", - "signatureType": "token", - "tag": "token", - "target": "reference", - "text": "string", - "type": "special", - "when": "date", + "agent": "reference", + "agentRole": "token", + "agentType": "token", + "entity": "reference", + "id": "keyword", + "language": "token", + "lastUpdated": "date", + "location": "reference", + "profile": "reference", + "recorded": "date", + "signatureType": "token", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "tag": "token", + "target": "reference", + "text": "string", + "type": "special", + "when": "date", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_questionnaire.go b/backend/pkg/models/database/fhir_questionnaire.go index 16c070c3..6f1f0095 100644 --- a/backend/pkg/models/database/fhir_questionnaire.go +++ b/backend/pkg/models/database/fhir_questionnaire.go @@ -87,29 +87,34 @@ type FhirQuestionnaire struct { func (s *FhirQuestionnaire) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "code": "token", - "context": "token", - "contextQuantity": "quantity", - "contextType": "token", - "date": "date", - "definition": "uri", - "description": "string", - "effective": "date", - "identifier": "token", - "jurisdiction": "token", - "language": "token", - "lastUpdated": "date", - "name": "string", - "profile": "reference", - "publisher": "string", - "status": "token", - "subjectType": "token", - "tag": "token", - "text": "string", - "title": "string", - "type": "special", - "url": "uri", - "version": "token", + "code": "token", + "context": "token", + "contextQuantity": "quantity", + "contextType": "token", + "date": "date", + "definition": "uri", + "description": "string", + "effective": "date", + "id": "keyword", + "identifier": "token", + "jurisdiction": "token", + "language": "token", + "lastUpdated": "date", + "name": "string", + "profile": "reference", + "publisher": "string", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "subjectType": "token", + "tag": "token", + "text": "string", + "title": "string", + "type": "special", + "url": "uri", + "version": "token", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_questionnaire_response.go b/backend/pkg/models/database/fhir_questionnaire_response.go index 90326e1a..b355f671 100644 --- a/backend/pkg/models/database/fhir_questionnaire_response.go +++ b/backend/pkg/models/database/fhir_questionnaire_response.go @@ -66,22 +66,27 @@ type FhirQuestionnaireResponse struct { func (s *FhirQuestionnaireResponse) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "author": "reference", - "authored": "date", - "basedOn": "reference", - "encounter": "reference", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "partOf": "reference", - "profile": "reference", - "questionnaire": "reference", - "source": "reference", - "status": "token", - "subject": "reference", - "tag": "token", - "text": "string", - "type": "special", + "author": "reference", + "authored": "date", + "basedOn": "reference", + "encounter": "reference", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "partOf": "reference", + "profile": "reference", + "questionnaire": "reference", + "source": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "subject": "reference", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_related_person.go b/backend/pkg/models/database/fhir_related_person.go index 3498d11a..27799870 100644 --- a/backend/pkg/models/database/fhir_related_person.go +++ b/backend/pkg/models/database/fhir_related_person.go @@ -170,28 +170,33 @@ type FhirRelatedPerson struct { func (s *FhirRelatedPerson) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "active": "token", - "address": "string", - "addressCity": "string", - "addressCountry": "string", - "addressPostalcode": "string", - "addressState": "string", - "addressUse": "token", - "birthdate": "date", - "email": "token", - "gender": "token", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "name": "string", - "phone": "token", - "phonetic": "string", - "profile": "reference", - "relationship": "token", - "tag": "token", - "telecom": "token", - "text": "string", - "type": "special", + "active": "token", + "address": "string", + "addressCity": "string", + "addressCountry": "string", + "addressPostalcode": "string", + "addressState": "string", + "addressUse": "token", + "birthdate": "date", + "email": "token", + "gender": "token", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "name": "string", + "phone": "token", + "phonetic": "string", + "profile": "reference", + "relationship": "token", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "tag": "token", + "telecom": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_schedule.go b/backend/pkg/models/database/fhir_schedule.go index e4772d6d..c3596051 100644 --- a/backend/pkg/models/database/fhir_schedule.go +++ b/backend/pkg/models/database/fhir_schedule.go @@ -57,19 +57,24 @@ type FhirSchedule struct { func (s *FhirSchedule) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "active": "token", - "actor": "reference", - "date": "date", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "profile": "reference", - "serviceCategory": "token", - "serviceType": "token", - "specialty": "token", - "tag": "token", - "text": "string", - "type": "special", + "active": "token", + "actor": "reference", + "date": "date", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "profile": "reference", + "serviceCategory": "token", + "serviceType": "token", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "specialty": "token", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_service_request.go b/backend/pkg/models/database/fhir_service_request.go index ce657c5c..cd5a3b7b 100644 --- a/backend/pkg/models/database/fhir_service_request.go +++ b/backend/pkg/models/database/fhir_service_request.go @@ -167,6 +167,7 @@ func (s *FhirServiceRequest) GetSearchParameters() map[string]string { "category": "token", "code": "token", "encounter": "reference", + "id": "keyword", "identifier": "token", "instantiatesCanonical": "reference", "instantiatesUri": "uri", @@ -181,6 +182,10 @@ func (s *FhirServiceRequest) GetSearchParameters() map[string]string { "replaces": "reference", "requester": "reference", "requisition": "token", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", "specimen": "reference", "status": "token", "subject": "reference", diff --git a/backend/pkg/models/database/fhir_slot.go b/backend/pkg/models/database/fhir_slot.go index f2b4c93b..57871a58 100644 --- a/backend/pkg/models/database/fhir_slot.go +++ b/backend/pkg/models/database/fhir_slot.go @@ -60,20 +60,25 @@ type FhirSlot struct { func (s *FhirSlot) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "appointmentType": "token", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "profile": "reference", - "schedule": "reference", - "serviceCategory": "token", - "serviceType": "token", - "specialty": "token", - "start": "date", - "status": "token", - "tag": "token", - "text": "string", - "type": "special", + "appointmentType": "token", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "profile": "reference", + "schedule": "reference", + "serviceCategory": "token", + "serviceType": "token", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "specialty": "token", + "start": "date", + "status": "token", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_specimen.go b/backend/pkg/models/database/fhir_specimen.go index 89c319f8..f5fefeb8 100644 --- a/backend/pkg/models/database/fhir_specimen.go +++ b/backend/pkg/models/database/fhir_specimen.go @@ -66,22 +66,27 @@ type FhirSpecimen struct { func (s *FhirSpecimen) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "accession": "token", - "bodysite": "token", - "collected": "date", - "collector": "reference", - "container": "token", - "containerId": "token", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "parent": "reference", - "profile": "reference", - "status": "token", - "subject": "reference", - "tag": "token", - "text": "string", - "type": "special", + "accession": "token", + "bodysite": "token", + "collected": "date", + "collector": "reference", + "container": "token", + "containerId": "token", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "parent": "reference", + "profile": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "subject": "reference", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/fhir_vision_prescription.go b/backend/pkg/models/database/fhir_vision_prescription.go index 88f42679..e321f4a1 100644 --- a/backend/pkg/models/database/fhir_vision_prescription.go +++ b/backend/pkg/models/database/fhir_vision_prescription.go @@ -99,17 +99,22 @@ type FhirVisionPrescription struct { func (s *FhirVisionPrescription) GetSearchParameters() map[string]string { searchParameters := map[string]string{ - "datewritten": "date", - "encounter": "reference", - "identifier": "token", - "language": "token", - "lastUpdated": "date", - "prescriber": "reference", - "profile": "reference", - "status": "token", - "tag": "token", - "text": "string", - "type": "special", + "datewritten": "date", + "encounter": "reference", + "id": "keyword", + "identifier": "token", + "language": "token", + "lastUpdated": "date", + "prescriber": "reference", + "profile": "reference", + "source_id": "keyword", + "source_resource_id": "keyword", + "source_resource_type": "keyword", + "source_uri": "keyword", + "status": "token", + "tag": "token", + "text": "string", + "type": "special", } return searchParameters } diff --git a/backend/pkg/models/database/generate.go b/backend/pkg/models/database/generate.go index 89be6d9a..d4fc2892 100644 --- a/backend/pkg/models/database/generate.go +++ b/backend/pkg/models/database/generate.go @@ -203,6 +203,13 @@ func main() { fieldNameLowerCamel := strcase.ToLowerCamel(fieldName) d[jen.Lit(fieldNameLowerCamel)] = jen.Lit(fieldInfo.FieldType) } + + d[jen.Lit("id")] = jen.Lit("keyword") + d[jen.Lit("source_id")] = jen.Lit("keyword") + d[jen.Lit("source_uri")] = jen.Lit("keyword") + d[jen.Lit("source_resource_id")] = jen.Lit("keyword") + d[jen.Lit("source_resource_type")] = jen.Lit("keyword") + })) g.Return(jen.Id("searchParameters")) }) diff --git a/backend/pkg/web/handler/dashboard/default.json b/backend/pkg/web/handler/dashboard/default.json index f16e8d1d..da885131 100644 --- a/backend/pkg/web/handler/dashboard/default.json +++ b/backend/pkg/web/handler/dashboard/default.json @@ -157,9 +157,9 @@ "select": [], "from": "Immunization", "where": {}, - - "aggregation_params":["resourceType"], - "aggregation_type":"countBy" + "aggregations":{ + "count_by": "*" + } } }, { @@ -170,9 +170,9 @@ "select": [], "from": "Claim", "where": {}, - - "aggregation_params":["resourceType"], - "aggregation_type":"countBy" + "aggregations":{ + "count_by": "*" + } } }], "parsing": { diff --git a/frontend/src/app/pipes/dataset-latest-entry.pipe.ts b/frontend/src/app/pipes/dataset-latest-entry.pipe.ts index f068982f..c40db3f7 100644 --- a/frontend/src/app/pipes/dataset-latest-entry.pipe.ts +++ b/frontend/src/app/pipes/dataset-latest-entry.pipe.ts @@ -8,37 +8,53 @@ import * as _ from 'lodash'; export class DatasetLatestEntryPipe implements PipeTransform { transform(dataset: ChartDataset<'line'>, round?: number, valLookupKey?: string, unitLookupKey?: string): string { - if(!round){ - round = 0 //round to nearest whole number - } - let lastItem = dataset?.data?.[dataset?.data?.length -1] || '' - // let valueKey = this.chartOptions?.parsing?.['yAxisKey'] || dataset?.parsing?.['key'] - console.log('latestEntryConfig', lastItem, valLookupKey, unitLookupKey, round) - let lastItemUnit = "" - let lastItemValue - - if(Array.isArray(lastItem)){ - lastItemValue = _.flatten(lastItem?.[0]?.[valLookupKey])?.[0] as string - lastItemUnit = _.flatten(lastItem?.[0]?.[unitLookupKey])?.[0] as string - } else if(typeof lastItem === 'object'){ - console.log('lastItem-object', lastItem?.[valLookupKey]) - lastItemValue = lastItem?.[valLookupKey] - lastItemUnit = lastItem?.[unitLookupKey] - } else { - //do nothing + if(!dataset) { + return '--' } - lastItemValue = this.roundToDecimalPlaces(lastItemValue, round) - if(lastItemUnit){ - return lastItemValue + ' ' + lastItemUnit - } else { - return lastItemValue.toString() + try{ + if (!round) { + round = 0 //round to nearest whole number + } + let lastItem = dataset?.data?.[dataset?.data?.length - 1] || '' + // let valueKey = this.chartOptions?.parsing?.['yAxisKey'] || dataset?.parsing?.['key'] + console.log('latestEntryConfig', lastItem, valLookupKey, unitLookupKey, round) + let lastItemUnit = "" + let lastItemValue + + if (Array.isArray(lastItem)) { + lastItemValue = _.flatten(lastItem?.[0]?.[valLookupKey])?.[0] as string + lastItemUnit = _.flatten(lastItem?.[0]?.[unitLookupKey])?.[0] as string + } else if (typeof lastItem === 'object') { + console.log('lastItem-object', lastItem?.[valLookupKey]) + lastItemValue = lastItem?.[valLookupKey] + lastItemUnit = lastItem?.[unitLookupKey] + } else { + //do nothing + } + + lastItemValue = this.roundToDecimalPlaces(lastItemValue, round) + if (lastItemUnit) { + return lastItemValue + ' ' + lastItemUnit + } else { + return lastItemValue.toString() + } + } + catch (e) { + return '--' } } roundToDecimalPlaces(value: string, decimalPlaces: number): string { - return parseFloat(value).toFixed(decimalPlaces).toString() + if(!value) { + return '--' + } + try{ + return parseFloat(value).toFixed(decimalPlaces).toString() + } catch (e) { + return '--' + } } } diff --git a/frontend/src/app/widgets/dual-gauges-widget/dual-gauges-widget.component.html b/frontend/src/app/widgets/dual-gauges-widget/dual-gauges-widget.component.html index bca5ed93..390739a6 100644 --- a/frontend/src/app/widgets/dual-gauges-widget/dual-gauges-widget.component.html +++ b/frontend/src/app/widgets/dual-gauges-widget/dual-gauges-widget.component.html @@ -22,7 +22,7 @@
-

3

+

{{chartDataset | datasetLatestEntry: 0:'value' }}

diff --git a/frontend/src/app/widgets/dual-gauges-widget/dual-gauges-widget.component.ts b/frontend/src/app/widgets/dual-gauges-widget/dual-gauges-widget.component.ts index de01feb2..7ca29619 100644 --- a/frontend/src/app/widgets/dual-gauges-widget/dual-gauges-widget.component.ts +++ b/frontend/src/app/widgets/dual-gauges-widget/dual-gauges-widget.component.ts @@ -5,10 +5,11 @@ import {DashboardWidgetComponent} from '../dashboard-widget/dashboard-widget.com import {ChartConfiguration} from 'chart.js/dist/types'; import {LoadingWidgetComponent} from '../loading-widget/loading-widget.component'; import {EmptyWidgetComponent} from '../empty-widget/empty-widget.component'; +import {PipesModule} from '../../pipes/pipes.module'; @Component({ standalone: true, - imports: [NgChartsModule,CommonModule, LoadingWidgetComponent, EmptyWidgetComponent], + imports: [NgChartsModule,CommonModule, LoadingWidgetComponent, EmptyWidgetComponent, PipesModule], selector: 'dual-gauges-widget', templateUrl: './dual-gauges-widget.component.html', styleUrls: ['./dual-gauges-widget.component.scss']